Remove obsolete safe-jobs backwards compatibility references#3522
Merged
Remove obsolete safe-jobs backwards compatibility references#3522
Conversation
- Update misleading comment in compiler.go that claimed old syntax was supported - Clarify that parseSafeJobsConfig() is an internal helper function - Update extractSafeJobsFromFrontmatter() comment to explicitly state old syntax is NOT supported - Add clarifying comments in test to explain it's testing internal parsing logic - Old syntax (top-level safe-jobs:) is already rejected by JSON schema validation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- TestOldSafeJobsSyntaxRejected: Verifies old safe-jobs syntax is rejected by schema - TestNewSafeOutputsJobsSyntaxAccepted: Verifies new safe-outputs.jobs syntax works - Tests confirm JSON schema properly enforces the correct syntax Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add deprecation warning for safe-jobs legacy syntax
Remove obsolete safe-jobs backwards compatibility references
Nov 9, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates documentation and comments to clarify that the old top-level safe-jobs syntax is no longer supported, and users must use the new safe-outputs.jobs syntax instead. The schema validation already enforces this restriction since the main workflow schema has "additionalProperties": false and does not include safe-jobs as a valid property.
Key Changes:
- Added comprehensive tests to verify the old
safe-jobssyntax is rejected and the newsafe-outputs.jobssyntax works correctly - Updated comments throughout the codebase to explicitly document that
parseSafeJobsConfigis an internal helper and that user workflows must usesafe-outputs.jobs
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/workflow/safe_jobs_test.go | Updated comment to clarify that the test validates internal parsing logic, not user-facing syntax |
| pkg/workflow/safe_jobs_syntax_test.go | Added new test file with two tests: one verifying old syntax rejection and one verifying new syntax acceptance |
| pkg/workflow/safe_jobs.go | Enhanced comments on parseSafeJobsConfig and extractSafeJobsFromFrontmatter to explicitly state that top-level safe-jobs is not supported |
| pkg/workflow/compiler.go | Updated comment to remove backward compatibility reference and clarify only safe-outputs.jobs location is checked |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pelikhan
approved these changes
Nov 9, 2025
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.
The old top-level
safe-jobs:syntax is already rejected by JSON schema validation, but comments incorrectly claimed backwards compatibility existed. No code actually reads from the old location.Changes
parseSafeJobsConfig()andextractSafeJobsFromFrontmatter()are internal helpers that never read user's top-levelsafe-jobs:keyCurrent Behavior
Old syntax is rejected with helpful error:
New syntax compiles correctly:
All 74 repository workflows continue to compile successfully.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.