Repository navigation
fix(gitsync): dashboard edits right after a pull are committed and pushed - #133
Merged
Merged
Conversation
…tent, not a time window Every write within 1.2s of a pull import was treated as SimpleDeploy re-rendering the pulled file: a dashboard edit in that window was not committed or pushed, and on a later conflict the remote version won. Right after an import git sync now records the SHA-256 of each imported sidecar as rendered from the DB; only a write with exactly those bytes counts as the re-render, whenever it lands. Writes during the import itself are held and classified when it finishes. Also: ApplyPending runs on the worker goroutine and Status reads recent commits through its own repository handle, since a go-git handle is not safe for concurrent use (race detector).
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.
Bug: after each pull import, git sync treated every config write for ~1.2s (suppress window) as SimpleDeploy re-rendering the pulled file. A dashboard edit landing in that window was recorded as a "rewrite of pulled config": not committed or pushed with auto-push on, and on a later conflict the remote version won (for app settings the dashboard edit was then lost).
Fix: content instead of time. Right after importing a pull, git sync renders each imported app's
simpledeploy.ymlfrom the DB (newconfigsync.RenderAppSidecar) and records its SHA-256. A later write with exactly those bytes is the re-render, whenever it lands (the debounced write can come after any delay); any other write is a local edit and is committed and pushed normally. Requests made during the import itself are held and classified when it finishes. The 1.2s window is gone.Also fixed (race detector, CI runs
go test -race):ApplyPending(Git Sync page "Apply now") ran fetch/rebase/apply on the API goroutine concurrently with the worker. It is now queued to the worker like a sync.Statuswalked recent commits through the worker's go-git handle; it now uses its own handle.TestDebouncedGlobalWritesBothFiles(configsync) slept a fixed 700ms for a 500ms debounce and flaked under load; it now polls.Tests:
TestDashboardEditRightAfterPullIsPushed(failed before: the edit never reached the remote). Existing guards still pass: pull rewrites still yield to later remote edits (pull-only), no rebound bot commit after a pull. Fullgo test -race ./...passes; 26b E2E passes.