这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@bryanoltman
Copy link
Contributor

@bryanoltman bryanoltman commented Jul 2, 2025

Description

Fixes shorebirdtech/shorebird#3206

The ultimate issue: rolled back patches were being removed from the "last successfully booted patch" state field. This (correctly) happens with boot failures, but in a rollback scenario, it means that the next boot patch and last booted patch both end up being null, causing shorebird_code_push to report that it is up-to-date when it should either report that an update is available (if an earlier patch is available) or that a restart is required (if the rollback is reverting to the base release)

Note:

This is still a draft. This has a bug where rolling back to the base release doesn't entirely work (last booted patch does not get overwritten and the app reports patch 1, despite actually running the release)

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

@codecov
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@bryanoltman bryanoltman marked this pull request as ready for review July 2, 2025 21:43
@bryanoltman bryanoltman requested review from eseidel and felangel July 2, 2025 21:43
self.patches_state.known_bad_patches.contains(&patch_number)
}

fn remove_patch(&mut self, patch_number: usize) -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is only used for the rollback case, we should comment that.

self.try_fall_back_from_patch(patch_number)
self.delete_patch_artifacts(patch_number)?;
// If the patch to remove is the next boot patch, clear it.
if let Some(next_boot_patch) = self.patches_state.next_boot_patch.clone() {
Copy link
Contributor

Choose a reason for hiding this comment

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

So the change here is to clear the next_boot_patch if it happens to be the same as the patch being removed. Do we need to clear it from other fields as well?

Copy link
Contributor

@eseidel eseidel left a comment

Choose a reason for hiding this comment

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

Bryan noted over discord that there are more issues here (notably I believe we don't clear the last_boot_patch after the rollback) so pausing this for now.

@bryanoltman bryanoltman marked this pull request as draft July 3, 2025 14:06
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: package:shorebird_code_push reports upToDate when current patch has been rolled back

3 participants