Return the assigned group id from bootstrap - #1243
Merged
Merged
Conversation
Bootstrap resolves a group (looking up by id, then by name, then creating one), but a store may regenerate the id it considers invalid — so the id the caller sent is not necessarily what was stored. Return the authoritative `group_id` in the response so a client can reconcile its files with the database instead of guessing. The CLI (primocms/primo-cli#32) writes it back to server.yaml and site.yaml.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughBootstrap success responses now include the resolved site group ID for both ZIP-import and no-ZIP paths. ChangesBootstrap response
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Feature 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
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
Bootstrap resolves a site's group by id → by name → create. But the store can regenerate a provided id, so the id the caller sent isn't necessarily the id that gets stored. Clients that mirror
server.yamltherefore drift from the database — the reported symptom wasserver.yamlsayingarchitecture1while the database held a generated id.Return the authoritative
group_idin the bootstrap response, in both branches (with and without an import), so a client can reconcile instead of guess.Verification
Built locally (
go build) and drove it withPRIMO_BINARYfrom the companion CLI change against a scratch workspace:All three now agree, where before the files kept the requested id and the database had a different one.
Companion
primocms/primo-cli#32 consumes this field and writes the id back into
server.yaml/site.yaml(and leaves name references alone). Older CLI versions ignore the new field.Notes
ensureBootstrapGroupstill tries to honor a provided id first — this just makes the actual result knowable when the store overrides it.Summary by CodeRabbit