Skip to content

Add shadow reviewer workflow#4430

Merged
allspain merged 11 commits intomainfrom
allspain/shadow-reviewer
Apr 7, 2026
Merged

Add shadow reviewer workflow#4430
allspain merged 11 commits intomainfrom
allspain/shadow-reviewer

Conversation

@allspain
Copy link
Copy Markdown
Collaborator

Motivation

Add a GitHub Actions workflow for shadow code review powered by the rum-ai-toolkit shadow reviewer.

Changes

  • Added .github/workflows/shadow-review.yml workflow that:
    • Syncs the shadow fork on merges to main
    • Mirrors non-draft, non-bot PRs to the shadow fork for review

Test instructions

Workflow will trigger on PRs — verify it runs correctly on a test PR.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@allspain allspain requested a review from a team as a code owner March 31, 2026 20:10
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da bot commented Mar 31, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 178.50 KiB 178.50 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 26.97 KiB 26.97 KiB 0 B 0.00%
Logs 57.00 KiB 57.00 KiB 0 B 0.00%
Rum Slim 134.32 KiB 134.32 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0048 0.0056 +16.67%
RUM - add action 0.0146 0.0155 +6.16%
RUM - add error 0.014 0.018 +28.57%
RUM - add timing 0.003 0.0032 +6.67%
RUM - start view 0.0148 0.0184 +24.32%
RUM - start/stop session replay recording 0.0009 0.0007 -22.22%
Logs - log message 0.0161 0.0147 -8.70%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.00 KiB 27.50 KiB +1.49 KiB
RUM - add action 92.97 KiB 99.08 KiB +6.12 KiB
RUM - add timing 26.37 KiB 25.52 KiB -866 B
RUM - add error 97.51 KiB 97.85 KiB +347 B
RUM - start/stop session replay recording 26.79 KiB 25.44 KiB -1.35 KiB
RUM - start view 484.79 KiB 484.91 KiB +127 B
Logs - log message 100.18 KiB 99.98 KiB -209 B

🔗 RealWorld

@datadog-prod-us1-3
Copy link
Copy Markdown

datadog-prod-us1-3 bot commented Apr 1, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.31% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 506f9a8 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@allspain
Copy link
Copy Markdown
Collaborator Author

allspain commented Apr 1, 2026

I have read the CLA Document and I hereby sign the CLA

Clean up file header comment and fix markdown heading level in shadow PR body.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ncreated
Copy link
Copy Markdown
Member

ncreated commented Apr 2, 2026

I have read the CLA Document and I hereby sign the CLA

echo "=== Mirroring PR #${PR_NUMBER} (${PR_HEAD_SHA}) to ${SHADOW_FORK} ==="

# Determine version number by counting existing shadow branches (exclude -base)
VERSION=$(git ls-remote --heads "https://x-access-token:${SHADOW_FORK_TOKEN}@github.com/${SHADOW_FORK}.git" "shadow/${PR_NUMBER}/v*" 2>/dev/null \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it is better to use dd-octo-sts for the GH token management

@0xnm
Copy link
Copy Markdown
Member

0xnm commented Apr 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 506f9a869d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +13 to +16
if: >-
github.event_name == 'pull_request'
&& github.event.pull_request.draft != true
&& github.event.pull_request.user.type != 'Bot'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Skip job when shadow token is unavailable on fork PRs

This job runs for all non-draft, non-bot pull_request events, but it assumes secrets.SHADOW_FORK_TOKEN is present and immediately uses it for shadow-fork access. For forked PRs (and Dependabot-style fork-restricted runs), repository secrets are not provided, so the pre-flight check fails and the workflow reports a hard failure for external contributors. Add a guard in if: (for example, same-repo PRs only) or explicitly skip when the token is missing.

Useful? React with 👍 / 👎.

Comment on lines +80 to +82
git fetch origin "pull/${PR_NUMBER}/head:pr-head" --depth=50
echo "Fetching base ref..."
git fetch origin "${PR_BASE_REF}:base-ref" --depth=50
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fetch enough history before calling merge-base

Both refs are fetched with a fixed shallow depth of 50 and then used to compute git merge-base. When a PR branch diverged more than 50 commits ago, the common ancestor is outside the fetched history, so git merge-base fails and the mirror job aborts for long-lived branches. This should deepen/fetch full history (or retry with increasing depth) before deriving MERGE_BASE.

Useful? React with 👍 / 👎.

@allspain
Copy link
Copy Markdown
Collaborator Author

allspain commented Apr 7, 2026

Going to merge and address the feedback in a new PR

@allspain allspain merged commit 65cb22a into main Apr 7, 2026
22 of 23 checks passed
@allspain allspain deleted the allspain/shadow-reviewer branch April 7, 2026 09:13
@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2026
@BeltranBulbarellaDD
Copy link
Copy Markdown
Contributor

@allspain @0xnm @ncreated Do you think we could not show the:
"allspain mentioned this pull request ..." on every CI run?
E.g:
Screenshot 2026-04-07 at 17 41 55

Happy to work on it, just want to know what you think about it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants