Skip to content

Commit 6d98ce6

Browse files
authored
refactor: standardize bot identity to shadow (match deequ) (#278)
* Standardize bot identity to shadow (match deequ) Rename the bot's user-facing identity from deequ-bot to shadow so all three migrated repos (deequ, python-deequ, dqdl) are uniform. The migration PR kept the legacy deequ-bot name to avoid touching auto-approve.yml; this aligns it with the shared engine's home project. bot.name, the auto-approve clean marker, the workflows[] trigger entry, and the caller workflow name all move in lockstep — changing any one alone breaks the marker match and silently disables auto-approve. - .shadow.yml: bot.name deequ-bot -> shadow - auto-approve.yml: CLEAN_MARKER + workflows[] entry -> shadow / Shadow - issue-bot.yml: workflow name PyDeequ Bot -> Shadow (prompt_sm_prefix stays pydeequ-bot — that is the Secrets Manager namespace, not the bot identity.) * Doc hygiene: restore caller comment + clarify model-pin override - issue-bot.yml: re-add deequ's comment explaining BEDROCK_REPORTER/CRITIC_MODEL_ID are sourced from repo variables (empty falls back to engine defaults) - .shadow.yml: note the BEDROCK_MODEL_ID secret overrides models.investigator (live opus-4-8), so the yaml value is the fallback; critic has no secret so it runs the yaml value * Harden auto-approve: never self-approve guardrail changes Add a check that skips auto-approval when a PR modifies .github/** or .shadow.yml. Without it, a PR that weakens the approval gate (or repoints the bot at a different engine) is approved by the very gate it edits. Paginates listFiles so a large PR cannot slip a guarded file past a 30-item page.
1 parent db9e873 commit 6d98ce6

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/auto-approve.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Auto-Approve Clean PRs
22

33
on:
44
workflow_run:
5-
workflows: [".github/workflows/base.yml", "PyDeequ Bot"]
5+
workflows: [".github/workflows/base.yml", "Shadow"]
66
types: [completed]
77

88
permissions:
@@ -55,6 +55,21 @@ jobs:
5555
return;
5656
}
5757
58+
// Condition 0: never auto-approve a PR that changes the bot's own
59+
// guardrails (workflows or engine config) — that lets a PR weaken
60+
// the approval gate and be approved by the very gate it edits.
61+
// Require a human for these.
62+
const files = await github.paginate(github.rest.pulls.listFiles, {
63+
owner, repo, pull_number: prNumber, per_page: 100
64+
});
65+
const guarded = files.find(f =>
66+
f.filename.startsWith('.github/') || f.filename === '.shadow.yml'
67+
);
68+
if (guarded) {
69+
core.info(`PR touches guarded path ${guarded.filename} — requires human review, skipping`);
70+
return;
71+
}
72+
5873
// Condition 1: CI must have passed for this SHA
5974
const {data: workflowRuns} = await github.rest.actions.listWorkflowRunsForRepo({
6075
owner, repo, head_sha: sha, status: 'completed'
@@ -72,7 +87,7 @@ jobs:
7287
owner, repo, pull_number: prNumber
7388
});
7489
75-
const CLEAN_MARKER = '<!-- deequ-bot:clean -->';
90+
const CLEAN_MARKER = '<!-- shadow:clean -->';
7691
7792
const latestBot = reviews
7893
.filter(r => r.user.login === 'github-actions[bot]')

.github/workflows/issue-bot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PyDeequ Bot # load-bearing: auto-approve.yml keys on this exact name
1+
name: Shadow # load-bearing: auto-approve.yml keys on this exact name
22
# To upgrade the engine, bump the SHA in BOTH `uses:` and `shadow_ref` below
33
# (GitHub forbids expressions in `uses:`, so they can't share a variable).
44

@@ -54,6 +54,7 @@ jobs:
5454
KB_S3_BUCKET: ${{ secrets.KB_S3_BUCKET }}
5555
KB_S3_KEY: ${{ secrets.KB_S3_KEY }}
5656
BEDROCK_MODEL_ID: ${{ secrets.BEDROCK_MODEL_ID }}
57+
# Repo variables (not secrets); empty falls back to engine defaults.
5758
BEDROCK_REPORTER_MODEL_ID: ${{ vars.BEDROCK_REPORTER_MODEL_ID }}
5859
BEDROCK_CRITIC_MODEL_ID: ${{ vars.BEDROCK_CRITIC_MODEL_ID }}
5960
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.shadow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ codebase:
77
language: python
88

99
bot:
10-
name: deequ-bot # not pydeequ-bot: must render the <!-- deequ-bot:clean --> marker auto-approve.yml greps for
10+
name: shadow # renders the <!-- shadow:clean --> marker auto-approve.yml greps for
1111
attribution: "Reviewed by Shadow · github.com/sudsali/shadow"
1212
escalate_label: needs-human
1313
max_replies: 2

0 commit comments

Comments
 (0)