Skip to content

ci: pull review gha#949

Open
syntaxsdev wants to merge 4 commits intomainfrom
feat/init-ai-pull-reviews
Open

ci: pull review gha#949
syntaxsdev wants to merge 4 commits intomainfrom
feat/init-ai-pull-reviews

Conversation

@syntaxsdev
Copy link
Contributor

No description provided.

@syntaxsdev syntaxsdev force-pushed the feat/init-ai-pull-reviews branch from 362b25a to 825e9e9 Compare March 18, 2026 15:34
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Walkthrough

Adds a new GitHub Actions workflow .github/workflows/pull-reviews.yml that triggers on pull_request (opened, synchronize) and runs a reusable review workflow, supplying S3 and GCP configuration and forwarding required secrets.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/pull-reviews.yml
New workflow added. Triggers on PR open/synchronize, sets workflow permissions, and delegates to reusable workflow ambient-code/pull-reviews/.github/workflows/review.yml@main, passing S3 (endpoint, keys, bucket), GCP project/region/workload identity provider, and CDN_BASE_URL via inputs/secrets.

Sequence Diagram(s)

sequenceDiagram
  participant GitHub as GitHub (PR)
  participant Workflow as Workflow (.github/workflows/pull-reviews.yml)
  participant Reusable as Reusable Workflow (ambient-code/.../review.yml)
  participant S3 as S3 (endpoint)
  participant GCP as GCP (Workload Identity)

  GitHub->>Workflow: pull_request (opened/synchronize)
  Workflow->>Reusable: dispatch with inputs (s3 bucket, gcp project/region, provider) & secrets (S3 keys, CDN_BASE_URL)
  Reusable->>S3: use endpoint + credentials (upload/download)
  Reusable->>GCP: authenticate via workload identity
  Reusable-->>Workflow: report status/results
  Workflow-->>GitHub: update PR (comments/status)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description explaining the purpose and scope of the new GitHub Actions workflow.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: introducing a GitHub Actions workflow for pull request reviews.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/init-ai-pull-reviews
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pull-reviews.yml:
- Around line 3-5: The pull request workflow in pull-reviews.yml currently
triggers on pull_request types [opened, synchronize] which duplicates the events
used by amber-auto-review.yml; decide whether to consolidate or avoid duplicate
runs by either removing or changing the trigger in pull-reviews.yml (or vice
versa), adding a conditional check (e.g., using if: github.workflow !=
'amber-auto-review' or adding paths/branches filters) or merging the two
workflow jobs into a single workflow; update the on: pull_request block in
pull-reviews.yml (or adjust amber-auto-review.yml) accordingly so only one
workflow runs for the same PR events.
- Line 1: Rename the GitHub Actions workflow's name field to reflect its
purpose: replace the current "Video Review" value in the workflow's top-level
name: entry with a clearer label such as "Pull Review" or "PR Review" so the
workflow name matches the automated pull request review task.
- Line 8: The workflow job name `preel` is a typo; rename the job key to a
clear, descriptive identifier such as `pr-review` or `pull-review` (replace the
`preel:` job key with `pr-review:`), and update any references to that job
elsewhere in the workflow (e.g., in `needs:` or `if:` conditions) to match the
new name to avoid broken dependencies.
- Line 9: The external workflow reference currently uses a floating ref
"ambient-code/pull-reviews/.github/workflows/review.yml@main"; replace the `@main`
ref with a specific commit SHA for the external repo so the workflow is pinned
and reproducible — update the line containing the uses declaration (the string
"ambient-code/pull-reviews/.github/workflows/review.yml@main") to use the chosen
commit SHA (e.g. "...review.yml@<COMMIT_SHA>") and commit that change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f1736d6d-8039-4b2f-b655-5eef5b875f83

📥 Commits

Reviewing files that changed from the base of the PR and between 2389f05 and 825e9e9.

📒 Files selected for processing (1)
  • .github/workflows/pull-reviews.yml

@@ -0,0 +1,18 @@
name: Video Review
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Workflow name appears incorrect.

