Conversation
…sets Remote presets referenced via `extends` are cached with a TTL (default 24h) and updated implicitly during check/exec. There was no way for users to explicitly trigger an immediate refresh. This command scans all config layers for remote preset references, force-fetches each one (skipping immutable commit-SHA pins), and shows a colored unified diff for any preset whose content changed. - Add `UpdatePresets` variant to CLI Commands enum - Add `update_presets` module with core logic: collect references from all config layers, force-fetch via GitClient, compare before/after content, display diff using `similar` crate - Expose `cache`, `git_client`, `preset_remote` modules as pub for cross-module access; extract `resolve_preset_file_path` helper from `read_preset_from_dir` for raw content reading - Add CLI doc page and update CLI overview - Add unit tests for reference collection, immutable skip, up-to-date detection, fetch error handling, and deduplication Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The initial update-presets implementation only re-fetched cached content, which was useless for tag references since tags are immutable. Users pinning presets to semver tags (e.g., @v1.0.0) had no way to discover and apply newer compatible versions. - Add `ls_remote_tags` method to GitClient trait for querying remote tags - Add semver_utils module for parsing semver tags (with v-prefix handling) and finding the latest compatible version within the same major version - Track source config file path for each preset reference, enabling in-place config file updates via string replacement - For semver-tagged presets: query remote tags, find latest compatible version, fetch it, update the extends entry in runok.yml, show diff - For non-semver references (branches): keep existing force-refetch behavior - Cache ls-remote results per URL to avoid redundant network calls - Respect major version boundaries (v1.x won't upgrade to v2.x) - Exclude pre-release versions from upgrade candidates - Update CLI docs with version upgrade rules and examples Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
`@v1` and `@v1.0` were treated as branch names and only re-fetched without config file updates, because `semver::Version::parse` requires all three components. Introduce `VersionSpec` enum to distinguish major-only (`v1`), major.minor (`v1.0`), and full semver (`v1.0.0`) tags, each with different upgrade scopes: - `@v1` → upgrades across major versions (e.g., `@v1` → `@v2`) - `@v1.0` → upgrades within same major (e.g., `@v1.0` → `@v1.3`) - `@v1.0.0` → unchanged behavior, within same major Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a version-like tag (e.g., `v1`) has no newer version available from remote tags, it was returning UpToDate without re-fetching. This missed the case where `v1` is actually a mutable branch (GitHub Actions style), not a semver tag. Now falls through to force_refetch so the preset content is still updated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rades ls-remote was only querying tags (--tags), so version-like branches (e.g., `v1`, `v2` in GitHub Actions style) were invisible to the upgrade logic. Now queries both tags and branches (--tags --heads) so that `@v1` can be upgraded to `@v2` regardless of whether `v2` is a tag or a branch on the remote. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The upgrade and no-upgrade test cases were separate functions with duplicated setup logic. Extract shared helpers (run_upgrade_test, run_no_upgrade_test) and use rstest #[case] to cover full semver, major-only, major.minor, and branch-style version tags in a single parameterized test each. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Individual test functions for skip/refetch/upgrade were hard to scan as a whole. Consolidate into a single parameterized test (update_single_preset_scenarios) with descriptive case names covering: commit SHA skip, branch re-fetch, v1→v2 branch upgrade, v1→v2 tag upgrade, mixed branches/tags, major boundary, patch vs minor priority, major.minor upgrade, pre-release exclusion, and v-prefix matching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ls_remote_refs returned flat strings with no distinction between tags and branches. Introduce RemoteRef struct with RefKind (Tag/Branch) so callers can distinguish ref types. Test cases now use (name, T/B) tuples, making it clear whether each remote ref is a tag or branch (e.g., v1 branch vs v1.0.0 tag scenarios). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Branch re-fetch (Updated) was showing a full preset content diff which was noisy and not useful. Now shows only the old/new commit SHA. For version tag upgrades (Upgraded), the diff now shows the config file change (e.g., runok.yml) rather than the preset's internal content, since the config file rewrite is the actual user-visible change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The run_with function had no tests verifying its side effects: config file updates on upgrade, no modification on other outcomes, and error counting. These behaviors were only implicitly covered through update_single_preset unit tests which don't exercise the full orchestration path.
The run_with tests were written as 6 separate functions with duplicated setup logic. Consolidate into a single parameterized test using RunWithScenario struct and RunWithExpected enum, consistent with the update_single_preset_scenarios pattern.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses the challenges of managing remote presets by introducing a dedicated CLI command, Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
Warning Gemini is experiencing higher than usual traffic and was unable to create the review. Please try again in a few hours by commenting |
…t match String::replace replaces all occurrences of the reference string, which could unintentionally modify comments or other parts of the config file that happen to contain the same string.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #197 +/- ##
==========================================
- Coverage 90.41% 89.07% -1.34%
==========================================
Files 40 42 +2
Lines 7520 8163 +643
==========================================
+ Hits 6799 7271 +472
- Misses 721 892 +171
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…counting Two bugs found in code review: 1. Deduplication used only the reference string as the key, so the same reference appearing in both global and project config files would only update the first file. Changed the key to include the source file path. 2. upgraded_count was incremented unconditionally even when update_config_file failed, causing the summary to double-count as both "upgraded" and "error". Also switched run_with test strings from embedded \n to indoc!.
Why
RUNOK_CACHE_TTL=0to bypass the cacheWhat
runok update-presetscommand to refresh and upgrade all remote presets at once@v1,@v1.0,@v1.0.0)