Fixes running integhration tests in PRs #404
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: skip review by coderabbit.ai -->
[!IMPORTANT]
## Review skipped
> Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.
> <details>
<summary>⚙️ Run configuration</summary>
> Configuration used: Path: .coderabbit.yaml
> Review profile: CHILL
> Plan: Pro Plus
> Run ID: 2b3a071f-eb26-4ca4-9462-97d094170be8> </details>
> You can disable this status message by setting thereviews.review_statustofalsein the CodeRabbit configuration file.
> Use the checkbox below for a quick retry:
- [ ] <!-- {"checkboxId": "e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review
<!-- end of auto-generated comment: skip review by coderabbit.ai -->
<!-- finishing_touch_checkbox_start -->
<details>
<summary>✨ Finishing Touches</summary>
<details>
<summary>🧪 Generate unit tests (beta)</summary>
</details>
</details>
<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->
---
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
<details>
<summary>❤️ Share</summary>
</details>
<sub>Comment @coderabbitai help to get the list of available commands and usage tips.</sub>
<!-- tips_end -->
_⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_
<details>
<summary>🧩 Analysis chain</summary>
🌐 Web query:
Find the current recommended immutable commit SHA for actions/github-script v7 from the official actions/github-script repository.
💡 Result:
The current recommended immutable commit SHA for actions/github-script v7 is e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb.[1] This SHA corresponds to the repository tree path for the v7 release (GitHub “tree/<sha>” view labeled as “V7”).[1]
Citations:
---
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE=".github/workflows/ci-pr-integration-tests.yaml"
echo "=== $FILE (lines 1-40) ==="
nl -ba "$FILE" | sed -n '1,40p'
Repository: cloud-bulldozer/orion
Length of output: 194
---
🌐 Web query:
actions/github-script v7 tag commit SHA e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb
💡 Result:
The commit SHA e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb is present in the official actions/github-script repository at path /tree/e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb, i.e., it is a full Git commit in that repo’s history [1]. Separately, the actions/github-script “v7” major version is documented as using the Node 20 runtime (and associated breaking changes vs Node 16) [2]. However, from the sources retrieved here, I cannot conclusively prove which exact tag (e.g., v7.0.0 vs another v7.x) points to the specific commit e7aeb8c...; the evidence available shows (a) the commit exists in the repo [1] and (b) what “v7” means at a runtime/behavior level [2], plus a commit list indicating e7aeb8c is a merge commit in the repo history [3], but it does not include an explicit mapping of “v7 tag -> this commit SHA.” If you want, tell me the exact tag you care about (v7, v7.0.0, v7.0.1, etc.), and I can narrow the search to the tag reference and verify the SHA mapping.
Citations:
---
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE=".github/workflows/ci-pr-integration-tests.yaml"
echo "=== $FILE (lines 1-40) ==="
if command -v cat >/dev/null; then
# show with line numbers using awk (nl may be unavailable)
awk 'NR<=40{printf "%5d:%s\n", NR, $0}' "$FILE"
else
sed -n '1,40p' "$FILE"
fi
Repository: cloud-bulldozer/orion
Length of output: 1590
---
🌐 Web query:
actions/github-script tree v7 commit e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb
💡 Result:
The commit e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb is a specific point in the repository for the official actions/github-script GitHub Action [1]. This action, which allows users to write JavaScript scripts that interact with the GitHub API and the workflow run context, underwent significant changes in version 7 [1][2]. The commit you identified is associated with this V7 release [1][3]. Key details regarding this version and commit include: Runtime Update: Version 7 updated the action's runtime from Node 16 to Node 20 [1][4]. Scripts running on this version are subject to any breaking changes introduced between Node 16 and Node 20 [1][5]. API Changes: In version 7, the previews input was modified to apply only to GraphQL API calls, as REST API previews were no longer necessary [1][2]. Usage: This action is commonly referenced in GitHub Actions workflows to execute custom JavaScript tasks [2][6]. Users pinned to specific commit SHAs, such as e7aeb8c, have historically been used to ensure workflow stability by preventing automatic updates to newer, potentially breaking versions [7][3]. As of May 2026, it is important to note that GitHub Actions are increasingly transitioning toward newer Node.js runtimes (e.g., Node 24) [8][9]. Users are encouraged to stay updated with the latest action versions to maintain compatibility with GitHub's evolving infrastructure and security standards [8][10].
Citations:
---
🌐 Web query:
https://github.com/actions/github-script/tree/v7
💡 Result:
The github-script action, maintained by GitHub, allows users to execute JavaScript directly within a workflow to interact with the GitHub API and workflow context [1][2]. Version 7 (v7) introduced significant updates and breaking changes [1][3]. Key technical details for v7 include: Runtime Update: The action was updated to run on Node 20 (replacing Node 16) [1][2]. Users should be aware that scripts are now subject to any breaking changes between Node 16 and 20 [1][2]. API Previews: The previews input in v7 now only applies to GraphQL API calls [1][3]. REST API previews are no longer necessary for this action [1][2]. Functionality and Context: The action provides the following pre-defined arguments to the script execution environment [2][4]: - github: A pre-authenticated octokit/rest.js client with pagination plugins [1][2]. - context: An object containing the context of the workflow run [1][2]. - core: A reference to the @actions/core package [1][2]. - glob: A reference to the @actions/glob package [1][2]. - io: A reference to the @actions/io package [1][2]. - exec: A reference to the @actions/exec package [1][2]. - require: A proxy wrapper around the Node.js require that supports relative paths and locally installed npm packages [1][2]. An escape hatch, original_require, is provided if the original Node.js require is needed [1][5]. Migration Note: When upgrading from older versions (e.g., v3), users may encounter changes in the Octokit client structure [6]. For instance, calls that previously used github.git.createRef may need to be updated to the new structure, such as github.rest.git.createRef [6]. It is recommended to pin actions to specific commit SHAs rather than tags to ensure workflow integrity, particularly given recent security context regarding supply chain attacks on action repositories [7][8].
Citations:
---
🌐 Web query:
actions/github-script v7.0.0 tree e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb
💡 Result:
The string e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb is a specific commit SHA in the official actions/github-script GitHub repository [1]. actions/github-script is a popular official GitHub Action that allows users to execute JavaScript snippets within their GitHub Actions workflows, providing access to the GitHub API, the workflow run context, and various Node.js utilities (like @actions/core and @actions/exec) [2][3]. Key details regarding this specific commit and version context include: - Context: Users often pin GitHub Actions to specific commit SHAs (like e7aeb8c663...) rather than tags to ensure deterministic workflow execution, a practice strongly recommended in modern CI/CD security to prevent unexpected updates or malicious tampering [4]. - Repository Versioning: While v7.0.0 was a major release of this action that notably migrated the runtime environment to Node 20 [2][5], the commit e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb represents a specific snapshot of the repository's source code at a point in time [1]. - Usage: This specific commit has been used in various production workflows (such as those observed in the Expensify/App repository) as a pinned dependency [6][7]. For the most secure and up-to-date implementation, it is recommended to reference the action by its latest stable tag or the most recent verified commit SHA found in the official actions/github-script repository [8][3].
Citations:
---
</details>
Pin actions/github-script to an immutable commit SHA (avoid @v7)
.github/workflows/ci-pr-integration-tests.yaml uses actions/github-script@v7 in the “Wait for CI tests to succeed” step; @v7 is mutable. Pin to a full SHA instead (e.g., actions/github-script@e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb).
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 zizmor (1.25.2)</summary>
[error] 13-13: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/ci-pr-integration-tests.yaml at line 13, The workflow step
currently references a mutable release tag "uses: actions/github-script@v7";
replace that with a pinned immutable commit SHA (for example
"actions/github-script@e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb") so the “Wait
for CI tests to succeed” step uses a fixed action version, updating the `uses:`
line to the full SHA to prevent future unexpected changes.
</details>
<!-- fingerprinting:phantom:poseidon:hawk -->
<!-- This is an auto-generated comment by CodeRabbit -->
_⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_
Integration tests are currently running against the base branch, not the PR code.
Line 53-54 pass pull_request.base.*, so the called workflow checks out the target branch instead of the PR head. That misses regressions introduced by the PR itself.
<details>
<summary>Suggested fix</summary>
- checkout_ref: ${{ github.event.pull_request.base.ref }}
- checkout_repo: ${{ github.event.pull_request.base.repo.full_name }}
+ checkout_ref: ${{ github.event.pull_request.head.sha }}
+ checkout_repo: ${{ github.event.pull_request.head.repo.full_name }}
</details>
<!-- suggestion_start -->
<details>
<summary>📝 Committable suggestion</summary>
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
checkout_ref: ${{ github.event.pull_request.head.sha }}
checkout_repo: ${{ github.event.pull_request.head.repo.full_name }}
</details>
<!-- suggestion_end -->
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/ci-pr-integration-tests.yaml around lines 53 - 54, The
workflow is checking out the base branch instead of the PR changes; update the
checkout_ref and checkout_repo inputs to use the PR head values by replacing
github.event.pull_request.base.ref and
github.event.pull_request.base.repo.full_name with
github.event.pull_request.head.ref and
github.event.pull_request.head.repo.full_name so the downstream integration
tests run against the PR code (symbols: checkout_ref, checkout_repo,
github.event.pull_request.base.*, github.event.pull_request.head.*).
</details>
<!-- fingerprinting:phantom:poseidon:hawk -->
<!-- This is an auto-generated reply by CodeRabbit -->
Actionable comments posted: 2
[!CAUTION]
Some comments are outside the diff and can’t be posted inline due to platform limitations.
>
> <details>
<summary>⚠️ Outside diff range comments (1)</summary><blockquote>
> <details>
<summary>.github/workflows/ci-pr-integration-tests.yaml (1)</summary><blockquote>
> 1-56: _⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_> Set explicit least-privilege permissions for this workflow.> This workflow currently relies on default token permissions, which are broader than necessary for these jobs.
> <details>
<summary>Suggested fix</summary>
>> name: CI PR integration tests > +permissions: > + contents: read > + actions: read > on: > pull_request_target: >
</details>
> As per coding guidelines, "Check for proper secret handling, job dependencies, and workflow triggers. Verify CI steps are idempotent where possible."
> <details>
<summary>🤖 Prompt for AI Agents</summary>
>> Verify each finding against current code. Fix only still-valid issues, skip the > rest with a brief reason, keep changes minimal, and validate. > > In @.github/workflows/ci-pr-integration-tests.yaml around lines 1 - 56, Add an > explicit least-privilege permissions block at the workflow root to replace > default token permissions: declare only the scopes needed by the "gate" job > (actions: read to call listWorkflowRunsForRepo, contents: read if checking > refs/checkout info, pull-requests: read for PR data) and any other minimal read > scopes required by "integration_tests"; place the permissions block under the > top-level keys (same level as name/on/jobs) so the actions/github-script step > and subsequent jobs use the restricted token rather than broad defaults. >
> </details>
> </blockquote></details>
> </blockquote></details>
<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci-pr-integration-tests.yaml:
- Around line 53-54: The workflow is checking out the base branch instead of the
PR changes; update the checkout_ref and checkout_repo inputs to use the PR head
values by replacing github.event.pull_request.base.ref and
github.event.pull_request.base.repo.full_name with
github.event.pull_request.head.ref and
github.event.pull_request.head.repo.full_name so the downstream integration
tests run against the PR code (symbols: checkout_ref, checkout_repo,
github.event.pull_request.base.*, github.event.pull_request.head.*).
- Line 13: The workflow step currently references a mutable release tag "uses:
actions/github-script@v7"; replace that with a pinned immutable commit SHA (for
example "actions/github-script@e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb") so the
“Wait for CI tests to succeed” step uses a fixed action version, updating the
`uses:` line to the full SHA to prevent future unexpected changes.
---
Outside diff comments:
In @.github/workflows/ci-pr-integration-tests.yaml:
- Around line 1-56: Add an explicit least-privilege permissions block at the
workflow root to replace default token permissions: declare only the scopes
needed by the "gate" job (actions: read to call listWorkflowRunsForRepo,
contents: read if checking refs/checkout info, pull-requests: read for PR data)
and any other minimal read scopes required by "integration_tests"; place the
permissions block under the top-level keys (same level as name/on/jobs) so the
actions/github-script step and subsequent jobs use the restricted token rather
than broad defaults.
</details>
<details>
<summary>🪄 Autofix (Beta)</summary>
Fix all unresolved CodeRabbit comments on this PR:
</details>
---
<details>
<summary>ℹ️ Review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2cc4c756-f3b0-4ff8-aeb2-257bb84d6d94
</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between 8c8b14b6a3bcabfa2ab727f98e7a17b66ecc7e86 and a98d78f69e19fc54a40ce4347a96156d7c5de4ff.
</details>
<details>
<summary>📒 Files selected for processing (1)</summary>
.github/workflows/ci-pr-integration-tests.yaml</details>
</details>
<!-- This is an auto-generated comment by CodeRabbit for review status -->
We want this to use main, stable tests are in main and they should not fail
@chentex, understood — the intent is to run the known-stable integration test suite from main as a baseline check, ensuring the base branch tests remain unbroken regardless of what the PR introduces. That's a valid design choice. I've noted this for future reviews.
---
<details>
<summary>✏️ Learnings added</summary>
Learnt from: chentex
Repo: cloud-bulldozer/orion PR: 404
File: .github/workflows/ci-pr-integration-tests.yaml:53-54
Timestamp: 2026-05-26T08:58:55.064Z
Learning: In `cloud-bulldozer/orion`, the workflow `.github/workflows/ci-pr-integration-tests.yaml` intentionally passes `github.event.pull_request.base.ref` and `github.event.pull_request.base.repo.full_name` (i.e., the `main` branch) as `checkout_ref` and `checkout_repo` to the reusable `tests.yaml` workflow. This is by design: the integration tests live on `main` and are considered stable; the workflow verifies those baseline tests still pass, not that the PR head passes them. Do not flag this as a bug.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
</details>
<!-- This is an auto-generated reply by CodeRabbit -->
/lgtm
@chentex: you cannot LGTM your own PR.
<details>
In response to this:
>/lgtm
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
</details>
/approve
Approving to test in a real PR
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/cloud-bulldozer/orion/pull/404#issuecomment-4542548703" title="Approved">chentex</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
chentex
Type of change
Description
With the action refactor, the Integration test was not running on the PRs adding it again.
Related Tickets & Documents
Checklist before requesting a review
Testing
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Chores
Enhanced CI/CD pipeline with automated integration test validation for pull requests.
<!-- review_stack_entry_start -->

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->