Refactor generic storage helpers and add develop update channel#119
Refactor generic storage helpers and add develop update channel#119cooper (czxtm) wants to merge 5 commits into
Conversation
📋 PR Overview
🔬 Coverage
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c74e5841b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| TAG="v${VERSION}" | ||
| elif [[ "$GITHUB_EVENT_NAME" == "push" && "$GITHUB_REF" == "refs/heads/develop" ]]; then | ||
| MODE="develop" | ||
| BASE=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "") |
There was a problem hiding this comment.
Filter prerelease tags when deriving develop versions
When a disposable tag such as v0.22.0-test.1 is the nearest reachable tag, git describe --tags --abbrev=0 can return it (git describe -h says --tags uses any tag, while --match is the option to restrict candidates). The new develop path then parses PAT as 0-test.1, so PAT=$((PAT + 1)) aborts the workflow with an arithmetic syntax error on every develop push after such a tag; use a stable-tag match/exclude before doing numeric arithmetic.
Useful? React with 👍 / 👎.
| store::UPDATE_CHANNEL_KEY, | ||
| shared_types::UpdateChannel::default(), | ||
| ) | ||
| .map_err(|e| capture_err("ui_get_prefs", e))?; |
There was a problem hiding this comment.
Suggest using wrap_result_and_capture_err which I added after tiring of seeing this same verbose/error-prone pattern dozens of times in this file.
| get_string_pref_raw(app, key) | ||
| } | ||
|
|
||
| pub fn get_json_pref<R, T>(app: &AppHandle<R>, key: &str) -> Result<Option<T>> |
There was a problem hiding this comment.
Note that I think this will have the effect of downgrading to defaults if you ever change the JSON schema by (say) adding a field. Maybe that's ok?
Summary
Adds release-channel support so developer builds can target the develop update channel independently from main/stable auto-updates.
Test Plan
bun run --cwd apps/native test:unit -- src/components/widget/controls/directory-picker.test.tsxbunx vitest run --project=unit --coverage --coverage.reporter=json-summary --coverage.reporter=text --reporter=basicfromapps/nativebun run --cwd apps/native buildgit diff --checkDocs