feat: Add neutral job conclusion via allow-failure property#4405
Draft
atkinsonm wants to merge 1 commit intoactions:mainfrom
Draft
feat: Add neutral job conclusion via allow-failure property#4405atkinsonm wants to merge 1 commit intoactions:mainfrom
atkinsonm wants to merge 1 commit intoactions:mainfrom
Conversation
Add TaskResult.Neutral (value 6) and ActionResult.Neutral (value 4) to allow jobs to report a neutral/warning conclusion to the Checks API. When a job fails and allow-failure is set (via message property or ACTIONS_ALLOW_FAILURE env var), the runner reports Neutral instead of Failed. The server maps this to the Checks API "neutral" conclusion, which renders as a grey dash icon rather than a red X. Changes: - TaskResult enum: add Neutral = 6 - ActionResult enum: add Neutral = 4 - TaskResultUtil: add Neutral mapping in ToActionResult() - AgentJobRequestMessage: add AllowFailure bool property - JobRunner: override Failed → Neutral in both CompleteJobAsync overloads - Tests: cover merge behavior, return code translation, and allow-failure logic for both message property and env var fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2e6d7d2 to
06f335f
Compare
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.
Summary
TaskResult.Neutral(value 6) andActionResult.Neutral(value 4) enum valuesAllowFailureboolean property toAgentJobRequestMessageallow-failureis set, the runner reportsNeutralinstead ofFailedACTIONS_ALLOW_FAILUREenv var fallback for testing without server changesWhy
The Checks API supports a
neutralconclusion (renders as a grey dash icon), but GitHub Actions provides no way for a job to report it. This means non-critical checks (linting, spell-checking, advisory security scans) must either pass or fail — there's no "warning" state.This PR implements the runner-side support for a
neutralconclusion via a job-levelallow-failureproperty, similar in spirit to Travis CI'sallow_failuresmatrix config. When the server populatesAllowFailure = trueon the job message, the runner convertsFailed→Neutralat job completion time.Related: #2347
Server-side requirements (out of scope for this PR)
For end-to-end functionality, the server needs to:
allow-failure: truefrom workflow YAMLAllowFailure = trueonAgentJobRequestMessageTaskResult.Neutral(value 6) and map it to Checks APIconclusion: neutralneeds:dependenciesDesign decisions
CompleteJobAsync()afterjobContext.Complete()— same pattern as other post-completion transformsMergeTaskResults()already handles this correctly sinceNeutral = 6 > Failed = 2, so the existingif (currentResult > TaskResult.Failed)guard treats it as terminalACTIONS_ALLOW_FAILURE=trueallows testing the runner behavior in isolation without server changesTest plan
AllowFailuremessage property converts Failed → NeutralAllowFailuredoes not affect Succeeded jobsACTIONS_ALLOW_FAILUREenv var fallback worksCompleteJobAsyncoverloads (IRunServer + IJobServer) are coveredTaskResult.Neutralround-trips through return code translationTaskResult.Neutralmaps toActionResult.Neutral🤖 Generated with Claude Code