Skip to content

maintenance: correct tidy-fix comment reactions, and aggressive consolidation#411

Open
greenc-FNAL wants to merge 10 commits intomainfrom
jules-maintenance-fix-pr-comment-reactions-18132869807280577001
Open

maintenance: correct tidy-fix comment reactions, and aggressive consolidation#411
greenc-FNAL wants to merge 10 commits intomainfrom
jules-maintenance-fix-pr-comment-reactions-18132869807280577001

Conversation

@greenc-FNAL
Copy link
Contributor

@greenc-FNAL greenc-FNAL commented Mar 11, 2026

  • Resolve issues with comment reactions for clang-tidy-fix workflow
  • Aggressive consolidation to reduce CLOC (-𝚫>500) and ease maintenance

PR created automatically by Jules for task 18132869807280577001 started by @greenc-FNAL

@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings March 11, 2026 18:12
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 consolidates PR-comment reaction handling for @phlexbot ...-fix workflows by introducing a reusable composite action that removes the initial “eyes” reaction and adds a completion reaction based on workflow outcome.

Changes:

  • Added a new composite action (complete-pr-comment) to centralize reaction cleanup + completion reactions.
  • Updated multiple fix workflows to call the new action (and to run it under always() so it executes on failures).
  • Added a completion job to clang-tidy-fix to ensure reactions are updated after tidy + PR-comment steps.

Reviewed changes

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

Show a summary per file
File Description
.github/workflows/yaml-fix.yaml Replaces inline reaction github-script steps with complete-pr-comment.
.github/workflows/python-fix.yaml Replaces inline reaction github-script steps with complete-pr-comment.
.github/workflows/markdown-fix.yaml Replaces inline reaction github-script steps with complete-pr-comment.
.github/workflows/jsonnet-format-fix.yaml Replaces inline reaction github-script steps with complete-pr-comment.
.github/workflows/header-guards-fix.yaml Replaces inline reaction github-script steps with complete-pr-comment.
.github/workflows/cmake-format-fix.yaml Replaces inline reaction github-script steps with complete-pr-comment.
.github/workflows/clang-format-fix.yaml Replaces inline reaction github-script steps with complete-pr-comment.
.github/workflows/format-all.yaml Uses complete-pr-comment with an aggregated status across sub-workflows.
.github/workflows/clang-tidy-fix.yaml Adds a new job to update reactions for clang-tidy runs.
.github/actions/complete-pr-comment/action.yaml New composite action implementing reaction removal + success/failure reaction.
Comments suppressed due to low confidence (1)

.github/actions/complete-pr-comment/action.yaml:53

  • This file appears to end with an extra blank line (trailing blank line at EOF). The repo’s formatting rules require files to end with exactly one newline and no trailing blank lines; please remove the final empty line.
          }


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

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

Copilot reviewed 27 out of 27 changed files in this pull request and generated 8 comments.


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

@greenc-FNAL
Copy link
Contributor Author

@phlexbot format

@github-actions
Copy link
Contributor

Format Fixes Applied

✅ ruff fixes pushed (commit a02a65f)
✅ YAML formatter fixes pushed (commit 4c38572)

⚠️ Note: Some issues may require manual review and fixing.

@greenc-FNAL
Copy link
Contributor Author

@phlexbot yaml-fix

@github-actions
Copy link
Contributor

Automatic YAML formatter fixes pushed (commit 4b59517).
⚠️ Note: Some issues may require manual review and fixing.

@greenc-FNAL greenc-FNAL force-pushed the jules-maintenance-fix-pr-comment-reactions-18132869807280577001 branch from 4b59517 to 6aca4df Compare March 12, 2026 03:04
@greenc-FNAL greenc-FNAL requested a review from Copilot March 12, 2026 03:04
@greenc-FNAL greenc-FNAL changed the title maintenance: Fix and consolidate PR comment reactions maintenance: correct tidy-fix comment reactions, and aggressive consolidation Mar 12, 2026
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

github-actions bot and others added 2 commits March 12, 2026 09:22
This commit introduces a new reusable GitHub Action `.github/actions/complete-pr-comment`
to handle removing the 'eyes' reaction and adding a completion reaction ('rocket' for success,
'confused' for failure) to triggering issue comments.

Changes:
- Created `.github/actions/complete-pr-comment/action.yaml` with robust error handling.
- Updated `clang-tidy-fix.yaml` to include reaction handling (fixing the reported issue).
- Refactored all other format fix workflows to use the new consolidated action.
- Improved `format-all.yaml` to report the aggregate status of all formatting sub-jobs.

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>

maintenance: Consolidate workflow reactions and setup logic

This commit introduces a major refactoring of the CI workflows to reduce
duplication, improve maintainability, and ensure consistent PR comment
reactions.

New Reusable Actions:
- .github/actions/complete-pr-comment: Robustly handles PR comment
  reactions (removing 'eyes', adding 'rocket' on success or 'confused'
  on failure) with proper error handling.
