Skip to content

Reject label names longer than 50 characters at compile time and in MCP - #76941

Merged
pelikhan merged 4 commits into
mainfrom
pelikhan/label-length-validation
Nov 11, 2026
Merged

pelikhan merged 4 commits into
mainfrom
pelikhan/label-length-validation

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

GitHub rejects label names longer than 50 characters. Catch configured names during compilation and agent-supplied names at the safe-outputs MCP boundary instead of failing when labels are applied.

Adds schema limits for workflow labels and static safe-output labels, including fallback and reporting issue labels. The MCP server enforces the same limit for string labels, structured label names, and both replacement-label fields before invoking a handler or recording an output. Legacy comma-separated and JSON-array issue labels are normalized before validation.

Counts Unicode characters rather than bytes, accepts exactly 50 characters, and leaves compile-time expressions, glob patterns, and runner labels unchanged. Updates documentation and adds compiler and MCP boundary coverage for both HTTP and stdio.

Validation

  • Compiler label boundary and rejection tests passed in ./pkg/parser and ./pkg/workflow.
  • Targeted JavaScript suites: 560 passed, 4 skipped, covering schema validation, both MCP request paths, legacy normalization, generated tools, and no-output rejection.
  • npm run typecheck --prefix actions/setup/js --silent passed.
  • Focused Go tests for generated and narrowed add-label schemas passed.
  • Initial make agent-report-progress build, custom linters, schema freshness, and impacted tests passed. Its shared Go linter lock was resolved by rerunning golangci-lint run --allow-serial-runners ./pkg/parser ./pkg/workflow with zero issues.
  • Follow-up make agent-report-progress-no-test passed, including JavaScript lint, build, and Go compile/vet. One existing JavaScript lint warning remains in unchanged code.

pelikhan and others added 2 commits November 11, 2026 11:22
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan changed the title Reject configured label names longer than 50 characters Reject label names longer than 50 characters at compile time and in MCP Nov 11, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 11, 2026 19:43
Copilot AI adaptive review requested due to automatic review settings November 11, 2026 19:43
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR Specification Reviewer was cancelled. Please review the logs for details.

Generated by PR Specification Reviewer for #76941

@github-actions

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Test Quality Sentinel is analyzing test quality on this pull request...

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills...

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request...

@github-actions

Copy link
Copy Markdown
Contributor

✂️ Ponytail Reviewer has started processing this pull request

Include the validator and markdown-unfencing modules in the safe-output deployment bundle. Keep the compiler-embedded tool schemas aligned with runtime label length limits.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

Validation can reject valid tool calls by combining length limits across alternative schema branches and reject supported label-expression arrays by applying static-name limits to expression items.

2 open issues
What changed in this PR

This PR adds early label-name length validation to gh-aw’s compiler and safe-outputs MCP boundary, aiming to catch invalid names before GitHub operations run.

Changes:

  • Adds 50-character limits to workflow and tool schemas, with recursive runtime validation.
  • Shares legacy issue-label normalization and packages its runtime dependencies.
  • Documents the limit and adds compiler, Unicode-boundary, HTTP, and stdio coverage.
File Description
pkg/​workflow/​labels_validation_test.go Tests compilation rejection without generating a lock file.
pkg/​workflow/​js/​safe_outputs_tools.json Adds label limits to embedded tool schemas.
pkg/​parser/​schemas/​main_workflow_schema.json Limits configured workflow and safe-output labels.
pkg/​parser/​schema_labels_test.go Tests boundaries, Unicode, and exempt values.
docs/​src/​content/​docs/​reference/​safe-outputs.md Documents MCP label validation.
docs/​src/​content/​docs/​reference/​frontmatter.md Documents compile-time label limits.
actions/​setup/​setup.sh Packages newly required runtime modules.
actions/​setup/​js/​schema-validation.test.cjs Tests nested string-length constraints.
actions/​setup/​js/​schema-validation.cjs Recursively checks explicit length limits.
actions/​setup/​js/​safe_outputs_tools.json Adds label limits to runtime tool schemas.
actions/​setup/​js/​safe_outputs_mcp_wrapped_arguments.test.cjs Checks rejected labels produce no output.
actions/​setup/​js/​safe_outputs_mcp_schema_validation.test.cjs Covers label limits over HTTP and stdio.
actions/​setup/​js/​safe_outputs_mcp_arguments.cjs Normalizes legacy issue-label strings before validation.
actions/​setup/​js/​safe_output_type_validator.cjs Extracts reusable issue-label normalization.
actions/​setup/​js/​add_labels_schema.cjs Preserves length constraints and checks example values.

Review effort: Balanced (auto)

Comment thread actions/setup/js/schema-validation.cjs Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot run pr-finisher skill

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reviewed the cancellation notice: the run was cancelled during MCP Gateway readiness, before producing review findings. No code change or rerun is warranted by this notice alone; the cancellation cause remains unconfirmed.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reviewed the code-quality review notice: the run failed during MCP Gateway startup before producing code feedback. No code change is needed for this status notice.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reviewed the test-quality analysis notice: the run failed during MCP Gateway startup before producing test feedback. No code change is needed for this status notice.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reviewed the skills-review notice: the run failed during MCP Gateway startup before producing review findings. No code change is needed for this status notice.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reviewed the design-decision check notice: the run failed during MCP Gateway startup before producing findings. This status notice does not establish a missing design record, so no code or documentation change is needed.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reviewed the Ponytail review notice: the run failed during MCP Gateway startup before producing review findings. No code change is needed for this status notice.

@pelikhan
pelikhan merged commit 3c4fc79 into main Nov 11, 2026
88 of 89 checks passed
@pelikhan
pelikhan deleted the pelikhan/label-length-validation branch November 11, 2026 20:18
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

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.

2 participants