Introduce monkey-patch to auto-insert collapsible sections in Buildkite logs #638
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This PR introduces a monkey-patch of the
Fastlane::Runner#execute_actionmethod to print a~~~ :fastlane: [lane :#{lane_name}] #{action}collapsible group log output for every action called in yourFastfile.Note
This idea was inspired by https://github.com/wordpress-mobile/WordPress-iOS/blob/trunk/fastlane/Fastfile#L156-L179
This will make the Buildkite logs for jobs running fastlane lanes better organized and easier to navigate, as each action will now have its own collapsible section.
Testing
I have created some dummy branches in
Tumblr-iOSandWordPress-iOS, making theirGemfilepoint to this PR's branch of therelease-toolkitthen triggering a Buildkite buildTumblr iOS
Buildkite build: https://buildkite.com/automattic/tumblr-ios/builds/32406
WordPress iOS
Buildkite build: https://buildkite.com/automattic/wordpress-ios/builds/26131
Compare Buildkite output from before that monkey-patch—but with the ad-hoc patch that has been in WPiOS's Fastfile since a while—with new Buildkite output from the monkey-patch (and with ad-hoc patch in WPiOS's Fastfile removed
What's Next
Once this PR lands, we should remove the ad-hoc patch code that was implemented in WPiOS's
Fastfile, to use this patch fromrelease-toolkitinstead, to avoid WPiOS having double logging of the collapsible group sections in Buildkite.