Skip to content

Add list_apps_cdn_builds action#702

Open
iangmaia wants to merge 4 commits intotrunkfrom
iangmaia/add-list-apps-cdn-builds-action
Open

Add list_apps_cdn_builds action#702
iangmaia wants to merge 4 commits intotrunkfrom
iangmaia/add-list-apps-cdn-builds-action

Conversation

@iangmaia
Copy link
Contributor

@iangmaia iangmaia commented Mar 3, 2026

Fixes AINFRA-2102

Summary

Adds a new list_apps_cdn_builds Fastlane action that queries the WP REST API v2 to list builds on the Apps CDN. Supports server-side filtering by post_status (draft / publish) and version (via taxonomy term ID lookup). Returns an array of build metadata (post_id, title, status, version, visibility, platform, build_type).

Context

This enables Studio's publish_release lane to query the CDN directly for draft builds by version, then publish them — rather than embedding post IDs in the GitHub release body (which is fragile). See companion Studio PR for the consumer side.

Note: The v1.1 API returns 500 for a8c_cdn_build custom post types, which is why this action uses the WP v2 endpoint (/wp/v2/sites/{site_id}/a8c_cdn_build). Additionally, CDN posts with visibility: internal are completely hidden from all listing queries by the CDN plugin, so the draft/publish approach is used instead of internal/external visibility for gating builds before release.

Test plan

  • bundle exec rspec spec/list_apps_cdn_builds_spec.rb — 12 examples, 0 failures
  • bundle exec rubocop — no offenses on new files
  • Manual test: verified against the real CDN API that listing by post_status and version works correctly, including the full draft→publish roundtrip

🤖 Generated with Claude Code

…sibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iangmaia iangmaia self-assigned this Mar 3, 2026
@iangmaia iangmaia added the enhancement New feature or request label Mar 3, 2026
@iangmaia iangmaia requested a review from Copilot March 3, 2026 12:59
Copy link

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

Adds a new Fastlane action to query the WordPress.com REST API for Apps CDN build posts, enabling lanes (e.g., Studio release automation) to locate builds by visibility and version without relying on hard-coded post IDs.

Changes:

  • Introduced list_apps_cdn_builds action with server-side visibility filtering and client-side version filtering.
  • Added RSpec coverage for the new action behavior and error/validation paths.
  • Updated CHANGELOG.md to document the new action.

Reviewed changes

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

File Description
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/list_apps_cdn_builds.rb Implements the new list_apps_cdn_builds action and its parameter validation / API request logic.
spec/list_apps_cdn_builds_spec.rb Adds tests for listing behavior, filtering, error handling, and parameter validation.
CHANGELOG.md Documents the new action under Trunk → New Features.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Use values.first['name'] instead of keys.first for term parsing (more robust)
- Extract term_name helper to avoid long safe-navigation chains
- Remove after { WebMock.allow_net_connect! } that leaked into other specs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iangmaia iangmaia requested review from AliSoftware and mokagio March 3, 2026 18:45
The v1.1 API returns 500 for a8c_cdn_build custom post types.
Replaces visibility filter with post_status filter (draft/publish)
and adds server-side version filtering via taxonomy term ID lookup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants