Pass organization_id when creating OAuth Applications
What does this MR do and why?
Backport of !9548 (merged) to 19-0-stable.
Adds DEFAULT_ORGANIZATION_ID = 1 and updates create_or_find_authorization to:
- Pass
organization_id: DEFAULT_ORGANIZATION_IDin thecreate!call for newly created OAuth applications. - Backfill
organization_idviaupdate_columnfor existing apps with a NULLorganization_idfound duringgitlab-ctl reconfigure.
This fixes a PG::CheckViolation on the check_77eda6baaa constraint of the oauth_applications table enforced by the post-deploy migration add_not_null_constraint_to_oauth_applications_organization_id, which causes post_deploy_db_migrations to fail during 19.0 upgrades.
This is the critical backport for GitLab Dedicated instances upgrading from 18.11 → 19.0. See https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/team/-/work_items/12901#note_3490075217 for the original report.
Note: This targets
19-0-stablewhich is outside the current maintenance policy. Release manager approval is required via#releasesSlack.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
- The original MR has been deployed to GitLab.com (not applicable for documentation or spec changes).
- This MR has a severity label assigned (if applicable).
Note to the merge request author and maintainer
If you have questions about the patch release process, please:
- Refer to the patch release runbook for engineers and maintainers for guidance.
- Ask questions on the
#releasesSlack channel (internal only).