Skip to content

fix: remove dispatch-repository dash alias from parser#39639

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/add-dispatch-repository-dash-alias
Closed

fix: remove dispatch-repository dash alias from parser#39639
Copilot wants to merge 3 commits into
mainfrom
copilot/add-dispatch-repository-dash-alias

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

parseDispatchRepositoryConfig accepted both dispatch_repository and dispatch-repository, but the safe-output schema only declared the underscore form — creating a silent parser-vs-schema gap where the dash form would parse but fail schema validation.

Changes

  • pkg/workflow/dispatch_repository.go: Drop the dispatch-repository fallback lookup; only dispatch_repository is now accepted.
  • pkg/workflow/dispatch_repository_test.go: Remove TestParseDispatchRepositoryConfig_DashAlias which covered the removed behaviour.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — thanks for picking up the dispatch-repository schema consistency fix from issue #39599! The scope is clear and well-grounded. A couple of things to sort out before this is ready for review:

  • Misaligned title/direction — the PR title says "Add dispatch-repository dash alias to safe-output schema", but @pelikhan's comment redirects to "remove support parsing dispatch-repository with dash" from the parser. These are opposite changes. Once the implementation is committed, the title (and body) should reflect the actual direction taken.
  • No code changes yet — the PR is a WIP draft with 0 changed files. When the implementation lands, reviewers will need to see the actual schema/parser edits.
  • Tests — the parser change (removing dash alias support in parseDispatchRepositoryConfig) should include a test case covering a workflow that uses dispatch-repository to confirm it is now rejected, and one confirming dispatch_repository continues to work.

If you'd like a hand completing the implementation, here's a ready-to-use prompt:

In pkg/workflow/dispatch_repository.go, remove support for the dash-alias form `dispatch-repository`:
1. In parseDispatchRepositoryConfig (around line 30), delete the branch that accepts "dispatch-repository" as an alias, keeping only "dispatch_repository".
2. Update pkg/parser/schemas/main_workflow_schema.json if it currently lists "dispatch-repository" — remove any reference to the dash form.
3. Add a parser test that confirms a workflow using the key `dispatch-repository` now fails validation, and a test confirming `dispatch_repository` still passes.
4. Update the PR title to: "Remove dash-alias dispatch-repository from parser".

Generated by ✅ Contribution Check ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add dispatch-repository dash alias to safe-output schema fix: remove dispatch-repository dash alias from parser Jun 16, 2026
Copilot AI requested a review from pelikhan June 16, 2026 18:44
@pelikhan pelikhan marked this pull request as ready for review June 16, 2026 18:50
Copilot AI review requested due to automatic review settings June 16, 2026 18:50

Copilot AI left a comment

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.

⚠️ Not ready to approve

A small regression test should be added to assert the dash-form key is now rejected, so the behavior change is protected against accidental reintroduction.

Pull request overview

This PR removes support for the dispatch-repository (dash) alias in parseDispatchRepositoryConfig, so the parser only accepts dispatch_repository (underscore) and stays consistent with the safe-outputs schema.

Changes:

  • Removed the dispatch-repository fallback lookup so only dispatch_repository is recognized.
  • Removed the unit test that previously asserted the dash alias was accepted.
File summaries
File Description
pkg/workflow/dispatch_repository.go Drops the dash-key fallback so parsing matches the schema’s underscore-only key.
pkg/workflow/dispatch_repository_test.go Removes the dash-alias acceptance test (and leaves room for a replacement “rejected” test).

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

require.Len(t, config.Tools, 1, "Should have 1 tool")
}

// TestParseDispatchRepositoryConfig_Absent tests that nil is returned when key is absent
@github-actions

Copy link
Copy Markdown
Contributor

@copilot review all comments and address unresolved review feedback for this PR.

Generated by 👨‍🍳 PR Sous Chef ·

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.

3 participants