Skip to content

fix: skip unlock job when activation was skipped - #34124

Merged
pelikhan merged 1 commit into
mainfrom
copilot/update-compiler-skip-unlock-job
May 22, 2026
Merged

fix: skip unlock job when activation was skipped#34124
pelikhan merged 1 commit into
mainfrom
copilot/update-compiler-skip-unlock-job

Conversation

CopilotAI commented May 22, 2026

Copy link
Copy Markdown
Contributor

When the activation job is skipped (event doesn't match the trigger), the unlock job was still running and consuming a runner — despite no issue ever being locked.

Changes

  • pkg/workflow/compiler_unlock_job.go: Change the unlock job's if condition from always() to always() && needs.activation.result != 'skipped'
  • pkg/workflow/lock_for_agent_test.go: Update assertions to check for the new combined condition
  • ai-moderator.lock.yml, workflow-generator.lock.yml: Recompiled
# Beforeif: always()# Afterif: always() && needs.activation.result != 'skipped'

The unlock job still runs when activation fails (allowing locked issues to be unlocked on error), but is now correctly skipped when activation was never triggered.

Update buildUnlockJob to use `always() && needs.activation.result != 'skipped'`
as the job-level condition. This ensures the unlock job is skipped when the
activation job was skipped (e.g. the event did not match the trigger condition
and no issue locking occurred), while still running when activation fails.
Recompile ai-moderator.lock.yml and workflow-generator.lock.yml.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title fix: skip unlock job when activation job was skippedfix: skip unlock job when activation was skippedMay 22, 2026
CopilotAI requested a review from pelikhanMay 22, 2026 22:17
@pelikhan
pelikhan marked this pull request as ready for review May 22, 2026 22:28
CopilotAI review requested due to automatic review settings May 22, 2026 22:28
@pelikhan
pelikhan merged commit e33e8ac into mainMay 22, 2026
@pelikhan
pelikhan deleted the copilot/update-compiler-skip-unlock-job branch May 22, 2026 22:28

CopilotAI 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.

Pull request overview

This PR prevents the dedicated unlock job from running (and consuming a runner) when the activation job was skipped due to trigger/condition mismatch—i.e., when no issue could have been locked in the first place.

Changes:

  • Update the unlock job’s job-level if: from always() to always() && needs.activation.result != 'skipped'.
  • Update lock-for-agent unit tests to assert the new combined unlock job condition.
  • Recompile the affected generated workflows to include the updated unlock job condition.
Show a summary per file
FileDescription
pkg/workflow/compiler_unlock_job.goAdds an activation-not-skipped guard to the unlock job job-level condition while preserving always() behavior for failures.
pkg/workflow/lock_for_agent_test.goUpdates assertions to match the new unlock job if: condition in generated YAML.
.github/workflows/ai-moderator.lock.ymlRegenerated workflow reflects the updated unlock job condition.
.github/workflows/workflow-generator.lock.ymlRegenerated workflow reflects the updated unlock job condition.

Copilot's findings

Tip

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

  • Files reviewed: 4/4 changed files
  • Comments generated: 0

Sign up for freeto 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

@pelikhan