← Back to Pull requests

Fixes running integhration tests in PRs #404

Merged
chentex merged 1 files (55 lines) on May 26, 2026 09:16 UTC
View on GitHub
chentex chentex commented on May 26, 2026 08:35 UTC
Author

Type of change

  • Refactor

  • New feature

  • Bug fix

  • Optimization

  • Documentation Update
  • Description

    With the action refactor, the Integration test was not running on the PRs adding it again.

    Related Tickets & Documents

  • Related Issue #

  • Closes #
  • Checklist before requesting a review

  • I have performed a self-review of my code.

  • If it is a core feature, I have added thorough tests.
  • Testing


  • Please describe the System Under Test.

  • Please provide detailed steps to perform tests related to this code change.

  • How were the fix/results from this change verified? Please provide relevant screenshots or results.
  • <!-- 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 Change Stack](https://app.coderabbit.ai/change-stack/cloud-bulldozer/orion/pull/404?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

    <!-- review_stack_entry_end -->

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

    Diff: 55 lines (+55 / -0) across 1 files Reviewer: chentex Review duration: 41m
    All Vouch review confidence checks passed
    Residual risk 0.07 = Change Risk (0.46) × (1 − Review Confidence (0.86)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 55 lines diff across 1 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.95 · 5 substantive comment(s)
    0.95
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    85%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.241
    Self Review self_review
    0.140
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    11 items
    coderabbitai[bot] coderabbitai[bot] commented on May 26, 2026 08:35 UTC
    Bot

    <!-- 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.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

    > <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 the reviews.review_status to false in 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>

  • <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests
  • </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>

  • X

  • Mastodon

  • Reddit

  • LinkedIn
  • </details>

    <sub>Comment @coderabbitai help to get the list of available commands and usage tips.</sub>

    <!-- tips_end -->

    coderabbitai[bot] coderabbitai[bot] commented on code on May 26, 2026 08:57 UTC
    Code Review
    .github/workflows/ci-pr-integration-tests.yaml:1
    @@ -0,0 +1,55 @@
    +name: CI PR integration tests
    +on:
    +  pull_request_target:
    +    branches:
    +      - master
    +      - main
    +
    +jobs:
    +  gate:
    +    runs-on: ubuntu-latest
    +    steps:
    +      - name: Wait for CI tests to succeed
    +        uses: actions/github-script@v7

    _⚠️ 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:

  • 1: https://github.com/actions/github-script/tree/e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb
  • ---

    🏁 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:

  • 1: https://github.com/actions/github-script/tree/e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb

  • 2: https://github.com/actions/github-script

  • 3: https://github.com/actions/github-script/compare/v7.0.0...main
  • ---

    🏁 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:

  • 1: https://github.com/actions/github-script/tree/e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb

  • 2: https://github.com/actions/github-script

  • 3: https://github.com/Expensify/App/actions/runs/23550869425

  • 4: https://github.com/marketplace/actions/github-script

  • 5: https://github.com/marketplace/actions/github-script?version=v7.0.0

  • 6: https://www.youtube.com/watch?v=dHuksXTLA2k

  • 7: https://gbhackers.com/compromised-github-action/

  • 8: https://github.com/actions/github-script/releases

  • 9: https://github.com/Expensify/App/actions/runs/23429961558

  • 10: https://dev.to/gitguardian/the-future-of-github-actions-security-and-what-you-can-do-right-now-32nj
  • ---

    🌐 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:

  • 1: https://github.com/marketplace/actions/github-script?version=v7.0.0

  • 2: https://github.com/actions/github-script

  • 3: https://github.com/marketplace/actions/github-script

  • 4: https://github.com/actions/github-script?tab=readme-ov-file

  • 5: https://github.com/actions/github-script/blob/main/README.md

  • 6: https://github.com/actions/github-script/discussions/463

  • 7: https://cyberpress.org/malicious-github-action-steals/

  • 8: https://gbhackers.com/compromised-github-action/
  • ---

    🌐 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:

  • 1: https://github.com/actions/github-script/tree/e7aeb8c663f696059ebb5f9ab1425ed2ef511bdb

  • 2: https://github.com/marketplace/actions/github-script?version=v7.0.0

  • 3: https://github.com/actions/github-script

  • 4: https://dev.to/gitguardian/the-future-of-github-actions-security-and-what-you-can-do-right-now-32nj

  • 5: https://github.com/marketplace/actions/github-script

  • 6: https://github.com/Expensify/App/actions/runs/23429961558

  • 7: https://github.com/Expensify/App/actions/runs/23550869425

  • 8: https://github.com/actions/github-script/releases
  • ---

    </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 -->

    coderabbitai[bot] coderabbitai[bot] commented on code on May 26, 2026 08:57 UTC
    Code Review
    .github/workflows/ci-pr-integration-tests.yaml:1
    @@ -0,0 +1,55 @@
    +name: CI PR integration tests
    +on:
    +  pull_request_target:
    +    branches:
    +      - master
    +      - main
    +
    +jobs:
    +  gate:
    +    runs-on: ubuntu-latest
    +    steps:
    +      - name: Wait for CI tests to succeed
    +        uses: actions/github-script@v7
    +        timeout-minutes: 30
    +        env:
    +          HEAD_SHA: ${{ github.event.pull_request.head.sha }}
    +        with:
    +          script: |
    +            const sha = process.env.HEAD_SHA;
    +            const interval = 30000;
    +            const maxWait = 25 * 60 * 1000;
    +            const start = Date.now();
    +
    +            while (Date.now() - start < maxWait) {
    +              const runs = await github.rest.actions.listWorkflowRunsForRepo({
    +                owner: context.repo.owner,
    +                repo: context.repo.repo,
    +                head_sha: sha,
    +              });
    +
    +              const ciRun = runs.data.workflow_runs.find(r => r.name === 'CI tests');
    +
    +              if (ciRun) {
    +                if (ciRun.conclusion === 'success') {
    +                  console.log('CI tests passed');
    +                  return;
    +                } else if (ciRun.conclusion) {
    +                  core.setFailed(`CI tests concluded with: ${ciRun.conclusion}`);
    +                  return;
    +                }
    +              }
    +
    +              console.log('Waiting for CI tests to complete...');
    +              await new Promise(r => setTimeout(r, interval));
    +            }
    +
    +            core.setFailed('Timeout waiting for CI tests');
    +
    +  integration_tests:
    +    needs: gate
    +    uses: ./.github/workflows/tests.yaml
    +    with:
    +      checkout_ref: ${{ github.event.pull_request.base.ref }}
    +      checkout_repo: ${{ github.event.pull_request.base.repo.full_name }}

    _⚠️ 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 -->

    coderabbitai[bot] coderabbitai[bot] commented on May 26, 2026 08:57 UTC
    Reviewer

    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:

  • <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended)

  • <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes
  • </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 -->

    chentex chentex commented on code on May 26, 2026 08:58 UTC
    Code Review
    .github/workflows/ci-pr-integration-tests.yaml:1
    @@ -0,0 +1,55 @@
    +name: CI PR integration tests
    +on:
    +  pull_request_target:
    +    branches:
    +      - master
    +      - main
    +
    +jobs:
    +  gate:
    +    runs-on: ubuntu-latest
    +    steps:
    +      - name: Wait for CI tests to succeed
    +        uses: actions/github-script@v7
    +        timeout-minutes: 30
    +        env:
    +          HEAD_SHA: ${{ github.event.pull_request.head.sha }}
    +        with:
    +          script: |
    +            const sha = process.env.HEAD_SHA;
    +            const interval = 30000;
    +            const maxWait = 25 * 60 * 1000;
    +            const start = Date.now();
    +
    +            while (Date.now() - start < maxWait) {
    +              const runs = await github.rest.actions.listWorkflowRunsForRepo({
    +                owner: context.repo.owner,
    +                repo: context.repo.repo,
    +                head_sha: sha,
    +              });
    +
    +              const ciRun = runs.data.workflow_runs.find(r => r.name === 'CI tests');
    +
    +              if (ciRun) {
    +                if (ciRun.conclusion === 'success') {
    +                  console.log('CI tests passed');
    +                  return;
    +                } else if (ciRun.conclusion) {
    +                  core.setFailed(`CI tests concluded with: ${ciRun.conclusion}`);
    +                  return;
    +                }
    +              }
    +
    +              console.log('Waiting for CI tests to complete...');
    +              await new Promise(r => setTimeout(r, interval));
    +            }
    +
    +            core.setFailed('Timeout waiting for CI tests');
    +
    +  integration_tests:
    +    needs: gate
    +    uses: ./.github/workflows/tests.yaml
    +    with:
    +      checkout_ref: ${{ github.event.pull_request.base.ref }}
    +      checkout_repo: ${{ github.event.pull_request.base.repo.full_name }}

    We want this to use main, stable tests are in main and they should not fail

    coderabbitai[bot] coderabbitai[bot] commented on code on May 26, 2026 08:58 UTC
    Code Review
    .github/workflows/ci-pr-integration-tests.yaml:1
    @@ -0,0 +1,55 @@
    +name: CI PR integration tests
    +on:
    +  pull_request_target:
    +    branches:
    +      - master
    +      - main
    +
    +jobs:
    +  gate:
    +    runs-on: ubuntu-latest
    +    steps:
    +      - name: Wait for CI tests to succeed
    +        uses: actions/github-script@v7
    +        timeout-minutes: 30
    +        env:
    +          HEAD_SHA: ${{ github.event.pull_request.head.sha }}
    +        with:
    +          script: |
    +            const sha = process.env.HEAD_SHA;
    +            const interval = 30000;
    +            const maxWait = 25 * 60 * 1000;
    +            const start = Date.now();
    +
    +            while (Date.now() - start < maxWait) {
    +              const runs = await github.rest.actions.listWorkflowRunsForRepo({
    +                owner: context.repo.owner,
    +                repo: context.repo.repo,
    +                head_sha: sha,
    +              });
    +
    +              const ciRun = runs.data.workflow_runs.find(r => r.name === 'CI tests');
    +
    +              if (ciRun) {
    +                if (ciRun.conclusion === 'success') {
    +                  console.log('CI tests passed');
    +                  return;
    +                } else if (ciRun.conclusion) {
    +                  core.setFailed(`CI tests concluded with: ${ciRun.conclusion}`);
    +                  return;
    +                }
    +              }
    +
    +              console.log('Waiting for CI tests to complete...');
    +              await new Promise(r => setTimeout(r, interval));
    +            }
    +
    +            core.setFailed('Timeout waiting for CI tests');
    +
    +  integration_tests:
    +    needs: gate
    +    uses: ./.github/workflows/tests.yaml
    +    with:
    +      checkout_ref: ${{ github.event.pull_request.base.ref }}
    +      checkout_repo: ${{ github.event.pull_request.base.repo.full_name }}

    @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 -->

    chentex chentex commented on May 26, 2026 09:03 UTC
    Author

    /lgtm

    openshift-ci[bot] openshift-ci[bot] commented on May 26, 2026 09:03 UTC
    Bot

    @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>

    chentex chentex commented on May 26, 2026 09:03 UTC
    Author

    /approve

    Approving to test in a real PR

    openshift-ci[bot] openshift-ci[bot] commented on May 26, 2026 09:03 UTC
    Bot

    [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:

  • ~~OWNERS~~ [chentex]
  • 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":[]} -->

    Reviewers
    Assignees
    chentex chentex
    Labels
    risk: low confidence: 85.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 46.1% (MEDIUM) · Higher = larger blast radius
    46.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 85.6% · Lower = rushed or shallow review
    85.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 6.6% · Safe to merge
    6.6%