Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature-tracking: Add a script to merge features across repos #3956

Closed
wants to merge 1 commit into from

Conversation

dominiccooney
Copy link
Contributor

Test plan

Manually tested. Patch the features files from #3846 and sourcegraph/jetbrains#1400 , then:

$ pnpm features merge ../features.json5 ~/projects/jetbrains/features5.json

Output:

{
  "editors": [
    "vscode",
    "jetbrains"
  ],
  "features": [
    {
      "name": "NotebookBasedChatUI",
      "description": "new chat UI that resembles a notebook instead of a chat session",
      "productLine": "all",
      "documentation": [],
      "editors": {
        "vscode": {
          "status": "stable"
        },
        "jetbrains": {
          "status": "planned"
        }
      },
      "tags": [
        "chat"
      ]
    },
   ...

Copy link
Contributor

@kalanchan kalanchan left a comment

Choose a reason for hiding this comment

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

looks good, I tried the script and it works well.

My only comment is around overwriting behaviour, maybe this can just be a process thing but we should set guidelines on when an overlay should add fields that overwrite the base file.

maybe it's as simple as "if you're touching an overlay, don't add any optional fields if not necessary"

// any. The second database acts as an "overlay" atop the first.
return {
name: x.name,
description: y.description || x.description,
Copy link
Contributor

Choose a reason for hiding this comment

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

imagine the scenario where the descriptions are different:

VS Code:

{ ... 
"name": "FireworksOnSubmission",
"description": "Animate fireworks when user submits a chat"
... }

JetBrains Overlay:

{ ... 
"name": "FireworksOnSubmission",
"description": "shoot cool fireworks when a user submits a chat"
... }

the JetBrains overlay will overwrite with the new description right? I guess it won't be that big of a problem, but we should set some guidelines to be consistent across features.json files


switch (args.command) {
case 'merge':
await mergeFiles(args.file)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, when we automate this we can easily run something like

pnpm features merge <machine_root>/cody/featuresA.json5 <machine_root>/jetbrains/featuresB.json5

Copy link

github-actions bot commented Jul 3, 2024

This PR is marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed automatically in 5 days.

@github-actions github-actions bot added the Stale label Jul 3, 2024
@github-actions github-actions bot closed this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants