Skip to content

Commit 0a4a99b

Browse files
committed
Derive inflight modules from commit subjects, drop hidden markers
1 parent d872f62 commit 0a4a99b

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/scripts/module-cleanup/finalize.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,13 @@ if [ "$SHOULD_FLUSH" = "true" ]; then
170170

171171
MODULE_COUNT=$(git -C "$WIP_WT" rev-list --count "origin/main..origin/$WIP_BRANCH")
172172

173+
# The dispatch job derives the inflight-module list from commit subjects
174+
# on open module-cleanup PR branches ("Cleanup for <module>"), so no
175+
# hidden marker block is needed here.
173176
BODY_FILE=$(mktemp)
174177
{
175178
echo "Automated module-cleanup batch."
176179
echo
177-
git -C "$WIP_WT" log "origin/main..origin/$WIP_BRANCH" \
178-
--reverse --format='<!-- module-cleanup-module: %s -->' \
179-
| sed 's|: Cleanup for |: |'
180-
echo
181180
echo "## Modules in this batch"
182181
echo
183182
git -C "$WIP_WT" log "origin/main..origin/$WIP_BRANCH" \

.github/workflows/module-cleanup.lock.yml

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/module-cleanup.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,15 @@ jobs:
127127
if git fetch origin "$MEMORY_BRANCH" --depth=1 2>/dev/null; then
128128
processed=$(git show "origin/$MEMORY_BRANCH:processed.txt" 2>/dev/null || true)
129129
fi
130-
# Also exclude shorts already in inflight module-cleanup PRs. The
131-
# finalize script emits one hidden marker per module in the PR body.
130+
# Also exclude shorts already in inflight module-cleanup PRs.
131+
# Each module corresponds to one commit on the PR branch with subject
132+
# "Cleanup for <module>", so commit subjects are the source of truth.
132133
# Once a PR merges, those shorts also exist in processed.txt so they
133134
# won't be re-picked.
134135
inflight=$(gh pr list --repo "$GITHUB_REPOSITORY" \
135136
--label "module cleanup" --state open \
136-
--json body --jq '.[] | (.body // "") | split("\n")[]' \
137-
| sed -n 's/^<!-- module-cleanup-module: \(.*\) -->$/\1/p' || true)
137+
--json commits --jq '.[].commits[].messageHeadline' \
138+
| sed -n 's/^Cleanup for //p' || true)
138139
export REVIEW_PROGRESS="$(printf '%s\n%s\n' "$processed" "$inflight" \
139140
| grep -v '^$' | sort -u)"
140141
python .github/scripts/module-cleanup/build-cleanup-matrix.py

0 commit comments

Comments
 (0)