Skip to content

Watch code generation overlays for hot regeneration#2102

Merged
pmcelhaney merged 3 commits into
mainfrom
copilot/watch-changes-to-overlay-files
May 22, 2026
Merged

Watch code generation overlays for hot regeneration#2102
pmcelhaney merged 3 commits into
mainfrom
copilot/watch-changes-to-overlay-files

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

Summary

When an applied overlay file changes, generation now reruns the same way it does for OpenAPI source edits. This closes the gap where overlay-driven changes required manual regeneration.

  • Watch scope expanded

    • CodeGenerator.watch() now watches all local generation inputs, not just the OpenAPI file:
      • local OpenAPI file + overlays for file-based specs
      • overlays only for HTTP OpenAPI sources
    • watch remains a no-op when there are no local watchable paths.
  • Overlay change regression coverage

    • Added a focused server test that edits an applied overlay during watch mode and asserts regenerated type output changes accordingly.
const watchablePaths = this.openapiPath.startsWith("http")
  ? [...this.overlays]
  : [this.openapiPath, ...this.overlays];
Original Prompt

<issue_title>Watch changes to overlay files</issue_title>
<issue_description>When an applied overlay file changes, the code should regenerate, just like when the OpenAPI document itself changes.</issue_description>

Manual acceptance tests

  • Run generator watch mode with a local OpenAPI file and one overlay, edit only the overlay, and observe regenerated output updates automatically.
  • Run generator watch mode with an HTTP OpenAPI source plus a local overlay, edit only the overlay, and observe regeneration.
  • Run generator watch mode with an HTTP OpenAPI source and no overlays, and observe that no local file watch behavior is started.
  • Edit only the OpenAPI source (no overlay edits) and confirm existing regeneration behavior is unchanged.

Tasks

  • Update CodeGenerator.watch() to watch overlay files in addition to the OpenAPI source when applicable.
  • Preserve existing no-op watch behavior when no local files are watchable.
  • Add targeted test coverage for regeneration triggered by overlay file edits.

Copilot AI linked an issue May 22, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix code regeneration for changes to overlay files Watch code generation overlays for hot regeneration May 22, 2026
Copilot AI requested a review from pmcelhaney May 22, 2026 22:59
@pmcelhaney pmcelhaney marked this pull request as ready for review May 22, 2026 23:09
@pmcelhaney pmcelhaney enabled auto-merge May 22, 2026 23:09
@pmcelhaney pmcelhaney added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 2e7d381 May 22, 2026
8 of 9 checks passed
@pmcelhaney pmcelhaney deleted the copilot/watch-changes-to-overlay-files branch May 22, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watch changes to overlay files

2 participants