Skip to content

Commit 9e47d5d

Browse files
committed
Trim workflow/config comments to WHY-only
Drop WHAT-narration and multi-paragraph explanations; keep only comments that prevent a concrete mistake (name coupling, dual-SHA pin, pull_request_target no-ref, permissions ceiling, marker, if-guard).
1 parent 64858b8 commit 9e47d5d

3 files changed

Lines changed: 16 additions & 70 deletions

File tree

.github/workflows/issue-bot.yml

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,11 @@
1-
name: Deequ Bot
2-
# NOTE: the workflow name "Deequ Bot" is load-bearing — auto-approve.yml keys
3-
# on workflows: ["Java CI with Maven", "Deequ Bot"]. Do not rename without
4-
# updating auto-approve.yml.
5-
#
6-
# This repo consumes the shared Shadow engine (sudsali/shadow) instead of a
7-
# vendored copy of the bot. Deequ's language-tuned prompts live in Secrets
8-
# Manager under the `deequ-bot/*` namespace and are selected via
9-
# `prompt_sm_prefix` — the engine fetches them in place of its bundled
10-
# language-agnostic defaults, so behavior stays deequ-specific while the code
11-
# is shared. All four surfaces (PR review, issue triage, issue-respond,
12-
# follow-up) run from one engine.
13-
#
14-
# UPGRADING the engine: bump the SHA in **two** places below — the `uses:` ref
15-
# (which resolves the reusable *workflow file*) AND the `shadow_ref` input
16-
# (which the workflow uses to check out the engine *code*). They MUST match, or
17-
# the workflow definition runs against a different code revision than intended.
18-
# GitHub Actions forbids expressions in `uses:`, so they can't share one
19-
# variable — both are pinned to SHADOW_ENGINE_SHA below. That is the ONLY change
20-
# needed per upgrade: the GitHubActionsDeequBot IAM trust (once the optional
21-
# hardening is applied POST-MERGE) pins job_workflow_ref to
22-
# `sudsali/shadow/.github/workflows/shadow-review.yml@*` (version wildcard), so
23-
# no IAM/Admin change is required per upgrade.
24-
#
25-
# SHADOW_ENGINE_SHA = 3a057597420d7123df162bfe4686aaafb5f7eccd (tag v1.2)
26-
# ^ keep the two occurrences below identical to this value.
1+
name: Deequ Bot # load-bearing: auto-approve.yml keys on this exact name
2+
# To upgrade the engine, bump the SHA in BOTH `uses:` and `shadow_ref` below
3+
# (GitHub forbids expressions in `uses:`, so they can't share a variable).
274

285
on:
296
issues:
307
types: [opened, reopened]
31-
pull_request_target: # Runs base branch code with secrets; safe because the bot fetches the diff via API, never executes PR code. NEVER add ref: to checkout.
8+
pull_request_target: # base-branch checkout only; never add ref: (see SECURITY A1)
329
types: [opened, reopened, synchronize]
3310
issue_comment:
3411
types: [created]
@@ -42,50 +19,33 @@ on:
4219
type: boolean
4320
default: true
4421

45-
# Reusable-workflow permission ceiling: a called workflow's nested jobs can
46-
# only receive permissions the CALLER grants. This block is the UNION the
47-
# reusable workflow's two jobs need — analyze (contents:read, id-token:write,
48-
# pull-requests:read) and act (contents:read, issues:write, pull-requests:write).
49-
# Without it the token defaults to none and the call fails at startup with
50-
# "is requesting '...', but is only allowed 'none'". GitHub still applies each
51-
# nested job's own narrower per-job permissions, so this ceiling doesn't widen
52-
# what analyze/act can actually do.
22+
# Union of the reusable workflow's nested-job permissions; a caller must grant
23+
# these or the call fails at startup (each nested job still narrows its own set).
5324
permissions:
5425
contents: read
5526
id-token: write
5627
pull-requests: write
5728
issues: write
5829

59-
# Serialize per issue/PR to prevent duplicate comments. (The reusable workflow
60-
# also sets its own concurrency group; this caller-side group additionally
61-
# covers the workflow_dispatch path via inputs.issue_number.)
30+
# Also covers the workflow_dispatch path, which has no PR/issue number in context.
6231
concurrency:
6332
group: bot-${{ github.event.issue.number || github.event.pull_request.number || inputs.issue_number }}
6433
cancel-in-progress: false
6534

6635
jobs:
6736
shadow:
68-
# Preserve the vendored bot's trigger guard exactly: run on workflow_dispatch;
69-
# otherwise skip bot-authored events and skip issue_comment on PRs (PR review
70-
# comes through pull_request_target, not issue_comment on the PR's issue).
71-
# The engine also skips bot authors internally (author_is_bot SKIP), but
72-
# gating here avoids spinning up the reusable workflow at all.
37+
# Skip bot-authored events and issue_comment on PRs (PR review runs via
38+
# pull_request_target); always run on manual dispatch.
7339
if: >-
7440
(github.event_name == 'workflow_dispatch') ||
7541
(github.actor != 'github-actions[bot]' &&
7642
(github.event.issue.pull_request == null || github.event_name == 'pull_request_target'))
7743
uses: sudsali/shadow/.github/workflows/shadow-review.yml@3a057597420d7123df162bfe4686aaafb5f7eccd
7844
with:
79-
# PR/issue number for the workflow_dispatch path (push/PR events resolve
80-
# it inside the reusable workflow from the event payload).
8145
pr_number: ${{ inputs.issue_number }}
8246
dry_run: ${{ inputs.dry_run && 'true' || 'false' }}
8347
shadow_ref: 3a057597420d7123df162bfe4686aaafb5f7eccd
8448
aws_region: us-east-1
85-
# Deequ's language-tuned prompts. The engine expands this to all eight
86-
# SM secret names under deequ-bot/ (pr-investigator/critic/reporter +
87-
# 2 commit nudges + issue-classify/issue-respond/followup). These already
88-
# exist in Secrets Manager from the prior vendored deployment.
8949
prompt_sm_prefix: deequ-bot
9050
secrets:
9151
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
@@ -94,11 +54,7 @@ jobs:
9454
KB_S3_BUCKET: ${{ secrets.KB_S3_BUCKET }}
9555
KB_S3_KEY: ${{ secrets.KB_S3_KEY }}
9656
BEDROCK_MODEL_ID: ${{ secrets.BEDROCK_MODEL_ID }}
97-
# Reporter/critic model IDs were repo VARIABLES in the vendored setup; a
98-
# var can feed a secret input, so reference them here. Both are optional:
99-
# if unset (empty), the engine's config falls back to its defaults —
100-
# reporter → Haiku, critic → the investigator model (Opus). Matches the
101-
# vendored bot's behavior; no functional change if either var is unset.
57+
# Repo variables (not secrets); empty falls back to engine defaults.
10258
BEDROCK_REPORTER_MODEL_ID: ${{ vars.BEDROCK_REPORTER_MODEL_ID }}
10359
BEDROCK_CRITIC_MODEL_ID: ${{ vars.BEDROCK_CRITIC_MODEL_ID }}
10460
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/update-kb.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches: [master]
66
paths-ignore:
77
- '.github/workflows/**'
8-
# The vendored bot code (src/scripts/issue_bot/, src/scripts/tests/) was
9-
# removed when this repo migrated to the shared Shadow engine, so those
10-
# path-ignores are gone. generate_kb.py stays — this workflow still runs it.
118
workflow_dispatch:
129

1310
jobs:

.shadow.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
# Shadow engine config for awslabs/deequ. Consumed by the reusable workflow
2-
# sudsali/shadow/.github/workflows/shadow-review.yml (see .github/workflows/issue-bot.yml).
1+
# Shadow engine config for awslabs/deequ.
32

43
codebase:
5-
src_dir: src/main/scala # deequ's Scala sources (was CODEBASE_SRC_DIR)
6-
file_ext: .scala # was CODEBASE_FILE_EXT
7-
test_dir: src/test/scala # Scala test tree
8-
language: scala # fences source snippets on the legacy issue-respond path
4+
src_dir: src/main/scala
5+
file_ext: .scala
6+
test_dir: src/test/scala
7+
language: scala
98

109
bot:
11-
# LOAD-BEARING: this renders the `<!-- deequ-bot:clean -->` marker that
12-
# auto-approve.yml greps for on clean PR reviews. Changing it silently breaks
13-
# auto-approval. Matches the marker the vendored bot emitted.
14-
name: deequ-bot
10+
name: deequ-bot # renders the <!-- deequ-bot:clean --> marker auto-approve.yml greps for
1511
escalate_label: needs-human
1612
max_replies: 2
1713
max_runs_per_hour: 20
1814

19-
# Per-stage models. Env/secrets (BEDROCK_MODEL_ID, BEDROCK_REPORTER_MODEL_ID,
20-
# BEDROCK_CRITIC_MODEL_ID) take precedence over these, so the caller workflow's
21-
# secret/var wiring wins; listed here as the documented defaults.
2215
models:
2316
investigator: us.anthropic.claude-opus-4-7
2417
critic: us.anthropic.claude-opus-4-7

0 commit comments

Comments
 (0)