- .github/actions/prepare-fix-outputs: Consolidates the resolution of
  branch and repository information for workflows triggered by bot commands.
- .github/actions/prepare-check-outputs: Consolidates environment
  detection and ref resolution for check-style workflows.

Improvements:
- Fixed missing completion reactions in clang-tidy-fix.
- Refactored all 21 core workflow files to use the new actions,
  significantly reducing duplicated boilerplate.
- Preserved all original authorization triggers and permissions.
- Enhanced format-all.yaml to report an aggregate status.
- Consistently used @main for internal action references as requested.

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>

maintenance: Fix and consolidate PR comment reactions and workflow setup

This commit addresses the missing 'rocket' emoji on completion of fix workflows
and performs a major refactoring of the CI workflows to reduce duplication
and improve maintainability.

Key Changes:
- Created `.github/actions/complete-pr-comment`: Robustly handles PR comment
  reactions (removing 'eyes', adding 'rocket' on success or 'confused'
  on failure) with proper error handling.
- Created `.github/actions/prepare-fix-outputs`: Consolidates ref and
  repository resolution for bot-triggered workflows.
- Created `.github/actions/prepare-check-outputs`: Consolidates environment
  detection and ref resolution for check workflows.
- Refactored all 21 core workflow files to use these new actions.
- Fixed specific issues in `clang-tidy-fix.yaml`, `codeql-analysis.yaml`,
  and `format-all.yaml` identified during review.
- Removed temporary refactoring scripts.

These changes ensure consistent behavior and significantly reduce YAML boilerplate.

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>

Apply YAML formatter fixes
@greenc-FNAL greenc-FNAL force-pushed the jules-maintenance-fix-pr-comment-reactions-18132869807280577001 branch from 6aca4df to 8fd1ce2 Compare March 12, 2026 14:23
Comment on lines +40 to +48
- name: Check out source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
path: ${{ inputs.checkout-path }}
ref: ${{ inputs.ref }}
repository: ${{ inputs.repo }}

- name: Detect relevant changes

Check warning

Code scanning / CodeQL

Checkout of untrusted code in trusted context

Potential unsafe checkout of untrusted pull request on privileged workflow.

Copilot Autofix

AI about 9 hours ago

In general, to fix this class of problem you must ensure that untrusted pull-request code is not checked out (or, if it must be, not executed) in a privileged context. For a reusable composite action, the safest approach is to (a) constrain the repository and ref that can be checked out so that they are not directly controllable by PR authors, or (b) clearly separate “trusted” and “untrusted” modes, requiring an explicit, safe ref when used in privileged workflows.

For this specific file, the minimal change that hardens the action without altering intended functionality is to restrict repository to the current repository and eliminate the ability for callers to override repo arbitrarily. That removes a major injection vector where a privileged workflow could be tricked into checking out an attacker-controlled repository. Additionally, we can narrow the ref to only allow values that are expected to be trusted (for example defaulting to the workflow’s own ref) or at least document that ref must not be wired directly from untrusted PR HEAD in privileged workflows; however, we are constrained to code-only changes and cannot enforce patterns at the call site. Within this file, the best concrete hardening we can do is:

  • Remove repo as a configurable input for checkout and instead use repository: ${{ github.repository }} so the checkout is always from the current repo.
  • Optionally, we can leave the repo input defined for backward compatibility for callers, but it will no longer affect the checkout. This avoids breaking existing workflows while still preventing unexpected external repos from being checked out in a privileged job.

These edits are all within .github/actions/run-change-detection/action.yaml in the Check out source code step (lines 40–47). No new imports or external dependencies are needed.

Suggested changeset 1
.github/actions/run-change-detection/action.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/actions/run-change-detection/action.yaml b/.github/actions/run-change-detection/action.yaml
--- a/.github/actions/run-change-detection/action.yaml
+++ b/.github/actions/run-change-detection/action.yaml
@@ -43,7 +43,8 @@
         fetch-depth: 0
         path: ${{ inputs.checkout-path }}
         ref: ${{ inputs.ref }}
-        repository: ${{ inputs.repo }}
+        # Always check out from the current repository to avoid untrusted external repos
+        repository: ${{ github.repository }}
 
     - name: Detect relevant changes
       id: filter
@@ -65,4 +66,3 @@
           echo "::group::Relevant files detected"
           printf '%s\n' "${{ steps.filter.outputs.matched_files }}"
           echo "::endgroup::"
-        fi
EOF
@@ -43,7 +43,8 @@
fetch-depth: 0
path: ${{ inputs.checkout-path }}
ref: ${{ inputs.ref }}
repository: ${{ inputs.repo }}
# Always check out from the current repository to avoid untrusted external repos
repository: ${{ github.repository }}

- name: Detect relevant changes
id: filter
@@ -65,4 +66,3 @@
echo "::group::Relevant files detected"
printf '%s\n' "${{ steps.filter.outputs.matched_files }}"
echo "::endgroup::"
fi
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@greenc-FNAL
Copy link
Contributor Author

