Skip to content

Comments

Repurpose @RCGitBot please test to approve CircleCI hold job#6274

Open
ajpallares wants to merge 4 commits intopallares/change-ci-structure-for-PRsfrom
pallares/approve-hold-job-with-comment
Open

Repurpose @RCGitBot please test to approve CircleCI hold job#6274
ajpallares wants to merge 4 commits intopallares/change-ci-structure-for-PRsfrom
pallares/approve-hold-job-with-comment

Conversation

@ajpallares
Copy link
Contributor

@ajpallares ajpallares commented Feb 16, 2026

Motivation

With the new CI structure, PRs no longer need a separate all-tests pipeline triggered from scratch. The full test suite is now gated behind an approve-full-tests hold job in the run-all-tests workflow.

This repurposes the existing @RCGitBot please test comment trigger to approve that hold job instead.

Description

  • Replaced the trigger-circleci-pipeline-action step with direct CircleCI v2 API calls that find the existing pipeline/workflow for the PR branch and approve the approve-full-tests hold job.
  • Renamed the workflow file from trigger_all_tests.yml to approve_full_tests.yml.
  • Added a reaction on the triggering PR comment: 👍 success, 👎 on failure.
  • Handles already-approved hold jobs gracefully.
  • Kept the existing org membership check so only RevenueCat members can trigger it.
  • Tested the CircleCI API flow manually (pipeline lookup, workflow lookup, approval job lookup, approve call).

Note: issue_comment workflows always run from the default branch, so this won't take effect until merged to main.


Note

Medium Risk
CI-only change but it modifies automation that can kick off expensive full test runs and depends on correct CircleCI API/job name resolution and secret handling.

Overview
Repurposes the @RCGitBot please test issue-comment trigger to approve the existing CircleCI approve-full-tests hold job in the run-all-tests workflow (via CircleCI v2 API lookups), rather than triggering a new CircleCI pipeline.

Renames/replaces the old workflow (trigger_all_tests.yml) with approve_full_tests.yml, keeps the RevenueCat org membership gate, handles the already-approved case, and adds a GitHub reaction on the triggering comment to signal success/failure.

Written by Cursor Bugbot for commit 18ba974. This will update automatically on new commits. Configure here.

Instead of triggering a new `all-tests` pipeline, the GitHub Actions
workflow now approves the `approve-full-tests` hold job in the
already-running `run-all-tests` workflow via the CircleCI v2 API.

Co-authored-by: Cursor <cursoragent@cursor.com>
ajpallares and others added 2 commits February 16, 2026 18:43
- Rename trigger_all_tests.yml to approve_full_tests.yml
- Add thumbs-up/down reaction on the triggering PR comment
- Handle already-approved hold jobs gracefully
- Replace silent curl flags with explicit timeouts
- Update comments to reflect new approve-hold-job behavior

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares ajpallares marked this pull request as ready for review February 16, 2026 18:11
@ajpallares ajpallares requested a review from a team as a code owner February 16, 2026 18:11
Copy link
Member

@rickvdl rickvdl left a comment

Choose a reason for hiding this comment

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

Nice touch! Thanks for adding this 🙌

| jq -r '.items[0].id')

if [[ -z "$PIPELINE_ID" || "$PIPELINE_ID" == "null" ]]; then
echo "::error::No CircleCI pipeline found for branch '$BRANCH'"
Copy link
Member

Choose a reason for hiding this comment

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

It would probably add a lot of complexity (updating comments later again), but would it be possible to communicate this back to the author through the comment (same thing on line 75)?

types: [created]

jobs:
approve-full-tests:
Copy link
Member

Choose a reason for hiding this comment

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

Nitpicky and I don't have a great alternative, but the job name confuses me sometimes 😅 The first thing that comes to mind when I read it is that I can "approve the result of the tests". I also get your point about trigger_all_tests but it might be a bite more explicit? Or approve_run_all_tests / approve_trigger_all_tests?

Please ignore if this was already discussed 🙈

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

Nice touch! I do wonder if we should just remove this TBH... feels like extra complexity and things to learn when there should already be a straightforward way to approve that hold job... Wdyt?

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


if [[ -z "$WORKFLOW_ID" || "$WORKFLOW_ID" == "null" ]]; then
echo "::error::No '$WORKFLOW_NAME' workflow found in pipeline $PIPELINE_ID"
exit 1
Copy link

Choose a reason for hiding this comment

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

Approves pipeline not tied to PR SHA

Medium Severity

The CircleCI lookup selects the “most recent pipeline for this branch” via project/$PROJECT_SLUG/pipeline?branch=$BRANCH, which can return an older pipeline (e.g., if new commits were pushed but CircleCI hasn’t created the latest pipeline yet). This can approve the hold job on the wrong run and leave the intended PR run unapproved.

Fix in Cursor Fix in Web

on:
issue_comment:
types: [created]

Copy link

Choose a reason for hiding this comment

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

Missing token permissions for gh reactions

Medium Severity

The workflow performs gh pr view and posts a comment reaction, but no explicit permissions: are set for GITHUB_TOKEN. In repos/orgs where the default token permissions are read-only, the reaction call (needs issues: write) can fail and flip the job to failed even if the CircleCI approval succeeded.

Additional Locations (1)

Fix in Cursor Fix in Web

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