Skip to content

feat(maintenance): report stale remote branches weekly - #55

Open
sajor2000 wants to merge 2 commits into
mainfrom
codex/weekly-branch-maintenance
Open

feat(maintenance): report stale remote branches weekly#55
sajor2000 wants to merge 2 commits into
mainfrom
codex/weekly-branch-maintenance

Conversation

@sajor2000

Copy link
Copy Markdown
Owner

Summary

Adds a weekly, read-only GitHub Actions report for remote branches that need human review before cleanup. The workflow has manual dispatch, scoped read permissions, no deletion commands, and a Bun reporter with deterministic coverage for candidate classification and API pagination.

Validation

  • bun test v1.3.14 (0d9b296a)
    Backed up existing MCPorter config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/pi-backup-zM8sBB/.pi/ce-datascience/mcporter.json.bak.2026-08-19T17-25-06-395Z
    Backed up existing settings.json to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/gemini-backup-wRVwUa/.gemini/settings.json.bak.2026-08-19T17-25-09-399Z
    Backed up existing settings.json to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/gemini-merge-NMWtOk/.gemini/settings.json.bak.2026-08-19T17-25-09-400Z
    Backed up existing mcp.json to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/kiro-backup-r3zHCq/.kiro/settings/mcp.json.bak.2026-08-19T17-25-10-571Z
    Backed up existing mcp.json to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/kiro-merge-NpD6RU/.kiro/settings/mcp.json.bak.2026-08-19T17-25-10-573Z
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-backup-3go8hK/.opencode/opencode.json.bak.2026-08-19T17-25-10-651Z
    Merged plugin config into existing opencode.json (user settings preserved)
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-merge-mcp-R7IHBR/.opencode/opencode.json.bak.2026-08-19T17-25-10-652Z
    Merged plugin config into existing opencode.json (user settings preserved)
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-preserve-v14zg7/.opencode/opencode.json.bak.2026-08-19T17-25-10-653Z
    Merged plugin config into existing opencode.json (user settings preserved)
    Backed up existing command file to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-cmd-backup-nghmzv/.opencode/commands/my-cmd.md.bak.2026-08-19T17-25-10-660Z
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-managed-cleanup-krXgCV/.opencode/opencode.json.bak.2026-08-19T17-25-10-666Z
    Merged plugin config into existing opencode.json (user settings preserved)
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-multi-plugin-fr9af9/.opencode/opencode.json.bak.2026-08-19T17-25-10-674Z
    Merged plugin config into existing opencode.json (user settings preserved)
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-multi-plugin-fr9af9/.opencode/opencode.json.bak.2026-08-19T17-25-10-676Z
    Merged plugin config into existing opencode.json (user settings preserved)
    Backed up existing hooks to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-hooks-malformed-i7lUqg/.codex/hooks.json.bak.2026-08-19T17-25-15-405Z
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-backup-2wTkNR/.codex/config.toml.bak.2026-08-19T17-25-15-520Z
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-idempotent-BlSKJ9/.codex/config.toml.bak.2026-08-19T17-25-15-521Z
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-idempotent-BlSKJ9/.codex/config.toml.bak.2026-08-19T17-25-15-522Z
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-migrate-nouq0B/.codex/config.toml.bak.2026-08-19T17-25-15-524Z
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-unmarked-x6r66j/.codex/config.toml.bak.2026-08-19T17-25-15-525Z
    Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-stale-QSoyHN/.codex/config.toml.bak.2026-08-19T17-25-15-526Z (1,102 passed, 1 skipped)
  • Release metadata is in sync. ce-datascience currently has 55 agents, 76 skills, and 0 MCP servers.
  • Read-only live reporter smoke test against this repository

@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a read-only weekly GitHub Actions report that identifies remote branches requiring human review before cleanup.

  • Adds scheduled and manual workflow triggers with read-only permissions and commit-pinned actions.
  • Adds a Bun reporter that paginates GitHub API results and classifies branches using protection, open-PR, merge, and head-SHA evidence.
  • Adds deterministic reporter and workflow tests plus documentation for the manual cleanup handoff.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; both previously reported issues are resolved in the current code.

Important Files Changed

Filename Overview
scripts/maintenance/report-branch-candidates.ts Implements complete API pagination, branch classification, report rendering, and diagnostic failure output; the prior matching-merge issue is fixed.
.github/workflows/branch-maintenance.yml Adds weekly and manual read-only reporting with both third-party actions pinned to immutable commit SHAs.
tests/branch-maintenance-report.test.ts Covers matching merged evidence despite a newer unmerged PR, exclusions, no-candidate rendering, pagination, and malformed responses.
tests/branch-maintenance-workflow.test.ts Verifies triggers, read-only permissions, immutable checkout pinning, and absence of common mutation commands.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Weekly schedule or manual dispatch] --> B[Read-only GitHub Actions job]
  B --> C[Bun branch reporter]
  C --> D[Fetch repository metadata and all branch pages]
  D --> E[Fetch open and closed PRs per eligible branch]
  E --> F{Default, protected, or open PR?}
  F -->|Yes| G[Record exclusion]
  F -->|No| H{Merged PR head matches current branch SHA?}
  H -->|Yes| I[Record cleanup candidate]
  H -->|No| G
  I --> J[Publish job summary]
  G --> J
Loading

Reviews (2): Last reviewed commit: "fix(maintenance): retain matching merge ..." | Re-trigger Greptile

Comment thread scripts/maintenance/report-branch-candidates.ts Outdated
Comment thread .github/workflows/branch-maintenance.yml Outdated
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.

1 participant