Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pepicrft
Copy link
Contributor

@pepicrft pepicrft commented Jul 31, 2025

I'm noticed we already had okta_site in the organizations table but as sso_organization_id. This PR removes that extra column, and also updates the logic to get the OAuth2 info for a given organization to read the values from the organization entity.

Summary (Claude-generated)

This PR removes the redundant okta_site field from the organizations table. The sso_organization_id field serves the same purpose and eliminates confusion between the two fields.

Changes

Database Changes

  • ✅ Created migration to drop okta_site column from organizations table
  • ✅ Updated Organization schema to remove okta_site field and references

Code Changes

  • ✅ Updated Tuist.OAuth.Okta.config_for_organization/1 to use sso_organization_id instead of okta_site
  • ✅ Removed unused Environment APIs: okta_client_id_for_organization_id/2 and okta_client_secret_for_organization_id/2
  • ✅ Updated Accounts module to remove okta_site references
  • ✅ Updated all changesets to remove okta_site field

Test Changes

  • ✅ Updated Okta module tests to use sso_organization_id
  • ✅ Updated Accounts tests to remove okta_site references
  • ✅ Updated test fixtures to remove okta_site parameter

Test Results

  • ✅ All Okta tests pass (6/6)
  • ✅ All Accounts tests pass (155/155)
  • ✅ No linting issues with Credo
  • ✅ Clean compilation with no warnings

Breaking Changes

None - this is purely an internal data model simplification. The public API remains unchanged.

@dosubot dosubot bot added the size:L For issues that take up to a day to implement label Jul 31, 2025
@pepicrft pepicrft changed the title feat(server): remove redundant okta_site field from organizations chore(server): remove redundant okta_site field from organizations Jul 31, 2025
@dosubot dosubot bot added the type:enhancement New feature or request label Jul 31, 2025
@pepicrft pepicrft requested a review from cschmatzler July 31, 2025 14:33
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 1, 2025
Organizations.sso_organization_id serves the same purpose as organizations.okta_site.
This change eliminates the redundancy by:

- Updating Tuist.OAuth.Okta.config_for_organization to use sso_organization_id instead of okta_site
- Removing okta_site field from Organization schema and changesets
- Removing unused Environment APIs (okta_client_id_for_organization_id, okta_client_secret_for_organization_id)
- Creating migration to drop okta_site column
- Updating all tests to use sso_organization_id consistently

This simplifies the data model and eliminates potential confusion between the two fields.
@pepicrft pepicrft force-pushed the feat/remove-redundant-okta-site-field branch from 4bd8f35 to 80beca0 Compare August 1, 2025 09:26
@pepicrft pepicrft merged commit 4763ae0 into main Aug 1, 2025
13 checks passed
@pepicrft pepicrft deleted the feat/remove-redundant-okta-site-field branch August 1, 2025 09:42
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer size:L For issues that take up to a day to implement type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants