Skip to content

feat: Enable cli flags#312

Open
yejseo01 wants to merge 24 commits into
mainfrom
enable-cli-flags
Open

feat: Enable cli flags#312
yejseo01 wants to merge 24 commits into
mainfrom
enable-cli-flags

Conversation

@yejseo01

@yejseo01 yejseo01 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Added target deploy settings UI via the target view gear button.
  • Added settings:
    • topo.defaultTargetDeploySettings
    • topo.targetDeploySettings
  • Added deploy flag support:
    • port -> -p
    • forceRecreate -> --force-recreate
    • noRecreate -> --no-recreate
  • Added validation for ports, unknown keys, and conflicting recreate flags.
  • Preserves malformed JSON settings when opening settings, but ignores them during deploy.
  • Seeds cached targets and missing default fields into settings JSON.
  • Added tests for deploy flags, defaults, target overrides, validation, and settings seeding.

Screenshots

Screenshot 2026-06-29 at 09 41 40 Screenshot 2026-07-03 at 16 45 56 Screenshot 2026-07-03 at 16 48 18

Confirmed with @ZachMaso on the UI.

@yejseo01 yejseo01 changed the title Enable cli flags feat: Enable cli flags Jun 30, 2026
@yejseo01 yejseo01 marked this pull request as ready for review June 30, 2026 10:18
@yejseo01 yejseo01 requested a review from a team as a code owner June 30, 2026 10:18
@github-actions github-actions Bot added the feat Feature or enhancement for release notes label Jun 30, 2026
Comment thread package.json Outdated
Comment thread src/services/targetDeploySettings.ts Outdated
nextSettings,
vscode.ConfigurationTarget.Global,
);
}

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.

I'm open to other opinions here but I strongly dislike pressing a button in the tree view writing a bunch of stuff to my config. ensureCachedTargetDeploySettings is probably the worse offender since it can write a lot potentially.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can think of one way, where we just leave it empty when the target doesn't have any custom deploy settings. However, I feel like that makes it more confusing for the users to add custom settings. When they start topo for the first time, they won't have any example json object that resembles the deploy options. Can you think of any other way?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Along with above, we can also make a command palette+quick pick path to add a custom deploy options. It would be shown/editable by the settings page, but if we have another way to edit the deploy settings(command palette + quick pick), it would be a good way to guide the user even when there are no example deploy option object in the settings?

Comment thread src/actions/openTargetDeploySettings.ts
Comment thread src/services/targetDeploySettings.ts
Comment thread package.json
Comment thread package.json
Comment thread src/services/targetDeploySettings.ts
Comment on lines +88 to +90
Object.entries(settings).filter(([, value]) =>
isTargetDeploySettings(value),
),

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.

Behavioural question I don't have strong opinions about - should we throwing away all the config if one value is invalid. i.e. if set noRecreate: "foo" we'll discard my custom port atm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

what do you mean by "discard"? are we not deploying at all or deploying with no flags? I think it should either be not deployed or deployed with flags. I don't think we should deploy with no flags for flags being invalid. that is weird

Comment thread package.json
}
}
},
"topo.targetDeploySettings": {

@awphi awphi Jul 1, 2026

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.

Should we be constraining this to deploy? We've talked in the past about other target-specific config we want to set and it would feel nasty imo to have something like

{
  "topo.targetDeploySettings": {
     "target": {
        "port": "12345"
     }
  },
  "topo.extensionSettings": {
     "target": {
        "refreshInterval": 3000
     }
  }
}

perhaps would be neater to generify this and scope deploy settings like:

{
  "topo.targetSettings": {
     "target": {
         "deploy": {
            "port": "12345",
         },
         "refreshInterval": 3000 // added later if ever ofc
     }
  }
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it is okay to constrict this to deploy. it is already in the deploy section within the topo settings. any other target agnostic settings should be outside the annoying json format in my opinion

Image

Comment thread src/actions/deploy.ts Outdated
Comment on lines +194 to +196
if (options.forceRecreate && options.noRecreate) {
throw new Error('Cannot use both force recreate and no recreate');
}

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.

This is currently an uncaught error as it stands which I'm not sure if what we want for a validation error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you mean? can you rephrase the sentence?

@github-actions github-actions Bot added feat Feature or enhancement for release notes and removed feat Feature or enhancement for release notes labels Jul 2, 2026
yejseo01 and others added 16 commits July 3, 2026 15:21
Signed-off-by: awphi <26072111+awphi@users.noreply.github.com>
Signed-off-by: Federico Bozzini <federico.bozzini@arm.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#321)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… 8.62.1 (#320)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot Bot and others added 5 commits July 3, 2026 15:21
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Federico Bozzini <federico.bozzini@arm.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Federico Bozzini <federico.bozzini@arm.com>
@yejseo01 yejseo01 force-pushed the enable-cli-flags branch from 2bb8ac0 to 71c099c Compare July 3, 2026 14:22
@github-actions github-actions Bot added feat Feature or enhancement for release notes and removed feat Feature or enhancement for release notes labels Jul 3, 2026
@github-actions github-actions Bot added feat Feature or enhancement for release notes and removed feat Feature or enhancement for release notes labels Jul 3, 2026
@github-actions github-actions Bot added feat Feature or enhancement for release notes and removed feat Feature or enhancement for release notes labels Jul 3, 2026
@github-actions github-actions Bot added feat Feature or enhancement for release notes and removed feat Feature or enhancement for release notes labels Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Feature or enhancement for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants