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

fix(shorebird_cli): update cache artifacts on every command run, log progress #1958

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

bryanoltman
Copy link
Contributor

Description

Updates shorebird_cli to ensure all cache artifacts are up-to-date before running any command and prints the update progress, if any. This ensures:

  1. We will always know that cache artifacts are up-to-date in any command.
  2. Cache artifacts are updated in a consistent and predictable place.
  3. Users have better visibility into what the CLI is doing (see the fixed issue).

Fixes #1899

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

Comment on lines +168 to +171
# We invoke `$SNAPSHOT_PATH completion` to trigger the "completion" command, which
# avoids executing as much of our code as possible. We do this because running
# the script here (instead of from the compiled snapshot) invalidates a lot of
# assumptions we make about the cwd in the shorebird_cli tool.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there no way to compile w/o running?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There quite possibly is, but adding the completion argument here seemed like a much smaller and safer change than updating how we compile our tool. Happy to revisit if you feel it's worth further investigation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

sg, thanks.

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.60%. Comparing base (7652dc6) to head (6a6034f).

Additional details and impacted files
@@             Coverage Diff              @@
##              main    #1958       +/-   ##
============================================
- Coverage   100.00%   87.60%   -12.40%     
============================================
  Files          174      174               
  Lines         5506     5504        -2     
============================================
- Hits          5506     4822      -684     
- Misses           0      682      +682     
Flag Coverage Δ
shorebird_cli 84.05% <100.00%> (-15.95%) ⬇️

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.

Comment on lines +215 to +221
/// The change to use a .dill file was made in
/// https://github.com/shorebirdtech/_build_engine/commit/babbc37d93e7a2f36e62787e47eee5a3b5458901
/// The Flutter versions that use this are:
/// - 3.13.9 (a3d5f7c614aa1cc4d6cb1506e74fd1c81678e68e)
/// - 3.16.3 (b9b23902966504a9778f4c07e3a3487fa84dcb2a)
/// - 3.16.4 (7e92b034c5dddb727cf5e802c23cddd39b325a7f)
/// - 3.16.5 (4e8a7c746ae6f10951f3e676f10b82b21d7300a5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Future me says thank you. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🙏

Co-authored-by: Eric Seidel <eric@shorebird.dev>
@bryanoltman bryanoltman enabled auto-merge (squash) April 23, 2024 18:59
@bryanoltman bryanoltman merged commit 764142e into main Apr 23, 2024
10 of 11 checks passed
@bryanoltman bryanoltman deleted the bo/print-cache-updates branch April 23, 2024 19:05
felangel added a commit that referenced this pull request Apr 25, 2024
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.

fix: detecting release version hangs for a long time (downloading assets)
3 participants