Skip to content

fix: handle error-state status contexts in --exclude flag#483

Open
pstibrany wants to merge 2 commits intografana:mainfrom
pstibrany:fix/exclude-error-state-and-empty-excludes
Open

fix: handle error-state status contexts in --exclude flag#483
pstibrany wants to merge 2 commits intografana:mainfrom
pstibrany:fix/exclude-error-state-and-empty-excludes

Conversation

@pstibrany
Copy link
Copy Markdown

Summary

  • StatusContext error state not excluded: The --exclude flag only checked for failure-state status contexts, but GitHub status contexts can also have state error (e.g. dev-policy-bot failing to load its policy file). Error-state contexts were never matched against the exclude list, so --exclude had no effect on them.
  • Empty GITHUB_CI_EXCLUDE env var produces spurious entry: When GITHUB_CI_EXCLUDE is set to an empty string (e.g. from a Kubernetes container env var with an empty default), urfave/cli splits it into [""]. This is now filtered out so an empty env var behaves the same as unset.

Context

In Argo CD rollout workflows, the wait-for-github pr step is used to wait for PRs to be merged. The GITHUB_CI_EXCLUDE env var is the mechanism for per-deployment exclusion of known-flaky or irrelevant status checks. Both fixes are needed to make this work correctly:

  1. Without the error-state fix, excluding a check like dev-policy-bot: master (which reports error, not failure) has no effect.
  2. Without the empty-string fix, setting GITHUB_CI_EXCLUDE="" as a default in a shared template would add an empty entry to the exclude list.

Test plan

  • Added test: error-state StatusContext is reported as failure (without exclude)
  • Added test: error-state StatusContext is excluded when in exclude list
  • All existing tests pass

@pstibrany pstibrany requested a review from a team as a code owner March 6, 2026 10:30
@pstibrany pstibrany changed the title Fix --exclude flag not matching error-state status contexts fix: handle error-state status contexts in --exclude flag Mar 6, 2026
Copy link
Copy Markdown
Contributor

@zerok zerok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙂

@zerok zerok added this pull request to the merge queue Mar 11, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 11, 2026
@pstibrany pstibrany force-pushed the fix/exclude-error-state-and-empty-excludes branch from c6c0407 to 184e7c7 Compare March 16, 2026 09:44
@pstibrany
Copy link
Copy Markdown
Author

Thanks for review and adding to merge queue. I see that merging failed due to invalid commit title formatting. I've fixed it now.

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