Skip to content

refactor/sync flag#3793

Open
fiftin wants to merge 8 commits intodevelopfrom
refactor/sync_flag
Open

refactor/sync flag#3793
fiftin wants to merge 8 commits intodevelopfrom
refactor/sync_flag

Conversation

@fiftin
Copy link
Copy Markdown
Collaborator

@fiftin fiftin commented Apr 19, 2026

  • feat(secrets): add sync flag and sync paths table
  • fix(secrets): layout
  • feat(secrets): auto sync

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc0ccade0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread db/sql/secret_storage.go
}

for i := range storages {
storages[i].SyncPaths, err = d.GetSecretStorageSyncPaths(storages[i].ID)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Backfill legacy sync paths during 2.18.1 migration

After this refactor, secret storages load sync_paths only from project__secret_storage__sync_path, but db/sql/migrations/v2.18.1.sql only creates the new table and never copies existing params.sync_paths data into it. In upgraded instances, previously configured sync mappings become empty in API/UI responses, so both manual and scheduled sync effectively stop until users manually recreate all paths.

Useful? React with 👍 / 👎.

Comment thread cli/cmd/root.go
go schedulePool.Run()
go taskPool.Run()

secretStorageSyncScheduler.Start()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate secret-sync scheduler to a single HA node

In active-active mode, this unconditional scheduler start runs on every node, while the rest of runService explicitly adds HA coordination only for schedules/websockets. Because GetSyncEnabledSecretStorages() reads from shared DB state, each node will call SyncSecrets for the same storage on the same interval, leading to duplicated external sync operations and race-prone concurrent writes in multi-node deployments.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@codex fix it

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Testing

  • go test ./services/server
  • ⚠️ go test ./cli/cmd ./services/server (fails in this environment because api/router.go expects embedded public/* assets that are not present during this run)

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant