Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

search: json encode repo metadata for csv export#59334

Merged
stefanhengl merged 5 commits into
mainfrom
sh/csv-export-json-metadata
Jan 9, 2024
Merged

search: json encode repo metadata for csv export#59334
stefanhengl merged 5 commits into
mainfrom
sh/csv-export-json-metadata

Conversation

@stefanhengl

@stefanhengl stefanhengl commented Jan 4, 2024

Copy link
Copy Markdown
Member

We received the feedback that it is not always obvious that metadata is line-separated in the CSV export of search results. Depending on the tool used to display the CSV, only the first metadata value might be visible. Additionally the current format can be hard to parse.

Here we add a new column "Repository metadata JSON" to the CSV export of search results, which encodes metadata into a single line JSON. While we deprecate "Repository metadata", it will remain available for a limited time to ensure backward compatibility and a smooth transition for existing users.

image

example.csv

Test plan

  • updated unit test
  • manual testing:
    • validated the JSON encoding with a python script that reads the CSV and parses the JSON field.

@cla-bot cla-bot Bot added the cla-signed label Jan 4, 2024
@stefanhengl stefanhengl requested review from a team and camdencheek January 4, 2024 20:00
@stefanhengl stefanhengl marked this pull request as ready for review January 4, 2024 20:01
@sourcegraph-bot

sourcegraph-bot commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 341998d...b5987a5.

Notify File(s)
@fkling client/web/src/search/results/export/searchResultsExport.test.ts
client/web/src/search/results/export/searchResultsExport.ts

@camdencheek camdencheek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, thanks!

@sourcegraph-bot

sourcegraph-bot commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@jtibshirani jtibshirani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could just replace "Repository metadata" to keep the output clean? It seems like a low probability someone would have a script relying on the contents of this column?

@stefanhengl

Copy link
Copy Markdown
Member Author

Do you think we could just replace "Repository metadata" to keep the output clean? It seems like a low probability someone would have a script relying on the contents of this column?

I was on the fence about this one as well. If you look at my commits, my first version was just replacing the field. However, I know of at least 2 customers that rely on this field. I don't know whether they use a script or whether it is all just manual.

Would it be acceptable to add a deprecation notice to the changelog and remove the old field in 2 releases?

@jtibshirani

Copy link
Copy Markdown
Contributor

However, I know of at least 2 customers that rely on this field

I see, that's what I was wondering about. Then your approach makes sense to me to just deprecate it for now.

Based on customer feedback, we replace the line separated list of
metadata with a json object.
@stefanhengl stefanhengl force-pushed the sh/csv-export-json-metadata branch from 112b7b0 to 6f034bd Compare January 9, 2024 13:20
@stefanhengl stefanhengl merged commit a834619 into main Jan 9, 2024
@stefanhengl stefanhengl deleted the sh/csv-export-json-metadata branch January 9, 2024 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants