[Tooling] Upload CDN builds as drafts, publish in publish_release#2695
[Tooling] Upload CDN builds as drafts, publish in publish_release#2695
Conversation
…ish_release Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e74bec3 to
921742d
Compare
There was a problem hiding this comment.
Pull request overview
Updates the release automation to upload Apps CDN artifacts as Internal first (for an internal testing window), and then flips them to External as part of publish_release before the GitHub release is published.
Changes:
- Change Apps CDN uploads to use Internal visibility by default.
- Add
make_cdn_builds_publichelper to find internal builds for a release version and update them to External visibility. - Update release lane prompts and call
make_cdn_builds_publicduringpublish_release.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
If publish_release is rerun after a partial failure, the builds may already be external. Warn and continue instead of erroring out. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Converted to draft until the release-toolkit PRs aren't merged and we can use a new version with both actions. |
… visibility Upload release builds as external+draft, then publish them in publish_release. The CDN plugin hides internal-visibility posts from all API queries, making the previous internal→external approach unworkable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
What is the consequence of uploading a build to AppsCDN as "Draft", in terms of testability? Maybe it'd be better to adjust the CDN plugin design to allow
|
| install_type: build[:install_type], | ||
| visibility: 'external', | ||
| visibility: :external, | ||
| post_status: release_tag&.match?(/beta/i) ? nil : 'draft', |
There was a problem hiding this comment.
I'm not sure the condition is right here?
This means that the first beta post code freeze as well as the intermediate betas that occur in the middle of the release will be uploaded as draft (and then never published). While those should probably be internal instead.
That also means that the final build we do at the end of the release process, the one that drops the beta suffix because it's supposed to be the final version, will not match the /beta/i RegEx, and thus will be uploaded as non-draft. While it's exactly not what we want.
Also, based on the code at the start of this lane, there also exists "Nightly Builds"—for which release_tag is nil, which means means this will publish those as non-draft as well.
I think instead we should:
- For
build_typeof bothNightlyandBeta, usevisibility: :internalbutpost_status: 'publish', so that they are published but only internally - For
build_type == 'Productionbuilds, especially the final build done at the end of the release scenario, usevisibility: :externalbutpost_status: 'draft'… until we get to the next stage in the Release Scenario to publish it once it has been smoke-tested.
| # Update CDN build visibility from Internal to External | ||
| make_cdn_builds_public(version: version) |
There was a problem hiding this comment.
This is not consistent with what it currently does, which is not about making it public and changing it from internal to external, but about changing it from draft to published…
Of course this might change back depending of if using the Draft state was indeed the right move (i.e. if it still allows this build to be easily downloadable and testable by the team and RM for smoke-testing) or if we're gonna switch back to using internal vs external.
| release_version = "v#{version}" | ||
| builds = list_apps_cdn_builds( | ||
| site_id: WPCOM_STUDIO_SITE_ID, | ||
| version: release_version, | ||
| post_status: 'draft' | ||
| ) |
There was a problem hiding this comment.
Is there a risk—especially in the rare case that issues was found in a final release build and the team decides to make a new commit on the release/ branch then re-upload a new final build—that there would be more than one build with version v#{version} in the CDN for each platform, and that we'd then end up publishing all of them (the bad one as well as the subsequent one with the fix) instead of only the last one?
Tbh I'm not sure this is a case the current setup fully support yet anyway.
- e.g. what happens to the version bump logic if you
finalize_releaseonce, which removes the-betaNsuffix from the version, then find an issue and redo anotherfinalize_release, would the logic that removes the-betaNbe a no-op on the version already beingX.Y.Z? Will it crash? - What about the AppsCDN side of things, is the CDN plugin ok with uploading a build with the same metadata (version, platform…) twice? Does it replace the old one with the new one in that case, or keep both entries (which is where your
list_apps_cdn_buildscall would return duplicates)
Maybe it's only a concern for a future iteration though. But I figured I'd still raise the question, including in case this informs our thoughts about using visibility: :internal and not using list_apps_cdn_builds but storing the post_id values at initial upload time somewhere instead.
Related issues
update_apps_cdn_build_metadataaction)list_apps_cdn_buildsaction)How AI was used in this PR
Claude Code was used to implement the Fastfile changes based on a detailed plan I designed. I reviewed all generated code.
Proposed Changes
post_status: 'draft')make_cdn_builds_publichelper that queries the CDN API vialist_apps_cdn_buildsto find draft builds for the release version, then publishes each viaupdate_apps_cdn_build_metadatamake_cdn_builds_publicinpublish_releasebefore publishing the GitHub releasefinalize_releaseprompt to mention the new draft behaviorWhy drafts instead of internal visibility?
Integration testing against the real CDN API revealed that posts with
visibility: internalare completely hidden from all listing queries (by CDN plugin design), making it impossible to find and flip them later. The draft/publish approach works reliably and is idempotent — re-running when no drafts exist is a safe no-op.Testing Instructions
Pre-merge Checklist
🤖 Generated with Claude Code