Conversation
…uto-stash pull-merge, and version fix after stash restore - push: auto-set flagPullDiscardLocal=true during pull-merge conflict path so remote deletions apply cleanly - pull: fix version frontmatter after stash restore to reflect remote-pulled version, not pre-pull local version - status: add ConflictAhead field and section for pages that are both locally modified and remote-ahead - doctor: new command to check state/filesystem/frontmatter consistency with --repair flag - confluence client: add confluenceStatusHint() and mapConfluenceErrorCode() for richer API error messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five targeted improvements to
confCLI reliability and observability:1. Auto-Stash for
pull-merge(cmd/push.go)When
push --on-conflict=pull-mergetriggers an automatic pull,flagPullDiscardLocalis temporarily set totrueso remote deletions are applied cleanly instead of being skipped with a warning.2. Version Fix After Stash Restore (
cmd/pull.go)After a
pullthat stashed local changes, if the stash restore reintroduces an oldversionfrontmatter value,fixPulledVersionsAfterStashRestore()patches each affected file on disk to match the version that was committed by the pull (read fromgit show HEAD:<path>). This prevents a stale version from causing an immediate conflict on the nextpush.3.
ConflictAheadinconf status(cmd/status.go)StatusReportnow includes aConflictAhead []stringfield — pages that are both locally modified and ahead on the remote. These are the highest-priority conflicts. Printed as a dedicatedConflict aheadsection inconf statusoutput.4.
conf doctorcommand (cmd/doctor.go)New command for consistency checking between
.confluence-state.json, the actual filesystem, and pageidfrontmatter.Detects:
idfrontmatter that doesn't match the state index<<<<<<<) in file bodiesidin frontmatter that are not tracked in state--repairflag auto-fixes: removes stale/empty state entries, adds untracked IDs to state. Non-repairable issues (id-mismatch, conflict markers) are listed for manual resolution.5. Better API Error Messages (
internal/confluence/client.go)confluenceStatusHint(code int)— actionable hints for 401, 403, 409, 422, 429, 503, 413mapConfluenceErrorCode(code string)— enriches known Confluence error codes (INVALID_IMAGE, MACRO_NOT_FOUND, TITLE_ALREADY_EXISTS, PERMISSION_DENIED, CONTENT_STALE, PARENT_PAGE_NOT_FOUND, INVALID_REQUEST_PARAMETER)APIError.Error()falls back toconfluenceStatusHintbefore the generichttp.StatusTextdecodeAPIErrorMessagecheckscode/errorKey/statusfields and runs message strings through the mapperTests
cmd/doctor_test.go— 11 new tests covering all detection and repair casescmd/status_test.go— 5 newTestComputeConflictAheadsub-casescmd/pull_test.go— 2 new tests forfixPulledVersionsAfterStashRestoreinternal/confluence/client_test.go— 5 new tests for error hint/mapping functionsAll tests pass (
go test ./...), linter clean (go vet ./...).