feat: ease scaffolding inputs with hub configuration#173
Open
gblanc-1a wants to merge 2 commits intoAmadeusITGroup:mainfrom
Open
feat: ease scaffolding inputs with hub configuration#173gblanc-1a wants to merge 2 commits intoAmadeusITGroup:mainfrom
gblanc-1a wants to merge 2 commits intoAmadeusITGroup:mainfrom
Conversation
b0b420d to
78fc29b
Compare
78fc29b to
6286d38
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a
scaffoldDefaultssection to hub configuration that pre-fills or skips scaffolding prompts, reducing repetitive input for users whose hub already defines organization-level values (org name, contacts, runner label, etc.).Type of Change
Related Issues
Closes #138
Changes Made
schemas/hub-config.schema.json): AddedscaffoldDefaultsobject with optional fields:githubOrg,githubRunner,organizationName,internalContact,legalContact,organizationPolicyLink. StrictadditionalProperties: falseto prevent unknown fields.src/types/hub.ts): AddedScaffoldDefaultsinterface and wired it intoHubConfig.src/commands/ScaffoldCommand.ts):runWithUI()now accepts an optionalHubManager, loadsscaffoldDefaultsfrom the active hub, and passes them through topromptForProjectDetails,promptForOrganizationDetails, andpromptForGitHubRunner. Org-level fields are skipped when hub defaults are present;githubOrgandgithubRunnerare pre-filled but still editable.src/extension.ts): Passesthis.hubManagertoScaffoldCommand.runWithUI().src/utils/scaffoldUtils.ts): New helperresolveRunnerPattern()replaces{githubOrg}placeholders in runner strings;getGitHubUserIdentity()reads the GitHub session to pre-fill the author field.docs/reference/hub-schema.md): DocumentedscaffoldDefaultsobject, runner pattern syntax, and prompt behavior table (skipped vs. pre-filled vs. always asked).test/unit/hubSchemaScaffoldDefaults.test.ts(schema validation for scaffoldDefaults) andtest/utils/scaffoldUtils.test.ts(resolveRunnerPattern and getGitHubUserIdentity unit tests).Testing
Test Coverage
Manual Testing Steps
scaffoldDefaultscontaining all six fields and scaffold a new GitHub project — verify org-level prompts are skipped andgithubOrg/githubRunnerare pre-filledgithubOrgset — verify other org fields are still promptedscaffoldDefaultsin a hub config — verify schema validation rejects itTested On
macOS
Windows
Linux
VS Code Stable
VS Code Insiders
Screenshots
N/A — UX changes are in VS Code input boxes (pre-filled values / skipped prompts)
Checklist
Documentation
Additional Notes
The feature is fully backward-compatible: hubs without
scaffoldDefaultsbehave exactly as before. The{githubOrg}placeholder ingithubRunneris the only supported pattern — no general templating engine is introduced.Reviewer Guidelines
Please pay special attention to:
promptForOrganizationDetails— it short-circuits when any of the four org fields are present in hub defaults; verify this is the intended granularity vs. requiring all fourresolveRunnerPatternonly supports{githubOrg}— confirm no other placeholders are neededgetGitHubUserIdentity()— it usescreateIfNone: falseso it never triggers a sign-in promptBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0.