318 Commits

Author SHA1 Message Date
Bryan Oltman 5de07bb48a feat: store patch hash on disk (#169) 2024-05-21 14:38:37 -04:00
Bryan Oltman a2e9f5de54 feat: read public key from release yaml (#168) 2024-05-21 12:30:28 -04:00
dependabot[bot] 6ab6972c1e chore(deps): bump ffigen (#160)
Bumps the shorebird_code_push-deps group in /shorebird_code_push with 1 update: [ffigen](https://github.com/dart-lang/native/tree/main/pkgs).


Updates `ffigen` from 11.0.0 to 12.0.0
- [Release notes](https://github.com/dart-lang/native/releases)
- [Commits](https://github.com/dart-lang/native/commits/HEAD/pkgs)

---
updated-dependencies:
- dependency-name: ffigen
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: shorebird_code_push-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 20:51:38 +00:00
Bryan Oltman 6c3aa53334 feat(updater_tools): add diff command (#164) 2024-05-17 16:39:14 -04:00
Bryan Oltman 80937e6dd5 chore: add bin/ to .gitignore 2024-05-17 13:52:38 -04:00
Bryan Oltman 43b21eec13 feat: add updater_tools with package_patch command (#163)
* Initial updater_tools buildout

* cont'd

* update readme

* use cli arg name variables

* coverage

* pr feedback

* coverage

* comments

* Add libapp.so hash to patch package
2024-05-17 13:52:00 -04:00
Bryan Oltman 5707bd8168 feat: add updater_tools library (#162)
* feat: add patch_packager library

* remove .github folder

* add patch_packager to ci

* update name to updater_tools

* delete unused file
2024-05-15 09:37:37 -04:00
Bryan Oltman d30931771b fix: Don't make network request while holding config lock (#161)
* Add test to demonstrate hang when attempting to init while waiting for a patch check request

* Fix thread contention when initing during patch check

* Clean up test

* revert change to fake_yaml

* reorg

* lower timeout in test
2024-05-14 10:05:38 -04:00
Eric Seidel caaa14c124 feat: print usage when running patch without args (#124) 2024-05-07 20:13:25 +00:00
Bryan Oltman 7361089102 docs: update state machine description in readme (#151)
* docs: update state machine description in readme

* wording

* specify storage location

* add unimplemented note

* update file structure overview

* wording, remove reference to dart-bindings

* add assumptions re: PatchManager state
2024-04-25 09:53:05 -04:00
Bryan Oltman 9dc5f0e9c6 fix: delete all old patch artifacts on successful boot (#150)
* fix: verify failed patch is next_boot_patch before clearing

* add record_boot_start_for_patch now that it exists

* fix: delete all old patch artifacts on successful boot

* add comment

* additional docs on delete_patch_artifacts_older_than

* update comments

* delete unrecognized patch subdirectories

* error logging
2024-04-24 09:42:20 -04:00
Bryan Oltman dc7aea0c01 fix: verify failed patch is next_boot_patch before clearing (#149)
* fix: verify failed patch is next_boot_patch before clearing

* add record_boot_start_for_patch now that it exists

* add comment

* add comments

* cleanup
2024-04-23 17:34:40 -04:00
Bryan Oltman 435dc836a0 feat: update patch manager to only attempt to boot from a patch once (#138)
* feat: record the last patch we attempted to boot from to better capture failures

* add tests

* coverage

* update readme

* clarify comment

* comment feedback

* comment feedback

* refactor

* cleanup

* Update library/src/cache/patch_manager.rs

Co-authored-by: Eric Seidel <eric@shorebird.dev>

* Update library/src/cache/patch_manager.rs

Co-authored-by: Eric Seidel <eric@shorebird.dev>

---------

Co-authored-by: Eric Seidel <eric@shorebird.dev>
2024-04-22 16:21:30 -04:00
Eric Seidel 0a0cd183f5 chore: use resolver=2 to avoid warnings from cargo (#145) 2024-04-19 17:19:49 -04:00
Eric Seidel fe465ea1b1 chore: remove unused package (#142) 2024-04-19 21:00:33 +00:00
Bryan Oltman d5cbb5ac7b chore: check in Cargo.lock (#141) 2024-04-19 13:51:22 -07:00
Bryan Oltman 70d130ad64 format readme 2024-04-17 16:58:58 -04:00
dependabot[bot] 0735b56f52 chore(deps): bump the shorebird_code_push-deps group (#128)
Bumps the shorebird_code_push-deps group in /shorebird_code_push with 2 updates: [ffigen](https://github.com/dart-lang/native/tree/main/pkgs) and [mocktail](https://github.com/felangel/mocktail).


Updates `ffigen` from 8.0.2 to 11.0.0
- [Release notes](https://github.com/dart-lang/native/releases)
- [Commits](https://github.com/dart-lang/native/commits/ffigen-v11.0.0/pkgs)

Updates `mocktail` from 0.3.0 to 1.0.3
- [Release notes](https://github.com/felangel/mocktail/releases)
- [Commits](https://github.com/felangel/mocktail/compare/mocktail-v0.3.0...mocktail-v1.0.3)

---
updated-dependencies:
- dependency-name: ffigen
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: shorebird_code_push-deps
- dependency-name: mocktail
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: shorebird_code_push-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bryan Oltman <bryanoltman@gmail.com>
2024-03-04 10:24:48 -05:00
dependabot[bot] ba94c09646 chore(deps): bump the gh-deps group with 1 update (#126)
Bumps the gh-deps group with 1 update: [dorny/paths-filter](https://github.com/dorny/paths-filter).


Updates `dorny/paths-filter` from 2 to 3
- [Release notes](https://github.com/dorny/paths-filter/releases)
- [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dorny/paths-filter/compare/v2...v3)

---
updated-dependencies:
- dependency-name: dorny/paths-filter
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: gh-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-03 19:56:09 -08:00
bryanoltman ec48fffc83 chore(patch): version 0.2.1 2024-02-27 14:58:58 -05:00
Bryan Oltman b9ae80fabe chore(patch): update crt-static flag in build config (#130) 2024-02-27 19:58:29 +00:00
Bryan Oltman 140d3d4892 chore(patch): bump patch version 2024-02-26 17:02:34 -05:00
Bryan Oltman b1097563db fix(patch): statically link C runtime for Windows patch binaries (#129)
* chore: statically link C runtime for Windows patch binaries

* cleanup
2024-02-26 21:50:49 +00:00
Eric Seidel 2c45aa427d chore: Use dependabot (#125) 2024-02-23 15:55:04 -05:00
Bryan Oltman c484e4a97d chore: improve error messages printed by updater (#121)
* fix: us OSLog framework for logging on iOS

* cleanup

* chore: improve error messages printed by updater

* remove println

* cleanup

* warn -> info

* update set_config to not return anything

* revert pub test struct

* Update library/src/config.rs

Co-authored-by: Eric Seidel <eric@shorebird.dev>

---------

Co-authored-by: Eric Seidel <eric@shorebird.dev>
2024-02-06 17:17:09 -05:00
Bryan Oltman d3b88ec4b6 fix: us OSLog framework for logging on iOS (#120)
* fix: us OSLog framework for logging on iOS

* cleanup
2024-02-06 16:52:04 -05:00
Bryan Oltman ed013eb257 feat: Update C API to consume Read+Seek callbacks (#111)
* Update C API to consume Read+Seek callbacks

* remove open and close functions

* update to reflect new interface

* Refactor posix file i/o to c_api (#113)

* Refactor posix file i/o to c_api

* fix comment

* rename ExternalFile to ReadSeek

* cleanup and comments

* Add SHOREBIRD_PATCH_BASE_FILENAME const

* fix lint

* add fake callbacks for c_api tests

* fix tests

* remove os_last_error

* remove todos, add comments

* cleanup

* remove params to open

* add c_api module, tests

* reorganize

* Return Err if CFileProvider open returns null

* add comments and docs
2024-01-16 14:28:04 -05:00
Eric Seidel c6f8b2933e refactor: remove client_id (#110)
We added client_id back when we had a different billing model
where we would bill customers based on number of unique devices
accepting an install in a given month (similar to what expo.dev
advertised as their pricing model at the time).

We moved to a differnet pricing model and never used client_id
so removing it.
2023-12-21 13:00:14 -05:00
Eric Seidel 917ff39577 chore: Ignore .DS_Store files 2023-12-21 09:06:00 -08:00
Felix Angelov 71ab252ab9 chore: dart format 2023-12-20 16:14:17 -06:00
Bryan Oltman a70fe54668 test: use mockito crate to test network-interfacing code (#106)
* test: use mockito crate to test network-interfacing code

* tweak
2023-11-17 10:30:25 -05:00
Bryan Oltman 52119a5906 update changelog 2023-10-20 15:48:48 -04:00
Bryan Oltman 79b3748c3d Merge branch 'main' of https://github.com/shorebirdtech/updater 2023-10-20 15:45:15 -04:00
Bryan Oltman a6ad4897c4 update version to 1.1.3 2023-10-20 15:44:03 -04:00
Bryan Oltman 5182397b09 docs(shorebird_code_push): improve example in readme (#102)
* docs(shorebird_code_push): improve example in readme

* wording
2023-10-20 12:53:32 -04:00
Bryan Oltman ef20c33725 chore(shorebird_code_push): remove error log when shorebird is unavailable (#101)
* chore(shorebird_code_push): remove error log when shorebird is unavailable

* fix tests
2023-10-20 12:36:31 -04:00
Bryan Oltman 3b4b6ebc24 docs: fix method name in readme 2023-10-07 23:41:15 -04:00
Bryan Oltman bb2e0b5c04 Update changelog 2023-10-07 23:37:07 -04:00
Bryan Oltman c2a7665b6a chore: bump version to 1.1.1 2023-10-07 23:34:44 -04:00
Bryan Oltman bec99ff276 chore: format pubspec.yaml 2023-10-07 23:34:29 -04:00
Bryan Oltman 2bbcfa5752 chore: fix repository link in pubspec 2023-10-07 23:33:43 -04:00
Eric Seidel 54f47b8b36 chore: move to checkout@v4 (#95) 2023-10-07 19:50:33 +00:00
Bryan Oltman d785568094 chore: don't error log if patches_state.json doesn't exist (#97) 2023-10-05 17:51:37 +00:00
Bryan Oltman 11c220c2ec fix: add delay to unstick download banner (#94)
* fix: add delay to fix download banner

* revert change

* minor tweak

* reduce wait time for download banner
2023-10-03 14:01:29 -04:00
Bryan Oltman b02610370a refactor: move patch management functionality out of UpdaterState (#93)
* non-compiling WIP

* update

* add cfg test

* address clippy issues

* minor consistency

* introduce patch manager, delegate patch management functionality from updater state

* cleanup

* Restructure patch state on disk, adds patch validation

* Simplify patches state, move patches to subdirectories of patches/ instead of having the artifacts as immediate children

* Tests

* delete unused enum

* disk manager tests

* Tests, docs

* rename

* delete unused file

* fix todo

* error logging

* cleanup

* cleanup

* comments and cleanup

* cleanup

* debug log

* boot from previous patch if next patch is bad

* fallback logic and test

* fix log

* context -> with_context

* remove get from get_next_boot_patch

* Log patch state load error

* renaming

* coverage

* capitalization

* coverage

* Replace unwrap with ? in disk_io

* Fix record boot success

* eq none -> .is_none

* Move delete_patch_artifacts failure logging into function

* rename patch_install_success_fn to report_event_fn

* Fix patch install reporting

* update comment
2023-10-03 13:58:23 -04:00
Bryan Oltman 194fdc3220 refactor: create module directory for cache (#91) 2023-09-26 16:44:13 -04:00
Bryan Oltman 3f907de7c0 Revert "feat: treat iOS patches as diffs instead of full artifacts (#88)" (#90)
This reverts commit f4db98b759.
2023-09-26 15:41:01 -04:00
Bryan Oltman f4db98b759 feat: treat iOS patches as diffs instead of full artifacts (#88)
* feat: apply iOS patches from diffs

* Clean up imports

* fix lint

* Add iOS, tests

* refactor

* revert changes to shorebird_code_push

* remove unused debug trait

* coverage

* imports
2023-09-22 16:58:31 -04:00
Bryan Oltman bd86f617e1 fix: don't serialize UpdaterState cache_dir as it can change between app runs (#87)
* fix: don't serialize UpdaterState cache_dir as it can change between app runs

* tests

* update tests
2023-09-20 16:08:58 -04:00
Eric Seidel ebd721fea7 chore: print path create_dir_all fails at on failure (#86)
Co-authored-by: Bryan Oltman <bryanoltman@gmail.com>
2023-09-20 14:30:16 -04:00