fix(skills): preserve local lock during sync - #179
Conversation
Run deployment syncs against a temporary copy of the committed skills lock so generated re-locking cannot overwrite user-owned checkout changes. Refs shunkakinokisoftware-hnnt
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe sync workflow now uses the committed ChangesCommitted lock sync
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
2 issues found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="Makefile">
<violation number="1" location="Makefile:37">
P3: `make -f /path/to/Makefile sync` fails outside the checkout because this wrapper is resolved from the caller’s working directory. Resolve the script relative to the Makefile, matching the other project paths.</violation>
</file>
<file name="tests/with-committed-skills-lock.sh">
<violation number="1" location="tests/with-committed-skills-lock.sh:31">
P3: The three scenarios (direct command, make, failure) all run against the committed-git fixture, so the script's fallback path (git show failing → copy CURRENT_LOCK) is never exercised. Consider adding a case where DOTAGENTS_ROOT has no git metadata (or a repo without a committed skills-lock) and assert the temporary lock then mirrors the working lock while the working file is still left untouched.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| sync: ruler-prepare ## Sync project commands, skills, and MCP configuration to assistant-specific directories. | ||
| .PHONY: sync sync-internal | ||
| sync: ## Sync project commands, skills, and MCP configuration without rewriting the committed lock. | ||
| @./scripts/with-committed-skills-lock.sh $(MAKE) sync-internal |
There was a problem hiding this comment.
P3: make -f /path/to/Makefile sync fails outside the checkout because this wrapper is resolved from the caller’s working directory. Resolve the script relative to the Makefile, matching the other project paths.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 37:
<comment>`make -f /path/to/Makefile sync` fails outside the checkout because this wrapper is resolved from the caller’s working directory. Resolve the script relative to the Makefile, matching the other project paths.</comment>
<file context>
@@ -32,8 +32,11 @@ DOTDIRS_SRC_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
-sync: ruler-prepare ## Sync project commands, skills, and MCP configuration to assistant-specific directories.
+.PHONY: sync sync-internal
+sync: ## Sync project commands, skills, and MCP configuration without rewriting the committed lock.
+ @./scripts/with-committed-skills-lock.sh $(MAKE) sync-internal
+
+sync-internal: ruler-prepare
</file context>
| @./scripts/with-committed-skills-lock.sh $(MAKE) sync-internal | |
| @"$(dir $(lastword $(MAKEFILE_LIST)))scripts/with-committed-skills-lock.sh" $(MAKE) sync-internal |
| CAPTURE="$TEST_ROOT/capture" | ||
| MOCK_COMMAND="$TEST_ROOT/capture-lock" | ||
| mkdir -p "$FIXTURE" | ||
| git -C "$FIXTURE" init --quiet |
There was a problem hiding this comment.
P3: The three scenarios (direct command, make, failure) all run against the committed-git fixture, so the script's fallback path (git show failing → copy CURRENT_LOCK) is never exercised. Consider adding a case where DOTAGENTS_ROOT has no git metadata (or a repo without a committed skills-lock) and assert the temporary lock then mirrors the working lock while the working file is still left untouched.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/with-committed-skills-lock.sh, line 31:
<comment>The three scenarios (direct command, make, failure) all run against the committed-git fixture, so the script's fallback path (git show failing → copy CURRENT_LOCK) is never exercised. Consider adding a case where DOTAGENTS_ROOT has no git metadata (or a repo without a committed skills-lock) and assert the temporary lock then mirrors the working lock while the working file is still left untouched.</comment>
<file context>
@@ -0,0 +1,91 @@
+CAPTURE="$TEST_ROOT/capture"
+MOCK_COMMAND="$TEST_ROOT/capture-lock"
+mkdir -p "$FIXTURE"
+git -C "$FIXTURE" init --quiet
+git -C "$FIXTURE" config user.email test@example.com
+git -C "$FIXTURE" config user.name 'Dotagents Test'
</file context>
|
Closing: this overgeneralized a host checkout issue into unnecessary sync behavior. |
Summary
Validation
Refs shunkakinokisoftware-hnnt
Summary by cubic
Prevent deployment sync from overwriting a user-modified
skills-lock.jsonby running sync against a temporary copy of the committed lock. Adds a wrapper script, updatesmake sync, and includes tests to ensure the working lock is preserved.scripts/with-committed-skills-lock.shto run sync with a temp lock fromHEAD:skills-lock.json(falls back to the current lock if git metadata is missing).Makefile:syncwraps a newsync-internal;SKILLS_LOCK_FILEis now?=so the temp lock override is respected.tests/with-committed-skills-lock.shand wired it intobun run check; clarified README. Ensures the working lock is untouched on success or failure, cleans up temp files, and propagates exit codes.Written for commit 7dd20ef. Summary will update on new commits.