Skip to content

refactor: organize OAuth2 provider tests into dedicated packages #18747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ThomasK33
Copy link
Member

OAuth2 Provider Code Reorganization

This PR reorganizes the OAuth2 provider code to improve separation of concerns and maintainability. The changes include:

  1. Migrating OAuth2 provider app validation tests from coderd/oauth2_test.go to oauth2provider/provider_test.go
  2. Moving OAuth2 client registration validation tests to oauth2provider/validation_test.go
  3. Adding new comprehensive test files for metadata and validation edge cases
  4. Renaming OAuth2ProviderAppSecret to AppSecret for better naming consistency
  5. Simplifying the main integration test in oauth2_test.go to focus on core functionality

The PR maintains all existing test coverage while organizing the code more logically, making it easier to understand and maintain the OAuth2 provider implementation. This reorganization will help with future enhancements to the OAuth2 provider functionality.

@ThomasK33 ThomasK33 marked this pull request as ready for review July 3, 2025 15:01
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from 15cf36d to 18ac26b Compare July 3, 2025 15:16
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_package branch from 74ada5e to 94f8522 Compare July 3, 2025 15:16
@ThomasK33 ThomasK33 changed the title refactor: move OAuth2 provider tests to dedicated packages for better organization refactor: organize OAuth2 provider tests into dedicated packages Jul 3, 2025
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_package branch from 94f8522 to c160ba6 Compare July 3, 2025 16:37
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from 18ac26b to 8d14c45 Compare July 3, 2025 16:37
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_package branch from c160ba6 to 912fd87 Compare July 3, 2025 16:53
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from 8d14c45 to a97c96a Compare July 3, 2025 16:54
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_package branch from 912fd87 to a2737b7 Compare July 3, 2025 17:15
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from a97c96a to c261955 Compare July 3, 2025 17:15
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_package branch from a2737b7 to 865dc56 Compare July 3, 2025 17:29
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from c261955 to 2822d49 Compare July 3, 2025 17:29
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_package branch from 865dc56 to 1f89b53 Compare July 3, 2025 17:45
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from 2822d49 to b6bbf89 Compare July 3, 2025 17:45
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_package branch 2 times, most recently from db0f2a0 to a586976 Compare July 3, 2025 18:10
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from b6bbf89 to 572628e Compare July 3, 2025 18:10
@ThomasK33 ThomasK33 changed the base branch from thomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_package to graphite-base/18747 July 3, 2025 18:24
@ThomasK33 ThomasK33 force-pushed the graphite-base/18747 branch from a586976 to c650133 Compare July 3, 2025 18:25
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from 572628e to 7af15df Compare July 3, 2025 18:25
@graphite-app graphite-app bot changed the base branch from graphite-base/18747 to main July 3, 2025 18:25
- Create oauth2provider/metadata_test.go with OAuth2 metadata endpoint tests
- Create oauth2provider/validation_test.go with comprehensive client validation tests
- Create oauth2provider/provider_test.go with provider app and registration tests
- Remove duplicated tests from coderd/oauth2_test.go, keep integration tests
- Fix lint issues in oauth2providertest package naming
- Improve test organization with unit tests separated from integration tests
- Maintain 100% test coverage while enabling faster test execution

Change-Id: I99aac9f53df95eed3135d895781831a4a2749f6a
Signed-off-by: Thomas Kosiewski <[email protected]>
@ThomasK33 ThomasK33 force-pushed the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch from 7af15df to 860ba25 Compare July 3, 2025 18:25
@ThomasK33 ThomasK33 merged commit 4607e51 into main Jul 3, 2025
35 checks passed
Copy link
Member Author

Merge activity

@ThomasK33 ThomasK33 deleted the thomask33/07-03-refactor_oauth2_migrate_test_files_to_oauth2provider_package branch July 3, 2025 18:41
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants