GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [ci] Add workflow to clean up stale pull request reports by adangel · Pull Request #7371 · pmd/pmd

Conversation

@adangel

@adangel adangel commented Nov 19, 2026

Copy link
Copy Markdown
Member

Describe the PR

Adds a new GitHub Actions workflow, "Cleanup Pull Request Reports" (.github/workflows/cleanup-pull-requests.yml). It removes stale documentation previews and regression tester reports from the S3 bucket pmd-pull-requests. We have many PRs, and this keeps the reports from taking up more and more space.

How it works

  • Runs weekly (Sunday, 03:17 UTC) and can also be run manually. Manual runs have two inputs:
    • dry-run: only lists the stale reports, deletes nothing
    • retention-days: default 14
  • Before: lists the whole bucket once with the aws CLI and writes the number of objects, total size and number of pr-* folders to the job summary.
  • Cleanup:
    • For every pr-<N>/ folder, it queries the PR state with the GitHub GraphQL API, up to 100 PRs per request.
    • If a PR was closed or merged more than 14 days ago, the whole pr-<N>/ folder is deleted (docs and regression reports for all SHAs).
    • Open PRs are not touched. PRs whose state can't be determined are skipped with a warning.
    • If the GraphQL query fails completely, the step aborts before deleting anything.
    • The removed reports are listed in the job summary with PR link, title, merged or closed, close date, number of objects and size.
  • After: lists the bucket again and shows before, after and the difference.
  • Because it checks every folder in the bucket, it also removes reports that an earlier run missed.

Documentation

docs/pages/pmd/devdocs/github_actions_workflows.md:

  • New section about the workflow, including the AWS S3 permissions it needs (s3:ListBucket and s3:DeleteObject). The existing access key already has both, so no new secrets are needed.
  • The S3 lifecycle rule is now documented as a fallback that deletes files after 120 days (before: 60 days), in case the cleanup workflow doesn't run.

Note

The first real run should be a manual run with dry-run: true after merging.

Related issues

  • n/a

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@adangel @claude
[ci] Add workflow to clean up stale pull request reports
1f18798
The new workflow "Cleanup Pull Request Reports" removes the folders
pr-<N>/ (docs preview and regression tester reports) from the S3 bucket
pmd-pull-requests once the pull request has been closed or merged for
more than 14 days. Open pull requests are not touched.

It runs weekly and can be run manually (with inputs dry-run and
retention-days). The PR states are queried in batches of 100 via
GraphQL. Bucket usage before and after the cleanup and the removed
reports are written to the job summary.

The documentation describes the new workflow, the needed AWS S3
permissions, and the S3 lifecycle rule (120 days) as fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@adangel adangel added this to the 7.30.0 milestone Nov 19, 2026
@pmd-actions-helper

pmd-actions-helper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

No relevant source code has been changed, pmdtester skipped.

(comment created at 2026-11-19 15:01:35+00:00 for 1f18798)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adangel adangel added the github_actions Pull requests that update Github_actions code label Nov 19, 2026
zbynek
zbynek approved these changes Nov 24, 2026
View reviewed changes
@zbynek
zbynek merged commit fb5a28c into pmd:main Nov 24, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@adangel
adangel deleted the ci/pr-regression-tester-cleanup branch November 26, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@zbynek zbynek zbynek approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

github_actions Pull requests that update Github_actions code

Projects

None yet

Milestone

7.30.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@adangel @zbynek
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.