The name "Video Review" seems inconsistent with the PR's purpose of enabling automated pull request reviews. Consider renaming to something like "Pull Review" or "PR Review".

-name: Video Review
+name: Pull Review
📝 Committable suggestion

‼️ 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.

Suggested change
name: Video Review
name: Pull Review
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml at line 1, Rename the GitHub Actions
workflow's name field to reflect its purpose: replace the current "Video Review"
value in the workflow's top-level name: entry with a clearer label such as "Pull
Review" or "PR Review" so the workflow name matches the automated pull request
review task.

Comment on lines +3 to +5
on:
pull_request:
types: [opened, synchronize]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Potential duplicate review workflows.

This workflow triggers on the same events (opened, synchronize) as the existing amber-auto-review.yml workflow, which also performs automatic code review. Running both simultaneously may result in duplicate or conflicting review comments on PRs.

Consider whether both workflows are needed, or if they should be consolidated or conditionally triggered.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml around lines 3 - 5, The pull request
workflow in pull-reviews.yml currently triggers on pull_request types [opened,
synchronize] which duplicates the events used by amber-auto-review.yml; decide
whether to consolidate or avoid duplicate runs by either removing or changing
the trigger in pull-reviews.yml (or vice versa), adding a conditional check
(e.g., using if: github.workflow != 'amber-auto-review' or adding paths/branches
filters) or merging the two workflow jobs into a single workflow; update the on:
pull_request block in pull-reviews.yml (or adjust amber-auto-review.yml)
accordingly so only one workflow runs for the same PR events.

types: [opened, synchronize]

jobs:
preel:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Job name appears to be a typo.

The job name preel seems unintentional. Consider using a more descriptive name like pr-review or pull-review.

-  preel:
+  pr-review:
📝 Committable suggestion

‼️ 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.

Suggested change
preel:
pr-review:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml at line 8, The workflow job name `preel`
is a typo; rename the job key to a clear, descriptive identifier such as
`pr-review` or `pull-review` (replace the `preel:` job key with `pr-review:`),
and update any references to that job elsewhere in the workflow (e.g., in
`needs:` or `if:` conditions) to match the new name to avoid broken
dependencies.


jobs:
preel:
uses: ambient-code/pull-reviews/.github/workflows/review.yml@main
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Pin external workflow to a specific commit SHA.

Referencing the external workflow with @main poses a supply chain risk—the workflow could change unexpectedly or maliciously. Pin to a specific commit SHA for security and reproducibility.

-    uses: ambient-code/pull-reviews/.github/workflows/review.yml@main
+    uses: ambient-code/pull-reviews/.github/workflows/review.yml@<commit-sha>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml at line 9, The external workflow
reference currently uses a floating ref
"ambient-code/pull-reviews/.github/workflows/review.yml@main"; replace the `@main`
ref with a specific commit SHA for the external repo so the workflow is pinned
and reproducible — update the line containing the uses declaration (the string
"ambient-code/pull-reviews/.github/workflows/review.yml@main") to use the chosen
commit SHA (e.g. "...review.yml@<COMMIT_SHA>") and commit that change.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

Preel Video Review

⚠️ Cautious — Adds a GitHub Actions workflow that integrates an external AI-powered pull request review system using reusable workflows.

https://pub-510dcf6312d143b68159aa24908df5dc.r2.dev/videos/ci-ambient-code-platform-949-1773848631601.mp4

Callouts

  • warning (security): External workflow dependency introduces supply chain risk - the ambient-code/pull-reviews@main workflow could be modified maliciously
  • warning (security): Multiple sensitive API keys and S3 credentials are exposed to external workflow execution context
  • info (complexity): Dependency on external repository makes workflow harder to maintain and debug
File-by-file breakdown
  • .github/workflows/pull-reviews.yml (high): Sets up automated AI-powered pull request reviews using an external reusable workflow

Generated by preel— automated video reviews for PRs

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (4)
.github/workflows/pull-reviews.yml (4)

1-1: ⚠️ Potential issue | 🟡 Minor

