refactor: organize app constants in Application#1030
Draft
saw-jan wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
PHP Code CoverageCoverage after merging refactor/organize-app-consts into release/2.11 will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
Centralizes app-wide constants (auth methods, OIDC provider types/labels, scopes, minimum supported app versions) into lib/AppInfo/Application.php, replacing duplicated/scattered definitions in OpenProjectAPIService and SettingsService, and updates all backend code and tests to reference the new locations.
Changes:
- Adds
AUTH_METHOD_*,NEXTCLOUD_HUB_OIDC_PROVIDER_TYPE/LABEL,EXTERNAL_OIDC_PROVIDER_TYPE, andMIN_SUPPORTED_*_VERSIONconstants toApplication, removing them from the service classes. - Updates all production references (
SettingsService,OpenProjectAPIService,ConfigController,Admin, listeners,TokenEventFactory, migration) to useApplication::.... - Updates all corresponding tests to use the new
Application::constant names.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/AppInfo/Application.php | Adds centralized constants; minor cleanup using self::APP_ID in registerNavigation. |
| lib/Service/SettingsService.php | Removes duplicated constants; uses Application:: constants in validation. |
| lib/Service/OpenProjectAPIService.php | Removes duplicated constants; switches all references to Application::. |
| lib/Controller/ConfigController.php | Replaces service-class constants with Application:: constants. |
| lib/Settings/Admin.php | Uses Application:: constants for auth method and minimum versions. |
| lib/Listener/LoadAdditionalScriptsListener.php | Uses Application::AUTH_METHOD_OIDC. |
| lib/Listener/OpenProjectReferenceListener.php | Uses Application::AUTH_METHOD_OIDC. |
| lib/TokenEventFactory.php | Uses Application::NEXTCLOUD_HUB_OIDC_PROVIDER_TYPE; drops unused import. |
| lib/Migration/Version2900Date20250718065820.php | Uses Application::AUTH_METHOD_OAUTH. |
| tests/lib/Controller/ConfigControllerTest.php | Test data updated to new constants. |
| tests/lib/Controller/OpenProjectAPIControllerTest.php | Test data updated; adds Application import. |
| tests/lib/Controller/OpenProjectControllerTest.php | Test data updated to new constants. |
| tests/lib/Listener/LoadSidebarScriptTest.php | Test data updated to new constants. |
| tests/lib/Service/OpenProjectAPIServiceTest.php | Test data updated across many cases. |
| tests/lib/Service/SettingsServiceTest.php | Test data updated to new constants. |
| tests/lib/Settings/AdminTest.php | Test data updated; drops SettingsService import. |
| tests/lib/Settings/PersonalTest.php | Test data updated to new constants. |
| tests/lib/TokenEventFactoryTest.php | Test data updated; drops unused import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Related Issue or Workpackage
Types of changes
Checklist:
CHANGELOG.mdfile