[GIT-243]fix: InstanceConfiguration not created for some keys#9303
[GIT-243]fix: InstanceConfiguration not created for some keys#9303sangeethailango wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesInstance Configuration Initialization Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the configure_instance management command so it creates only missing auth-provider instance configuration keys (Google/GitHub/GitLab/Gitea) instead of treating “any key exists” as “all keys exist”.
Changes:
- Fetches the subset of existing keys from
InstanceConfigurationand computesmissing_keys. - Creates configuration rows only for keys that are actually missing.
| if missing_keys: | ||
| for key in missing_keys: | ||
| if key == "IS_GOOGLE_ENABLED": |
| existed_keys = InstanceConfiguration.objects.filter(key__in=keys).values_list("key", flat=True) | ||
| missing_keys = set(keys) - set(existed_keys) | ||
|
|
||
| if missing_keys: | ||
| for key in missing_keys: |
This pull request improves the handling of instance configuration setup by ensuring that only missing configuration keys are created, rather than always attempting to create all keys if any are missing.
Configuration management improvement:
configure_instance.pyto identify which of the required keys (IS_GOOGLE_ENABLED,IS_GITHUB_ENABLED,IS_GITLAB_ENABLED,IS_GITEA_ENABLED) are missing, and only create those, avoiding redundant creation attempts for keys that already exist.Summary by CodeRabbit