Rename workflow title to match actual purpose.

Line 1 (Video Review) does not reflect PR review automation, which makes Actions history harder to scan.

Suggested fix
-name: Video Review
+name: Pull Review
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml at line 1, The workflow's top-level name
field currently reads "Video Review" which is misleading; update the workflow
name (the YAML top-level key "name" in the pull-reviews workflow) to something
that reflects PR review automation such as "Pull Request Review" or "PR Review"
so Actions history and dashboards clearly show its purpose; ensure you change
the value "Video Review" to the chosen descriptive title.

13-13: ⚠️ Potential issue | 🟡 Minor

Use a descriptive job key instead of preel.

Line 13 looks like a typo and makes downstream references less clear.

Suggested fix
-  preel:
+  pr-review:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml at line 13, The job key "preel" is a
typo; rename it to a descriptive key (for example "preflight_checks" or
"pre_release_checks") in the workflow job declaration and update all downstream
references that depend on this job key (any "needs:" entries or other workflow
callers) to use the new key; ensure the job name string (if present) remains
readable and adjust any comments or documentation referencing "preel" to the new
descriptive key so all references stay consistent.

14-14: ⚠️ Potential issue | 🟠 Major

Pin reusable workflow to an immutable commit SHA.

Line 14 references @main, which is mutable and weakens supply-chain integrity and reproducibility.

Suggested fix
-    uses: ambient-code/pull-reviews/.github/workflows/review.yml@main
+    uses: ambient-code/pull-reviews/.github/workflows/review.yml@<commit-sha>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml at line 14, The workflow currently
references a mutable ref
"ambient-code/pull-reviews/.github/workflows/review.yml@main" which should be
pinned to an immutable commit SHA; update the `uses:` entry that contains
"ambient-code/pull-reviews/.github/workflows/review.yml@main" to use the exact
commit SHA for that upstream workflow (e.g., replace `@main` with
`@<commit-sha>`), verifying the SHA from the upstream repo before committing so
the workflow is reproducible and supply-chain safe.

5-5: ⚠️ Potential issue | 🟠 Major

Verify this trigger does not duplicate another auto-review workflow.

Line 5 uses opened and synchronize; if another review workflow listens to the same events, you can get duplicate bot output on a single PR.

#!/bin/bash
# Find all PR-triggered workflows and inspect their event types for overlap.
fd -a '.github/workflows/.*\.ya?ml$' | while read -r f; do
  echo "==== $f ===="
  rg -n -C3 '^\s*on:|pull_request:|types:' "$f"
done
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml at line 5, The workflow currently
triggers on "types: [opened, synchronize]" which can duplicate other PR-review
workflows; search all workflow YAMLs for "on: pull_request" and "types:" entries
(especially "opened" or "synchronize") to identify overlapping workflows, then
either remove or narrow the duplicate trigger in this workflow (modify the
"types: [opened, synchronize]" entry to a more specific set, remove it, or add
distinguishing conditions like an if: or paths: filter) or consolidate logic
into a single workflow so only one workflow handles these PR events.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pull-reviews.yml:
- Around line 17-19: Replace the hardcoded GCP identifiers in the workflow
inputs (gcp_project_id, gcp_region, gcp_workload_identity_provider) with
repository secrets or workflow variables (e.g. use ${{ secrets.GCP_PROJECT_ID }}
/ ${{ vars.GCP_REGION }} / ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} or
similar) so the workflow matches the pattern used in model-discovery.yml; update
the input keys where gcp_project_id, gcp_region and
gcp_workload_identity_provider are defined to read from those secrets/vars and
document required secret/var names in the repo settings.

---

