-
Notifications
You must be signed in to change notification settings - Fork 135
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
RUMM-1667 Enhance release automation #636
RUMM-1667 Enhance release automation #636
Conversation
This tool is safer (it always starts with a clean repo state instead of resetting altered state) and more flexible (both GH and CP artifacts can be published for any tag in the repo, not only for the current tag).
One for GH Release assset and one for Cocoapods specs.
Remove parts of the release automation replaced with `release.py` and additions to `bitrise.yml`.
shell(f'pod spec lint --silent --allow-warnings {self.__file_name}', skip=dry_run) | ||
shell(f'pod trunk push --allow-warnings {self.__file_name}', skip=dry_run) |
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 think pod trunk push
performs the same validation as pod spec lint
.
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.
Yes they both perform this validator. So you could just call pod trunk push
.
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.
Agree 👍 , however I was trying to optimize for the CI log clarity here. Note, that we're calling pod spec lint
with the --silent
option and only calling verbose pod trunk push
once after we know pushing will pass. Given that we know pod spec lint
will fail for dozen of times, this should give us minimal log with maximum verbosity:
attempt 1: `pod spec lint` verbose failure
attempt 2: `pod spec lint` silent failure
attempt 3: `pod spec lint` silent failure
...
attempt N: `pod spec lint` silent pass
attempt N+1: `pod trunk push` verbose pass
I don't think we can use only pod trunk push
to achieve the same, hence the question is if we want to optimize for CI speed (one redundant pod spec lint
) or CI log clarity. WDYT?
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.
Well, actually we can have both by adding a bit more complexity to this tool and capturing shell('')
output along with its result. Then we will control which output to print in the log. So this is a third option to consider.
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.
Ah I see, I didn't catch the logic at first glance! I'm all for simplicity, if we are not too concern about build time I'm good with it 👍
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 added an improvement to always build our dependencies from source, which leads to producing minimal GH Asset (with only the architecture slices we need): - shell('carthage bootstrap --no-build')
- shell('carthage build --platform iOS --use-xcframeworks --no-skip-current')
+ shell('carthage bootstrap --platform iOS --no-build')
+ shell('carthage build --platform iOS --use-xcframeworks --no-use-binaries --no-skip-current') Also, added additional log on the
|
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.
perfect 👌
…utomation-issues RUMM-1667 Enhance release automation (cherry picked from commit 0ebcb7f)
…utomation-issues RUMM-1667 Enhance release automation (cherry picked from commit 0ebcb7f)
…utomation-issues RUMM-1667 Enhance release automation (cherry picked from commit 0ebcb7f)
…utomation-issues RUMM-1667 Enhance release automation (cherry picked from commit 0ebcb7f)
What and why?
📦 This PR proposes enhancement to our release automation model. Compared to previous model:
Datadog-x.y.z.zip
archive in current directory, instead it clones the repo to temporary folder which ensures clean state for buildingXCFrameworks
. It removes the need forprepare()
andcleanup()
operations and guarantees that no dirty artefacts will be included in the.zip
(in1.7.0
,1.7.1
and1.8.0-beta1
we accidentally includedHTTPServerMock.xcframework
).sdk_version
andspec.version
match the git tag and validates the content of producedDatadog-x.y.z.zip
archive.--dry-run
mode for testing and debugging locally and on CI (withDD_RELEASE_DRY_RUN=1
ENV).1.7.0
,1.7.1
and1.8.0-beta1
GH assets.How?
Updated Bitrise pipelnie
I reshaped our Bitrise CI pipeline to spin off two distinct jobs, one for publishing GH Release asset, one for pushing pods:
I used the official Bitrise Start Build step instead of calling Bitrise API with
curl
(it gives us ENV propagation fromtagged_commit
to child jobs for free). It is possible to support Github Check by making thetagged_commit
await child jobs completion, but in our case this will always end up with a CI timeout (90min
) as Cocoapods specs push might take~1h
. Instead, eventual failure from child jobs is reported to our Slack channel.New CLI tooling
I replaced Bash scripts with more flexible Python CLI tool:
It uses
python3
and nopip
dependencies. The--dry-run
option allows for local and remote (DD_RELEASE_DRY_RUN=1
) debugging. All options have their ENV counterpart, meaning that it can be run for any release tag locally and on CI.The tool itself is simple: it makes, validates and publishes GH Release asset and / or Cocoapod specs, e.g.:
Example CI logs for
--dry-run
: publishing GH Asset, publishing CP specs.Review checklist