Review the full CodeQL report for details.

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

Copilot reviewed 28 out of 28 changed files in this pull request and generated 20 comments.

Comments suppressed due to low confidence (1)

.github/workflows/jsonnet-format-fix.yaml:112

  • The Jsonnet formatting step still uses CHECKOUT_PATH: ${{ env.local_checkout_path }}, but checkout now happens at ${{ needs.setup.outputs.checkout_path }}. These can diverge when inputs.repo points at a different repo name than github.event.repository.name (or when workflow-setup resolves a different default), causing find "$CHECKOUT_PATH" ... to operate on a non-existent directory and apply no fixes. Use ${{ needs.setup.outputs.checkout_path }} consistently for CHECKOUT_PATH.
      - name: Apply Jsonnet formatting
        id: lint
        env:
          CHECKOUT_PATH: ${{ env.local_checkout_path }}
        # yamllint disable rule:line-length
        run: |
          docker run --rm -v "${{ github.workspace }}:/work" -w /work --user root public.ecr.aws/bitnami/jsonnet:latest \
            sh -c "find \"$CHECKOUT_PATH\" \( -name '*.jsonnet' -o -name '*.libsonnet' \) -print0 | xargs -0 -r jsonnetfmt -i"

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

@greenc-FNAL
Copy link
Contributor Author

@copilot Please address all outstanding current and historical review comments in the following ways:

  1. Resolve all "outdated" review comments.
  2. Resolve all historical review comments addressed or obsoleted by subsequent commits.
  3. Resolve with an appropriate note all comments mentioning the security/safety of reusable action version/branch/hash specifications, as these will be changed to @main per policy prior to merge.
  4. Evaluate all remaining outstanding review comments for validity of criticism, and then address and.or resolve with an appropriate note

Copy link
Contributor

Copilot AI commented Mar 12, 2026

@greenc-FNAL I've opened a new pull request, #414, to work on those changes. Once the pull request is ready, I'll request review from you.

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

Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.


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

@greenc-FNAL
Copy link
Contributor Author

@copilot Please address outstanding, unresolved review comments from the latest review.

Copy link
Contributor

Copilot AI commented Mar 12, 2026

@greenc-FNAL I've opened a new pull request, #419, to work on those changes. Once the pull request is ready, I'll request review from you.

…sion (#419)

* Initial plan

* Fix artifact nested path and add issues:write permission for reactions

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
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

Copilot reviewed 28 out of 28 changed files in this pull request and generated 19 comments.


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

@greenc-FNAL
Copy link
Contributor Author

@copilot Please address current unresolved review comments, excepting any that refer to changing the branch/version/hash reference to any reusable actions. Pay special attention to careful analysis and resolution of possible workflow permission issues.

Copy link
Contributor

Copilot AI commented Mar 12, 2026

@greenc-FNAL I've opened a new pull request, #420, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* fix: address unresolved review comments - permissions, workflow_dispatch, pr-head-sha wiring

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
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

Copilot reviewed 28 out of 28 changed files in this pull request and generated 8 comments.


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

@greenc-FNAL
Copy link
Contributor Author

@copilot Please address unresolved comments from the latest review, but more generally I think we need to ensure that—for all workflows—relevance detection either runs as expected or is bypassed according to expectations from upstream/main. In addition, we need to be sure that trigger events of all types behave according to upstream/main's example, and we account properly for when the workflow is actually operating according to workflow_call, and when it is seeing the trigger event that the calling workflow saw.

It is of paramount importance that all workflow/action functionality from upstream/main will survive the merge of this PR.

Copy link
Contributor

Copilot AI commented Mar 12, 2026

@greenc-FNAL I've opened a new pull request, #421, to work on those changes. Once the pull request is ready, I'll request review from you.

…d correct clang-tidy/format-all failure behavior (#421)

* Initial plan

* fix: wire workflow_call inputs, act fallback for change detection, and clang-tidy/format-all failures

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
@greenc-FNAL
Copy link
Contributor Author

@phlexbot yaml-fix

@github-actions
Copy link
Contributor

Automatic YAML formatter fixes pushed (commit 333f6d3).
⚠️ Note: Some issues may require manual review and fixing.

@greenc-FNAL
Copy link
Contributor Author

@phlexbot markdown-fix

@github-actions
Copy link
Contributor

No automatic markdownlint fixes were necessary.

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

Copilot reviewed 28 out of 28 changed files in this pull request and generated 20 comments.


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

@greenc-FNAL greenc-FNAL force-pushed the jules-maintenance-fix-pr-comment-reactions-18132869807280577001 branch from f333886 to 749ae5b Compare March 12, 2026 23:38
@greenc-FNAL
Copy link
Contributor Author

@knoepfel This was tested as much as possible with a temporary change to reusable action locations, which has been reverted for (hopefully) final review and merge.

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