Skip to content

Fix module cleanup workflow#18658

Merged
trask merged 13 commits into
open-telemetry:mainfrom
trask:fix-module-cleanup-dispatch-token
May 10, 2026
Merged

Fix module cleanup workflow#18658
trask merged 13 commits into
open-telemetry:mainfrom
trask:fix-module-cleanup-dispatch-token

Conversation

@trask
Copy link
Copy Markdown
Member

@trask trask commented May 9, 2026

Several fixes to the module cleanup workflow:

  • Split finalization and self-dispatch tokens (the original change): finalize uses the app token so the PR runs workflows; self-dispatch uses the default GitHub Actions token.
  • Stop checking out / fetching shallowly in the finalize job. With fetch-depth: 1 plus git fetch origin main --depth=1, origin/main was grafted, so origin/main..origin/module-cleanup-wip log/diff included main's own ancestors that happened to be reachable from wip's recently-fetched history. That made the batch PR title and "Modules in this batch" section list ~50 merged-main PRs instead of the actual cleanup commits, and (because the dispatch step scraped those backticked lines from open module-cleanup PR bodies into the "already processed" set) it poisoned the queue, dropped queue_remaining to 0, and triggered the queue-exhausted flush branch — bypassing the 10-file FLUSH_THRESHOLD. See Module cleanup: batch of modules (run 25590902041) #18654 for the resulting bad PR.
  • Drop the inflight-PR-body parser from the dispatch step entirely. processed.txt on the memory branch is now the sole source of truth for the "already processed" set, with inflight modules derived from cleanup commit subjects on the wip branch — so a malformed PR body can no longer poison the processed set.
  • Rename the wip branch to otelbot/module-cleanup-wip to match other otelbot-owned branches.
  • Update the AWF sandbox comments to point to Sandboxed Copilot workflows should set responses wire API for GPT-5 models in BYOK/offline mode github/gh-aw#31241.

@trask trask force-pushed the fix-module-cleanup-dispatch-token branch from 9cf953a to a33fa02 Compare May 9, 2026 16:48
@trask trask marked this pull request as ready for review May 9, 2026 16:51
@trask trask requested a review from a team as a code owner May 9, 2026 16:51
@trask trask marked this pull request as draft May 9, 2026 16:52
@trask trask changed the title Split module cleanup workflow dispatch token Fix module cleanup workflow May 9, 2026
@trask trask marked this pull request as ready for review May 9, 2026 17:53
@trask trask requested a review from Copilot May 9, 2026 20:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes reliability issues in the automated module-cleanup workflow by separating credentials for PR creation vs workflow self-dispatch, eliminating shallow-history pitfalls in the finalize job, and hardening how inflight PR bodies are parsed to compute the “already processed” set.

Changes:

  • Split tokens so PR creation/push uses the GitHub App token (to ensure downstream workflows run), while workflow self-dispatch uses the default GITHUB_TOKEN.
  • Stop using shallow history in finalize (checkout fetch-depth: 0; remove depth-limited git fetch in finalize.sh) to prevent incorrect origin/main..origin/module-cleanup-wip ranges.
  • Restrict inflight PR parsing to the ## Modules in this batch section terminated by --- to reduce the chance of processed-set poisoning from unrelated backticked lines.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/module-cleanup.md Updates module-cleanup workflow logic: token split, full-history checkout in finalize, and tighter inflight PR body parsing.
.github/workflows/module-cleanup.lock.yml Regenerated locked workflow reflecting the same functional changes (token split, full-history checkout, parsing hardening).
.github/scripts/module-cleanup/finalize.sh Removes self-dispatch, avoids depth-limited fetches, and relies on full repo history for accurate diff/log computation.

Comment thread .github/workflows/module-cleanup.md Outdated
Comment thread .github/workflows/module-cleanup.lock.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread .github/scripts/module-cleanup/finalize.sh Outdated
Comment thread .github/workflows/module-cleanup.md Outdated
Comment thread .github/workflows/module-cleanup.lock.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/module-cleanup.md
Comment thread .github/scripts/module-cleanup/finalize.sh Outdated
@trask trask requested a review from Copilot May 9, 2026 21:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread .github/scripts/module-cleanup/build-cleanup-matrix.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@trask trask merged commit 80d48c8 into open-telemetry:main May 10, 2026
101 checks passed
@trask trask deleted the fix-module-cleanup-dispatch-token branch May 10, 2026 17:53
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.

4 participants