Duplicate comments:
In @.github/workflows/pull-reviews.yml:
- Line 1: The workflow's top-level name field currently reads "Video Review"
which is misleading; update the workflow name (the YAML top-level key "name" in
the pull-reviews workflow) to something that reflects PR review automation such
as "Pull Request Review" or "PR Review" so Actions history and dashboards
clearly show its purpose; ensure you change the value "Video Review" to the
chosen descriptive title.
- Line 13: The job key "preel" is a typo; rename it to a descriptive key (for
example "preflight_checks" or "pre_release_checks") in the workflow job
declaration and update all downstream references that depend on this job key
(any "needs:" entries or other workflow callers) to use the new key; ensure the
job name string (if present) remains readable and adjust any comments or
documentation referencing "preel" to the new descriptive key so all references
stay consistent.
- Line 14: The workflow currently references a mutable ref
"ambient-code/pull-reviews/.github/workflows/review.yml@main" which should be
pinned to an immutable commit SHA; update the `uses:` entry that contains
"ambient-code/pull-reviews/.github/workflows/review.yml@main" to use the exact
commit SHA for that upstream workflow (e.g., replace `@main` with
`@<commit-sha>`), verifying the SHA from the upstream repo before committing so
the workflow is reproducible and supply-chain safe.
- Line 5: The workflow currently triggers on "types: [opened, synchronize]"
which can duplicate other PR-review workflows; search all workflow YAMLs for
"on: pull_request" and "types:" entries (especially "opened" or "synchronize")
to identify overlapping workflows, then either remove or narrow the duplicate
trigger in this workflow (modify the "types: [opened, synchronize]" entry to a
more specific set, remove it, or add distinguishing conditions like an if: or
paths: filter) or consolidate logic into a single workflow so only one workflow
handles these PR events.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6b951f2a-0594-44c3-be87-93d8f45d7507

📥 Commits

Reviewing files that changed from the base of the PR and between 825e9e9 and 5e7af87.

📒 Files selected for processing (1)
  • .github/workflows/pull-reviews.yml

Comment on lines +17 to +19
gcp_project_id: ambient-code-platform
gcp_region: us-east5
gcp_workload_identity_provider: projects/888214980327/locations/global/workloadIdentityPools/github/providers/ambient-code-github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid hardcoded GCP environment identifiers in workflow inputs.

Lines 17–19 hardcode project/region/provider values. This reduces portability across environments and exposes infra identifiers in repo config. Prefer ${{ secrets.* }} or ${{ vars.* }} consistent with .github/workflows/model-discovery.yml (Lines 30–34, 36–43).

Suggested refactor
-      gcp_project_id: ambient-code-platform
-      gcp_region: us-east5
-      gcp_workload_identity_provider: projects/888214980327/locations/global/workloadIdentityPools/github/providers/ambient-code-github-actions
+      gcp_project_id: ${{ secrets.GCP_PROJECT }}
+      gcp_region: ${{ secrets.GCP_REGION }}
+      gcp_workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
📝 Committable suggestion

‼️ 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.

Suggested change
gcp_project_id: ambient-code-platform
gcp_region: us-east5
gcp_workload_identity_provider: projects/888214980327/locations/global/workloadIdentityPools/github/providers/ambient-code-github-actions
gcp_project_id: ${{ secrets.GCP_PROJECT }}
gcp_region: ${{ secrets.GCP_REGION }}
gcp_workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-reviews.yml around lines 17 - 19, Replace the
hardcoded GCP identifiers in the workflow inputs (gcp_project_id, gcp_region,
gcp_workload_identity_provider) with repository secrets or workflow variables
(e.g. use ${{ secrets.GCP_PROJECT_ID }} / ${{ vars.GCP_REGION }} / ${{
secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} or similar) so the workflow matches
the pattern used in model-discovery.yml; update the input keys where
gcp_project_id, gcp_region and gcp_workload_identity_provider are defined to
read from those secrets/vars and document required secret/var names in the repo
settings.

@ambient-code ambient-code bot removed this from the Review Queue milestone Mar 20, 2026
@ambient-code
Copy link
Contributor

ambient-code bot commented Mar 20, 2026

Review Queue Status

Check Status Detail
CI FAIL preel / review
Conflicts pass
Reviews warn Awaiting review

Action needed: Fix CI failures

Auto-generated by Review Queue workflow. Updated when PR changes.

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.

1 participant