Skip to content

fix(ci): fail closed on missing merge base and cloud-validate failures - #3742

Draft
Herklos wants to merge 2 commits into
devfrom
cursor/hooks-fail-closed-ci-parity-c976
Draft

Herklos wants to merge 2 commits into
devfrom
cursor/hooks-fail-closed-ci-parity-c976

Conversation

@Herklos

@Herklos Herklos commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Make two policy gates fail closed. Both currently let a failing check pass silently.

Solve the issue: none (nightly audit, aspect "hooks fail-closed + CI parity").

Changelog

  • extended_linter reports git.merge_base_missing when HEAD has no merge base with the base ref, instead of passing with zero checks
  • cloud-env-validate workflow: set -o pipefail so a failing cloud-validate.sh fails the step instead of being masked by tee

What's new?

  • verify_merge_base now also runs git merge-base HEAD <base>. Before this change, unrelated histories made the linter print OK (0 violations) even when the branch touched user/**. Reproduced locally, exit 0 before the fix. New unit test test_unrelated_histories_violation fails without the fix and passes with it. Related-history case is covered too.
  • cloud-env-validate.yml: the validate step pipes into tee. GitHub's default bash -e {0} has no pipefail, so the step status was always tee's. The change is a single line; a passing validation is unaffected (the step passed on recent runs).

Not changed here: the PR policy check step in main.yml has the same pipe pattern. That file is touched by open PRs, so it is left for a follow-up.

Open in Web Open in Cursor 

cursoragent and others added 2 commits October 13, 2026 13:28
…se ref

verify_merge_base only checked that the base ref exists. When HEAD shares
no history with it, git merge-base exits 1 silently, changed paths came
back empty and the linter reported OK with zero checks run. Report
git.merge_base_missing in that case as well.

Co-authored-by: herklos.dev <herklos.dev@protonmail.com>
The validate step pipes cloud-validate.sh into tee. Without pipefail the
step status is tee's, so a failing validation still left the job green
and the failure summary and report upload never ran.

Co-authored-by: herklos.dev <herklos.dev@protonmail.com>
@Herklos Herklos self-assigned this Oct 13, 2026

This branch has not been deployed

No deployments
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