Skip to content

Support tracked module freshness#26

Merged
johnson-ricon merged 3 commits into
mainfrom
johnson/tracked-modules-freshness
May 5, 2026
Merged

Support tracked module freshness#26
johnson-ricon merged 3 commits into
mainfrom
johnson/tracked-modules-freshness

Conversation

@johnson-ricon

Copy link
Copy Markdown
Contributor

Summary

Implements the module freshness bundle discussed in #19, #13, and #23.

  • add optional manifest tracking refs: <name>\t<url>\t<pin>[\t<track>]
  • add modules add --track <ref>
  • make modules init refresh tracked clones from their tracked ref without updating the recorded pin
  • make modules update preserve tracking refs while advancing pins
  • add modules update --commit, plus an interactive commit prompt for TTY runs and a staged-change hint for non-TTY runs
  • make modules unlock no-op cleanly when the manifest is already readable
  • harden modules update against stale local module branches by updating untracked modules from the remote default branch
  • update list, status, README, and BATS coverage

Semantics

Pins remain the durable recorded state. Tracking refs are an optional freshness layer for gitignored local clones. This means home modules like fold/den can track main for current shared notes during startup, while code dependencies can remain strictly SHA-pinned.

modules init refreshes tracked clones but does not dirty the parent repo. modules update is still the explicit operation that advances and stages the manifest pin.

Verification

  • bash -n .mise/tasks/add .mise/tasks/init .mise/tasks/list .mise/tasks/status .mise/tasks/unlock .mise/tasks/update lib/common.sh lib/manifest-merge-driver.sh test/test_helper.bash
  • mise run test — 105/105 passing
  • bats test/update.bats — 9/9 passing direct single-file smoke
  • readme build
  • git diff --check

Closes #13.
Closes #19.
Closes #23.

@quick-ricon quick-ricon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found one blocking issue.

  • .mise/tasks/update:96-104modules update --commit and the interactive commit prompt run plain git commit -m "$msg", so they commit every currently staged path in the parent repo, not just the manifest pin change. That makes a convenience flag/prompt capable of accidentally sweeping unrelated staged work into a deps commit. I opened fix-it PR #28 to scope these commits to .modules/manifest and add regression coverage.

Verified locally:

  • bash -n .mise/tasks/add .mise/tasks/init .mise/tasks/list .mise/tasks/status .mise/tasks/unlock .mise/tasks/update lib/common.sh lib/manifest-merge-driver.sh test/test_helper.bash
  • mise run test — 105/105 passing on #26
  • On fix-it #28: bash -n .mise/tasks/update, bats test/update.bats, mise run test — 106/106 passing

@brownie-ricon brownie-ricon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the diff for tracked freshness, idempotent unlock, and update commit behavior. I don't see blockers. Verified locally: mise run test (105/105), bash -n on changed shell files, and git diff --check.

fix: scope update commits to module manifest
@johnson-ricon

johnson-ricon commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the corrected comment below; original was mangled by local shell backtick expansion.

@johnson-ricon
johnson-ricon requested a review from quick-ricon May 5, 2026 03:41
@johnson-ricon

Copy link
Copy Markdown
Contributor Author

Correction to my previous mangled comment: I quoted the shell command badly and backticks were interpreted locally.

Merged Quick's fix-it PR #28 into this branch. The --commit / prompt path now commits only .modules/manifest, with regression coverage for unrelated staged files.

Verification after merge:

  • bash -n .mise/tasks/update
  • mise run test — 106/106 passing

@quick-ricon please re-review when you have a chance.

@quick-ricon quick-ricon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed after #28 was merged into the branch. The commit scoping fix is present () and the regression covers unrelated staged files. Verified locally: bash -n .mise/tasks/add .mise/tasks/init .mise/tasks/list .mise/tasks/status .mise/tasks/unlock .mise/tasks/update lib/common.sh lib/manifest-merge-driver.sh, git diff --check origin/main...HEAD, and mise run test (106/106).

@quick-ricon quick-ricon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed after #28 was merged into the branch. The commit scoping fix is present (git commit --only -- .modules/manifest) and the regression covers unrelated staged files.

Verified locally: bash -n .mise/tasks/add .mise/tasks/init .mise/tasks/list .mise/tasks/status .mise/tasks/unlock .mise/tasks/update lib/common.sh lib/manifest-merge-driver.sh, git diff --check origin/main...HEAD, and mise run test (106/106).

@johnson-ricon
johnson-ricon merged commit e26b596 into main May 5, 2026
@johnson-ricon
johnson-ricon deleted the johnson/tracked-modules-freshness branch May 5, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants