Skip to content
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

feat: add updater_tools with package_patch command #163

Merged
merged 9 commits into from
May 17, 2024

Conversation

bryanoltman
Copy link
Contributor

@bryanoltman bryanoltman commented May 16, 2024

Description

Adds an initial updater_tools package_patch command that accepts two aabs (a release and a patch) and generates patch artifacts for them.

Sample usage:

dart run updater_tools package_patch \
  --archive-type=aab \
  --release ~/Desktop/release.aab \
  --patch ~/Desktop/patch.aab \
  --patch-executable=$HOME/shorebirdtech/_shorebird/shorebird/bin/cache/artifacts/patch/patch \
  --output=$HOME/Desktop/testout 

Outputs to $HOME/Desktop/testout:

bryanoltman@moltman ~/Desktop
⑆ l testout
total 24
drwx------   5 bryanoltman  staff   160B May 16 11:55 .
drwx------@ 88 bryanoltman  staff   2.8K May 16 11:55 ..
-rw-r--r--   1 bryanoltman  staff   160B May 16 11:54 arm64-v8a.zip
-rw-r--r--   1 bryanoltman  staff   160B May 16 11:54 armeabi-v7a.zip
-rw-r--r--   1 bryanoltman  staff   160B May 16 11:55 x86_64.zip

Where the contents of each .zip file is the dlc.vmcode produced by the patch executable.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.13%. Comparing base (5707bd8) to head (cb4c840).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
+ Coverage   95.98%   96.13%   +0.15%     
==========================================
  Files          21       26       +5     
  Lines        2963     3078     +115     
==========================================
+ Hits         2844     2959     +115     
  Misses        119      119              
Flag Coverage Δ
updater_tools 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bryanoltman bryanoltman marked this pull request as ready for review May 16, 2024 17:31
required Directory outputDirectory,
}) async {
final directory = switch (archiveType) {
ArchiveType.aab => await _packageAndroidAabPatch(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 💯

Copy link
Contributor

@felangel felangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great. One thing to consider is the format of the contents of each .zip as well as the contents of the output directory may change over time and it might be nice to have some sort of manifest which makes this explicit otherwise each time we change the output format or add new files, we'll need to support checking updater_tools versions etc. to decide how to interpret the output contents.

@bryanoltman
Copy link
Contributor Author

The contents of each zip is intended to be opaque, the idea being that arch_name.zip will be what is handed back to the CLI and (eventually) to the updater as a patch artifact. In theory, no other part of the system should need to care about the contents/layout of the zip.

Re: the content/layout of the output directory, I think that should be stable so long as we stick to a one-patch-artifact-per-arch model. We can always ask updater_tools what its version is and skew on that if/when we need as well.

@bryanoltman bryanoltman merged commit 43b21ee into main May 17, 2024
8 checks passed
@bryanoltman bryanoltman deleted the bo/updater_tools_buildout branch May 17, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants