Skip to content

ci: fix pre-commit job still passing when pre-commit fails#5790

Merged
jyotshnayaparla-00 merged 1 commit intomainfrom
ci-fix-pre-commit-continue-on-error
Mar 11, 2026
Merged

ci: fix pre-commit job still passing when pre-commit fails#5790
jyotshnayaparla-00 merged 1 commit intomainfrom
ci-fix-pre-commit-continue-on-error

Conversation

@jyotshnayaparla-00
Copy link
Contributor

Problem: continue-on-error was set conditionally, true for branches in this repo, false for forks. The intent was to allow the auto-fix commit step to run even when pre-commit fails. However, continue-on-error: true at the step level also causes the entire job to be marked as succeeded, meaning pre-commit failures on branches within this repo were silently ignored.

For fork PRs, continue-on-error was false, so pre-commit failures correctly failed the job, but the auto-fix commit step would never run (which is fine since we can't push to forks anyway).

Fix: Remove continue-on-error from the pre-commit step entirely, so pre-commit failures always fail the job regardless of whether the PR is from a fork or a branch in this repo. Move the same-repo condition to the auto-commit step using if: always() && head_repo == this_repo, so the auto-fix commit still runs after a pre-commit failure on branches within this repo, while correctly skipping it for forks.

@jyotshnayaparla-00 jyotshnayaparla-00 self-assigned this Mar 10, 2026
@jyotshnayaparla-00 jyotshnayaparla-00 requested a review from gz March 10, 2026 15:01
@jyotshnayaparla-00 jyotshnayaparla-00 force-pushed the ci-fix-pre-commit-continue-on-error branch from 873e88a to 3385feb Compare March 10, 2026 15:02
Copy link
Contributor

@gz gz left a comment

Choose a reason for hiding this comment

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

it makes sense, did you test if it fixes the regression?

@jyotshnayaparla-00
Copy link
Contributor Author

it makes sense, did you test if it fixes the regression?

I didn't test it directly. I can verify by checking if the pre-commit failures from the other PR (#5786 ) now correctly fail the job instead of passing. Once #5786 's pre-commit check runs with this fix in place, it should correctly fail the job instead of passing. We'll know right away from that run. Alternatively, happy to test it in feldera-ci-test first if you'd prefer.

Copy link

@mythical-fred mythical-fred left a comment

Choose a reason for hiding this comment

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

LGTM. Removing continue-on-error plugs the hole where pre-commit failures were silently passing on branch PRs, and always() on the auto-fix step keeps the auto-commit running even after a failure — exactly right.

@jyotshnayaparla-00 jyotshnayaparla-00 added this pull request to the merge queue Mar 10, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 10, 2026
Remove continue-on-error from the pre-commit step and move the same-repo
condition to the auto-commit step using always(). This ensures the job
is correctly marked as failed when pre-commit fails, while still allowing
the auto-fix commit to run on branches within this repo.
@jyotshnayaparla-00 jyotshnayaparla-00 force-pushed the ci-fix-pre-commit-continue-on-error branch from 3385feb to ccee0ac Compare March 11, 2026 15:12
@jyotshnayaparla-00 jyotshnayaparla-00 added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 8219981 Mar 11, 2026
1 check passed
@jyotshnayaparla-00 jyotshnayaparla-00 deleted the ci-fix-pre-commit-continue-on-error branch March 11, 2026 16:38
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.

3 participants