Skip to content

ci: restore fail-the-PR-check on clang-tidy findings in stage A#10529

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:ci/clang-tidy-bazel-restore-pr-check
May 27, 2026
Merged

ci: restore fail-the-PR-check on clang-tidy findings in stage A#10529
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:ci/clang-tidy-bazel-restore-pr-check

Conversation

@openroad-ci
Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #3465 (merged via staging into public #10521). Addresses Codex P2 finding on #10521 that landed after the PR was already merged.

The split workflow inadvertently downgraded enforcement: Stage A now exits 0 even when PR-diff clang-tidy findings exist, so branch protection on the clang-tidy-bazel check passes and merges are no longer blocked on lint findings. Stage B's -fail-level=any runs in workflow_run context where the resulting check binds to the default-branch SHA, not the PR head, so it can't satisfy a required PR check.

Fix

  • Stage A re-adds reviewdog (reviewdog/action-setup + a Fail check on clang-tidy findings in PR diff step using -reporter=local -filter-mode=added -fail-level=any). Local mode only needs the filesystem and an explicit -diff command, so this works under the fork-PR read-only token. Step is positioned after upload-artifact so the post workflow still has the findings to comment on even when this check exits non-zero.
  • Stage B's guard relaxes from conclusion == 'success' to conclusion != 'cancelled', so it still runs and posts review comments when Stage A's check step failed.

Why this PR exists separately

The fix commit (fcb0180913 on the prior branch) didn't make it through the sync chain before #10521 merged on public. Cherry-picked onto a fresh branch off current master.

Test plan

  • On a PR with at least one clang-tidy finding in the diff: confirm Stage A check fails (branch protection blocks), Stage B posts inline review comments.
  • On a clean PR (no findings): confirm Stage A check passes, Stage B runs with no comments to post.
  • On a PR where bazel build itself fails (lint config issue, etc.): confirm Stage A fails at build step, Stage B downloads-artifact step fails loudly.

The split workflow removed the inline reviewdog step from stage A, which
silently downgraded enforcement: stage A now exits 0 even when PR-diff
clang-tidy findings exist, so branch protection on the `clang-tidy-bazel`
check passes and merges are no longer blocked on lint findings. Stage
B's `-fail-level=any` runs in workflow_run context where the resulting
check binds to the default-branch SHA, not the PR head, so it cannot
satisfy a required PR check.

Restore the old behaviour:

- Stage A re-adds reviewdog (set up + run with -reporter=local
  -filter-mode=added -fail-level=any). The fork-PR token is read-only,
  but `-reporter=local` only needs the filesystem and a `-diff` command,
  so this works in all PR contexts. Step is positioned AFTER the
  artifact upload so the post workflow still has the findings to post
  as review comments even when this step exits non-zero.
- Stage B's guard relaxes from `conclusion == 'success'` to
  `conclusion != 'cancelled'`, so it still runs when Stage A's check
  step failed (artifact is uploaded before that fail step).

Signed-off-by: Joao Luis Sombrio <sombrio@sombrasoft.dev>
@openroad-ci openroad-ci requested a review from a team as a code owner May 27, 2026 18:00
@openroad-ci openroad-ci requested a review from maliberty May 27, 2026 18:00
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@maliberty
Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@maliberty maliberty enabled auto-merge May 27, 2026 18:18
@maliberty maliberty merged commit 000e4e2 into The-OpenROAD-Project:master May 27, 2026
17 checks passed
@maliberty maliberty deleted the ci/clang-tidy-bazel-restore-pr-check branch May 27, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants