-
Notifications
You must be signed in to change notification settings - Fork 9
[AINFRA-743] Update upload_build_to_apps_cdn
action with newly added API parameters
#651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AINFRA-743] Update upload_build_to_apps_cdn
action with newly added API parameters
#651
Conversation
For more compact code and better readability in individual tests
Moves the new ones closer to related parameters, and ensure we keep the ones that are about build metadata together and leave `error_on_duplicate` and `api_token` at the end.
Thanks for creating the PR! The code looks good to me. |
Sorry I should have added Testing Instructions to the PR description! You can test it on your client repo (Studio) by:
|
Awesome! Thanks for sharing the testing instructions. This entire Gemfile world is new to me. |
end | ||
), | ||
FastlaneCore::ConfigItem.new( | ||
key: :install_type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm these changes add the two new parameters install_type and sha required by Studio CI. I tested it on my Studio PR, Automattic/studio#1422, by following these testing steps:
- Update
Gemfile
diff --git a/Gemfile b/Gemfile
index 48ed42ea..58dff5f6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,8 +3,7 @@
source 'https://rubygems.org'
gem 'fastlane', '~> 2.212'
-gem 'fastlane-plugin-wpmreleasetoolkit', '~> 13.2'
-
+gem 'fastlane-plugin-wpmreleasetoolkit', git: 'https://github.com/wordpress-mobile/release-toolkit.git', branch: 'ainfra-743-update-release-toolkit-for-new-appscdn-parameters'
gem 'aws-sdk-cloudfront', '~> 1.87'
gem 'rubocop', '~> 1.42', require: false
- Run
bundle install
- Run
bundle exec fastlane action upload_build_to_apps_cdn
- Observe the new options in the details:
Click to reveal the options details
[✔] 🚀 +---------------------------------------------------------------------------------+ | Used plugins | +-----------------------------------+---------+-----------------------------------+ | Plugin | Version | Action | +-----------------------------------+---------+-----------------------------------+ | fastlane-plugin-wpmreleasetoolki | 13.2.0 | an_localize_libs, | | t | | an_update_metadata_source, | | | | an_validate_lib_strings, | | | | android_build_preflight, | | | | android_create_avd, | | | | android_create_xml_release_notes | | | | , | | | | android_current_branch_is_hotfix | | | | , | | | | android_download_file_by_version | | | | , android_download_translations, | | | | android_firebase_test, | | | | android_launch_emulator, | | | | android_send_app_size_metrics, | | | | android_shutdown_emulator, | | | | android_update_release_notes, | | | | buildkite_add_trigger_step, | | | | buildkite_annotate, | | | | buildkite_metadata, | | | | buildkite_pipeline_upload, | | | | buildkite_trigger_build, | | | | check_for_toolkit_updates, | | | | check_translation_progress, | | | | circleci_trigger_job, | | | | close_milestone, comment_on_pr, | | | | copy_branch_protection, | | | | create_github_release, | | | | create_new_milestone, | | | | create_release_backmerge_pull_re | | | | quest, | | | | extract_release_notes_for_versio | | | | n, find_previous_tag, | | | | firebase_login, | | | | get_prs_between_tags, | | | | gp_downloadmetadata, | | | | gp_update_metadata_source, | | | | openai_ask, promo_screenshots, | | | | prototype_build_details_comment, | | | | publish_github_release, | | | | remove_branch_protection, | | | | set_branch_protection, | | | | set_milestone_frozen_marker, | | | | update_assigned_milestone, | | | | upload_build_to_apps_cdn, | | | | upload_to_s3, | | | | configure_add_files_to_copy, | | | | configure_apply, | | | | configure_download, | | | | configure_setup, | | | | configure_update, | | | | configure_validate, | | | | add_development_certificates_to_ | | | | provisioning_profiles, | | | | add_devices_to_provisioning_prof | | | | iles, ios_build_preflight, | | | | ios_check_beta_deps, | | | | ios_download_strings_files_from_ | | | | glotpress, | | | | ios_extract_keys_from_strings_fi | | | | les, | | | | ios_generate_strings_file_from_c | | | | ode, ios_get_store_app_sizes, | | | | ios_lint_localizations, | | | | ios_merge_strings_files, | | | | ios_send_app_size_metrics, | | | | ios_update_metadata_source, | | | | ios_update_release_notes | +-----------------------------------+---------+-----------------------------------+
Loading documentation for upload_build_to_apps_cdn:
+---------------------------------------------------------------------------------------+
| upload_build_to_apps_cdn |
+---------------------------------------------------------------------------------------+
| Uploads a build binary to the Apps CDN |
| |
| Uploads a build binary file to a WordPress blog that has the Apps CDN plugin enabled. |
| See PCYsg-15tP-p2 internal a8c documentation for details about the Apps CDN plugin. |
| |
| Created by Automattic |
+---------------------------------------------------------------------------------------++--------------------------------------------------------------------------------------+
| upload_build_to_apps_cdn Options |
+------------------------+--------------------------+-------------------+--------------+
| Key | Description | Env Var(s) | Default |
+------------------------+--------------------------+-------------------+--------------+
| site_id | The WordPress.com CDN | APPS_CDN_SITE_ID | |
| | site ID to upload the | | |
| | media to | | |
| product | The product the build | APPS_CDN_PRODUCT | |
| | belongs to (e.g. | | |
| | 'WordPress.com Studio') | | |
| platform | The platform the build | APPS_CDN_PLATFORM | |
| | runs on. One of: | | |
| | Android, iOS, Mac - | | |
| | Silicon, Mac - Intel, | | |
| | Mac - Any, Windows | | |
| file_path | The path to the build | | |
| | file to upload | | |
| build_type | The type of the build. | | |
| | One of: Alpha, Beta, | | |
| | Nightly, Production, | | |
| | Prototype | | |
| install_type | The install type for | | Full Install |
| | the build. One of: Full | | |
| | Install, Update | | |
| visibility | The visibility of the | | |
| | build (:internal or | | |
| | :external) | | |
| post_status | The post status | | publish |
| | (defaults to 'publish') | | |
| version | The version string for | | |
| | the build (e.g. '20.0', | | |
| | '17.8.1') | | |
| build_number | The build number for | | |
| | the build (e.g. '42') | | |
| minimum_system_version | The minimum version for | | |
| | the provided platform | | |
| | (e.g. '13.0' for macOS | | |
| | Ventura) | | |
| release_notes | The release notes to | | |
| | show with the build on | | |
| | the blog frontend | | |
| sha | A string representing | | |
| | the release, e.g. the | | |
| | most recent commit | | |
| | hash, cryptographic | | |
| | token, etc | | |
| error_on_duplicate | If true, the action | | false |
| | will error if a build | | |
| | matching the same | | |
| | metadata already | | |
| | exists. If false, any | | |
| | potential existing | | |
| | build matching the same | | |
| | metadata will be | | |
| | updated to replace the | | |
| | build with the new file | | |
| api_token | The WordPress.com API | WPCOM_API_TOKEN | |
| | token for | | |
| | authentication | | |
+------------------------+--------------------------+-------------------+--------------+
- = default value is dependent on the user's system
+-----------------------------------------------------------------------------------+
| upload_build_to_apps_cdn Output Variables |
+----------------------------+------------------------------------------------------+
| Key | Description |
+----------------------------+------------------------------------------------------+
| APPS_CDN_UPLOADED_FILE_URL | The URL of the uploaded file |
| APPS_CDN_UPLOADED_FILE_ID | The ID of the uploaded file |
| APPS_CDN_UPLOADED_POST_ID | The ID of the post / page created for the uploaded |
| | build |
| APPS_CDN_UPLOADED_POST_URL | The URL of the post / page created for the uploaded |
| | build |
+----------------------------+------------------------------------------------------+
Access the output values usinglane_context[SharedValues::VARIABLE_NAME]
+--------------------------------------------------------------------------------------------------------------+
| upload_build_to_apps_cdn Return Value |
+--------------------------------------------------------------------------------------------------------------+
| Returns a Hash containing the upload result: { post_id:, post_url:, media_id:, media_url:, mime_type: }. On |
| error, raises a FastlaneError. |
+--------------------------------------------------------------------------------------------------------------+More information can be found on https://docs.fastlane.tools/actions/upload_build_to_apps_cdn
[!IMPORTANT]
If your app relies on managed capabilities (previously referred to as custom entitlements or thetemplate_name
parameter in match), you are impacted by a change that Apple made to their APIs in the last 2 weeks.
Please check out the ongoing discussion at fastlane/fastlane#29609 for the latest updates. Your insights and contributions are welcome!
Please update using
bundle update fastlane
Thanks for the changes! 🙌
Thanks for confirming @sejas ! I have now released an official version gem 'fastlane-plugin-wpmreleasetoolkit', '~> 13.3' |
What does it do?
Update
upload_build_to_apps_cdn
action with newly-addedinstall_type
andsha
API parameters.Context: p1749744798120189/1742566597.679029-slack-CC7L49W13
Closes AINFRA-743
Testing
Gemfile
of your client repo (e.g. WPStudio) to make the dependency line for the release toolkit point to the branch directly instead of a version:bundle install
in your client repo to resolve the dependenciesFastfile
that uses that action to add theinstall_type
andsha
parameters to the action callbundle exec fastlane <lanename>
command as usual to test running that lane with the new parameters and action version.Checklist before requesting a review
bundle exec rubocop
to test for code style violations and recommendations.specs/*_spec.rb
) if applicable.bundle exec rspec
to run the whole test suite and ensure all your tests pass.CHANGELOG.md
file to describe your changes under the appropriate existing###
subsection of the existing## Trunk
section.If applicable, add an entry in theMIGRATION.md
file to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider.