Skip to content

ci(github): prune stale nightly APKs from FTP latest folder after upload#11063

Merged
coreycb merged 2 commits into
thunderbird:mainfrom
kryoseu:main
Jun 1, 2026
Merged

ci(github): prune stale nightly APKs from FTP latest folder after upload#11063
coreycb merged 2 commits into
thunderbird:mainfrom
kryoseu:main

Conversation

@kryoseu
Copy link
Copy Markdown
Member

@kryoseu kryoseu commented May 28, 2026

Contribution Summary

Linked Issue/Ticket: N/A

Description

Currently, the nightly latest FTP is keeping both latest and previous builds, whereas we want to keep latest only.

This adds a post-upload cleanup step that removes old files from the nightly latest FTP destination, keeping only the current APK and tar — preventing accumulation of stale builds.

I have tested the proposed gcloud command against my own bucket:

  • Copied 4 files into the bucket:
❯ gcloud storage cp thunderbird-2* gs://test-bucket-ebaginski
Copying file://thunderbird-20-0a1.apk to gs://test-bucket-ebaginski/thunderbird-20-0a1.apk
Copying file://thunderbird-20-0a1.tar.gz to gs://test-bucket-ebaginski/thunderbird-20-0a1.tar.gz
Copying file://thunderbird-21-0a1.apk to gs://test-bucket-ebaginski/thunderbird-21-0a1.apk
Copying file://thunderbird-21-0a1.tar.gz to gs://test-bucket-ebaginski/thunderbird-21-0a1.tar.gz
  • Prune stale ones:
❯ FTP_DESTINATION_NIGHTLY_LATEST=test-bucket-ebaginski
❯ PKG_FILE=thunderbird-21-0a1.apk
❯ FTP_TAR_FILENAME=thunderbird-21-0a1.tar.gz
❯ gcloud storage ls "gs://${FTP_DESTINATION_NIGHTLY_LATEST}/" \
            | grep -vF "${PKG_FILE}" \
            | grep -vF "${FTP_TAR_FILENAME}" \
            | xargs -r gcloud storage rm

Removing objects:

Removing gs://test-bucket-ebaginski/thunderbird-20-0a1.apk...
Removing gs://test-bucket-ebaginski/thunderbird-20-0a1.tar.gz...
  • Result:
❯ gcloud storage ls "gs://${FTP_DESTINATION_NIGHTLY_LATEST}/"
gs://test-bucket-ebaginski/thunderbird-21-0a1.apk
gs://test-bucket-ebaginski/thunderbird-21-0a1.tar.gz

AI Disclosure

Select one of the following (mandatory)

  • This contribution does not include any changes created or assisted by AI.
  • This contribution includes changes assisted by AI.
  • This contribution includes changes created by AI.

Contribution Checklist

  • I have read and affirm that my contribution adheres to Mozilla’s Community Participation Guidelines
  • This contribution is in Kotlin where possible
  • This contribution does not use merge commits
  • This contribution adheres to the existing codestyle (run gradlew spotlessCheck to check and gradlew spotlessApply to format your source code; will be checked by CI).
  • This contribution does not break existing unit tests (run gradlew testDebugUnitTest; will be checked by CI).
  • This contribution includes tests for any new functionality, and maintains tests for any updated functionality.
  • This PR has a descriptive title and body that accurately outlines all changes made, and contains a reference to any issues that it fixes (e.g. Closes #XXX or Fixes #XXX).

This adds a post-upload cleanup step that removes old files from the nightly latest FTP destination, keeping only the current APK and tar — preventing accumulation of stale builds.
@kryoseu kryoseu requested a review from a team as a code owner May 28, 2026 18:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Validation Passed: All report and feature-flag labels are correctly set.

@rafaeltonholo rafaeltonholo added the report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). label May 28, 2026
Comment thread .github/workflows/shippable_builds.yml
Comment thread .github/workflows/shippable_builds.yml
Copy link
Copy Markdown
Collaborator

@coreycb coreycb left a comment

Choose a reason for hiding this comment

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

This is great. Thanks for the fix. It mostly looks good. I add a couple of comments inline.

@coreycb coreycb merged commit 147b11d into thunderbird:main Jun 1, 2026
16 checks passed
@thunderbird-botmobile thunderbird-botmobile Bot added this to the Thunderbird 21 milestone Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants