-
Notifications
You must be signed in to change notification settings - Fork 8
Add prototype_build_details_comment action
#449
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
Conversation
Useful for APK files for example. PS: be mindful that providing a public link accessible without any access control (e.g. from a cloudfront public API or similar) means users outside Automattic might be able to download the APK even if they are not invited to App Center. Up to you to decide if that is ok or not when you choose to use this parameter.
mokagio
left a comment
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.
Thank you for this. It's a great DRY improvement. Leverage++
None of my comments are blockers but I think it would be nice to integrate this in a real repo as a test before merging. That work wouldn't be wasted, as could be updated into a PR to integrate the stable version of these changes once released.
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb
Outdated
Show resolved
Hide resolved
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb
Outdated
Show resolved
Hide resolved
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb
Outdated
Show resolved
Hide resolved
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb
Outdated
Show resolved
Hide resolved
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb
Outdated
Show resolved
Hide resolved
Yep, that has actually already been started… but on one of the Tumblr repo in our GH:E instance https://github.tumblr.net/TumblrMobile/orangina/pull/23867 🙃 |
|
Testing by starting to use it in a Draft PR in WPiOS: wordpress-mobile/WordPress-iOS#20071 |
Of course 🤦♂️ I didn't put the two things together, should have expected it. Still, thank you for opening a test PR in the WordPress iOS repo as well. Hash-tag working in public, I guess? 🤷♂️ 😅 |
Especially, leaving the commit bare without <code> tag will allow GitHub to automatically transform it into a link to the commit itself
f8f7640 to
bab7d66
Compare
|
Currently in testing in the following repos to tweak the latest adjustments needed:
TODO:
|
From values provided in the `lane_context` by the `appcenter_upload` action – if it was used to distribute the Prototype build
bab7d66 to
1d99383
Compare
|
Whooops, @mokagio I just saw that I re-requested your review on this PR by accident, while it's not yet ready to re-review (API have been confirmed to be a good fit for client apps, but tests haven't yet been updated with the new API yet nor expanded with all additional use cases… still working on that). And I'm not sure I can cancel a request for re-review on GitHub 🤔 |
There are still more tests that I want to add, and I need to proof-read the ones that I wrote in this commit to ensure I didn't miss cases of adjusting the test content after copy/pasting code from various tests around.
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb
Show resolved
Hide resolved
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb
Show resolved
Hide resolved
|
No worries @AliSoftware . |
|
@mokagio The PR is now ready for final review again 🙂 . Lots of small refactorings and lots of additional unit tests since your last review 😉 |
| FastlaneCore::ConfigItem.new( | ||
| key: :app_center_org_name, | ||
| env_name: 'APPCENTER_OWNER_NAME', # Intentionally the same as the one used by the `appcenter_upload` action | ||
| description: 'The name of the organization in App Center (if you used `appcenter_upload` to distribute your Prototype build)', |
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.
| description: 'The name of the organization in App Center (if you used `appcenter_upload` to distribute your Prototype build)', | |
| description: 'The name of the organization in App Center #{app_center_auto}', |
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.
Nope, in this case it was intentional not to use {app_center_auto} (aka "(will be automatically extracted from lane_context if you used appcenter_upload` to distribute your Prototype build)"), because that's not the case for this property.
In fact, the app_center_org_name is the only value that you have to provide explicitly if you want the action to use App Center.
- Not only is this value not exposed in the
lane_contextfilled byappcenter_upload, unlike all the other properties (the App Center API response includes the app name, but not the app org… who knows why), so this is NOT extracted fromlane_contexthere - But also, I figured this was a great thing to have a way to tell the action to NOT assume that because
appcenter_uploadwas used that means we want to use itslane_contextimplicitly (without any way of disabling that) for the comment generation.- For example, imagine a case where a fastlane lane (1) creates a beta build and uploads it App Center via
appcenter_upload(2) and then creates a Prototype Build, which they do NOT upload to App Center but instead to S3. We don't want theprototype_build_details_commentlane to pick up thelane_contextfrom theappcenter_uploadcall from (1) while we didn't use App Center for (2). - So in the end I decided to consider this fact of "
app_center_org_namenot being exposed in thelane_context" as a positive rather than a negative, as it allows you too use it as a signaling flag of it you want the action to consider you used App Center or not (instead not having a way to disable thelane_contextinference) 🤷
- For example, imagine a case where a fastlane lane (1) creates a beta build and uploads it App Center via
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/prototype_build_details_comment_action.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Gio Lodi <[email protected]>
What does it do?
Many of our client apps are configured to generate a Prototype Build (aka Installable Build), then make a comment on the PR with a QR code and some additional info to download the build directly from App Center.
Since the HTML content of those comments are a bit annoying and verbose to hardcode directly in the Fastfile of each of our apps, while they all look the same, I've decided to DRY the generation of this content in a dedicated action that generates a nice HTML table (with the QR code + some metadata) for us, ensuring we use the same nice format in all our client apps.
Checklist before requesting a review
bundle exec rubocopto test for code style violations and recommendationsspecs/*_spec.rb) if applicablebundle exec rspecto run the whole test suite and ensure all your tests passCHANGELOG.mdfile to describe your changes under the approprioate existing###subsection of the existing## Trunksection.