Skip to content

fix: wire workflow_call inputs, act fallback for change detection, and correct clang-tidy/format-all failure behavior#421

Merged
greenc-FNAL merged 2 commits intojules-maintenance-fix-pr-comment-reactions-18132869807280577001from
copilot/sub-pr-411-another-one
Mar 12, 2026
Merged

fix: wire workflow_call inputs, act fallback for change detection, and correct clang-tidy/format-all failure behavior#421
greenc-FNAL merged 2 commits intojules-maintenance-fix-pr-comment-reactions-18132869807280577001from
copilot/sub-pr-411-another-one

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

Several behavioral regressions introduced by the workflow consolidation: workflow_call inputs were not forwarded to workflow-setup, causing reused workflows to resolve the wrong ref/repo/base SHA; change detection ran unconditionally in act environments causing unreliable results; and clang-tidy-check/format-all no longer failed their jobs when issues were found.

workflow-setupact environment handling

  • Gate Run change detection on is_act != 'true'
  • Add Set has_changes output step: returns true under act (so check jobs run locally), otherwise passes through detection result
  • Update has_changes output to reference new step

Workflow call input forwarding

Pass ref, repo, pr-base-sha, checkout-path from workflow_call inputs into workflow-setup for:

  • python-check.yaml, markdown-check.yaml, jsonnet-format-check.yaml
  • cmake-format-check.yaml, header-guards-check.yaml, actionlint-check.yaml

Without this, reused workflows fell back to the caller event context instead of the explicit inputs, breaking relevance detection and checkout targeting.

format-all.yaml — restore failure behavior

Add Fail on formatter failures step (runs after comment/reaction steps) so combine-results exits non-zero when any sub-workflow fails/cancels/is skipped. Restores parity with the pre-consolidation inline script.

clang-tidy-check.yaml — actually fail on diagnostics

Add exit 1 when clang-tidy issues are detected. The Upload artifacts step already uses if: always() so artifacts are still collected on failure.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…d clang-tidy/format-all failures

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
Copilot AI changed the title [WIP] [18132869807280577001] Fix comment reactions for clang-tidy-fix fix: wire workflow_call inputs, act fallback for change detection, and correct clang-tidy/format-all failure behavior Mar 12, 2026
Copilot AI requested a review from greenc-FNAL March 12, 2026 20:21
@greenc-FNAL greenc-FNAL marked this pull request as ready for review March 12, 2026 20:24
@greenc-FNAL greenc-FNAL requested a review from aolivier23 as a code owner March 12, 2026 20:24
Copilot AI review requested due to automatic review settings March 12, 2026 20:24
@greenc-FNAL greenc-FNAL merged commit c659d10 into jules-maintenance-fix-pr-comment-reactions-18132869807280577001 Mar 12, 2026
@greenc-FNAL greenc-FNAL deleted the copilot/sub-pr-411-another-one branch March 12, 2026 20:24
Copy link
Contributor

Copilot AI left a comment

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 fixes behavioral regressions introduced by the workflow consolidation by ensuring reusable (workflow_call) workflows correctly forward ref/repo/base SHA inputs into workflow-setup, improving act behavior for change detection, and restoring “fail the job when issues are found” semantics for formatter/tidy workflows.

Changes:

  • Forward workflow_call inputs (ref, repo, pr-base-sha, checkout-path) into workflow-setup across several check workflows so ref/base SHA resolution works correctly when reused.
  • Update workflow-setup to skip change detection under act and provide a has_changes output that allows check jobs to run locally.
  • Restore failure behavior in format-all aggregation and make clang-tidy-check fail the job when diagnostics are detected.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/python-check.yaml Forward workflow_call inputs into workflow-setup for correct ref/repo/base SHA resolution.
.github/workflows/markdown-check.yaml Same input forwarding to ensure reusable workflow resolves correct checkout/ref context.
.github/workflows/jsonnet-format-check.yaml Same input forwarding for correct checkout targeting and relevance detection inputs.
.github/workflows/header-guards-check.yaml Same input forwarding for reusable invocations.
.github/workflows/cmake-format-check.yaml Same input forwarding for reusable invocations.
.github/workflows/actionlint-check.yaml Same input forwarding for reusable invocations (with include-globs-based relevance).
.github/actions/workflow-setup/action.yaml Skip change detection under act and standardize has_changes via a dedicated step.
.github/workflows/format-all.yaml Fail combine-results when any formatter workflow fails/cancels/is skipped (restores prior behavior).
.github/workflows/clang-tidy-check.yaml Exit non-zero when clang-tidy diagnostics are detected so the job actually fails.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +134 to +135
else
echo "has_changes=${{ steps.detect.outputs.has_changes }}" >> "$GITHUB_OUTPUT"
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

Set has_changes output can write an empty has_changes= when change detection is not run (e.g., file-type and include-globs are both empty so steps.detect is skipped). For consistency (and to keep the output strictly boolean-like), consider explicitly emitting has_changes=false in that case (while keeping the act override behavior).

Suggested change
else
echo "has_changes=${{ steps.detect.outputs.has_changes }}" >> "$GITHUB_OUTPUT"
elif [ "${{ steps.detect.outputs.has_changes }}" != "" ]; then
echo "has_changes=${{ steps.detect.outputs.has_changes }}" >> "$GITHUB_OUTPUT"
else
echo "has_changes=false" >> "$GITHUB_OUTPUT"

Copilot uses AI. Check for mistakes.
@@ -91,6 +91,7 @@ jobs:
exit 1
elif grep -qE '^/.+\.(cpp|hpp|c|h):[0-9]+:[0-9]+: (warning|error):' clang-tidy.log; then
echo "::warning::Clang-tidy found issues in the code"
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

This branch emits a workflow command as ::warning::... but then exits non-zero, which fails the job. Consider switching this to ::error::... (or keeping warning but not failing) so the log annotation severity matches the job outcome.

Suggested change
echo "::warning::Clang-tidy found issues in the code"
echo "::error::Clang-tidy found issues in the code"

Copilot uses AI. Check for mistakes.
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