Skip to content

feat: ease scaffolding inputs with hub configuration#173

Open
gblanc-1a wants to merge 2 commits intoAmadeusITGroup:mainfrom
gblanc-1a:feat/scaffolding_default
Open

feat: ease scaffolding inputs with hub configuration#173
gblanc-1a wants to merge 2 commits intoAmadeusITGroup:mainfrom
gblanc-1a:feat/scaffolding_default

Conversation

@gblanc-1a
Copy link
Contributor

Description

Add a scaffoldDefaults section 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

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • ♻️ Code refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔧 Configuration/build changes

Related Issues

Closes #138

Changes Made

  • Hub schema (schemas/hub-config.schema.json): Added scaffoldDefaults object with optional fields: githubOrg, githubRunner, organizationName, internalContact, legalContact, organizationPolicyLink. Strict additionalProperties: false to prevent unknown fields.
  • TypeScript types (src/types/hub.ts): Added ScaffoldDefaults interface and wired it into HubConfig.
  • ScaffoldCommand (src/commands/ScaffoldCommand.ts): runWithUI() now accepts an optional HubManager, loads scaffoldDefaults from the active hub, and passes them through to promptForProjectDetails, promptForOrganizationDetails, and promptForGitHubRunner. Org-level fields are skipped when hub defaults are present; githubOrg and githubRunner are pre-filled but still editable.
  • Extension entry point (src/extension.ts): Passes this.hubManager to ScaffoldCommand.runWithUI().
  • Scaffold utilities (src/utils/scaffoldUtils.ts): New helper resolveRunnerPattern() replaces {githubOrg} placeholders in runner strings; getGitHubUserIdentity() reads the GitHub session to pre-fill the author field.
  • Documentation (docs/reference/hub-schema.md): Documented scaffoldDefaults object, runner pattern syntax, and prompt behavior table (skipped vs. pre-filled vs. always asked).
  • Tests: Added test/unit/hubSchemaScaffoldDefaults.test.ts (schema validation for scaffoldDefaults) and test/utils/scaffoldUtils.test.ts (resolveRunnerPattern and getGitHubUserIdentity unit tests).

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing completed
  • All existing tests pass

Manual Testing Steps

  1. Configure a hub with scaffoldDefaults containing all six fields and scaffold a new GitHub project — verify org-level prompts are skipped and githubOrg/githubRunner are pre-filled
  2. Configure a hub with only githubOrg set — verify other org fields are still prompted
  3. Scaffold without any active hub — verify behavior is unchanged (all prompts shown)
  4. Add an unknown property to scaffoldDefaults in a hub config — verify schema validation rejects it

Tested 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

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Documentation

  • README.md updated
  • JSDoc comments added/updated
  • No documentation changes needed

Additional Notes

The feature is fully backward-compatible: hubs without scaffoldDefaults behave exactly as before. The {githubOrg} placeholder in githubRunner is the only supported pattern — no general templating engine is introduced.

Reviewer Guidelines

Please pay special attention to:

  • The skip logic in 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 four
  • The resolveRunnerPattern only supports {githubOrg} — confirm no other placeholders are needed
  • Thread safety of getGitHubUserIdentity() — it uses createIfNone: false so it never triggers a sign-in prompt

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0.

@gblanc-1a gblanc-1a force-pushed the feat/scaffolding_default branch 2 times, most recently from b0b420d to 78fc29b Compare February 19, 2026 10:17
@gblanc-1a gblanc-1a force-pushed the feat/scaffolding_default branch from 78fc29b to 6286d38 Compare February 19, 2026 14:45
@gblanc-1a gblanc-1a marked this pull request as ready for review February 20, 2026 08:34
@gblanc-1a gblanc-1a requested a review from wherka-ama February 20, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Feature]: Make easier scaffold configuration based on hub configuration

1 participant