IDE-5298: Improve federated auth error message to include AH_ORGANIZATION_UUID guidance - #2031
IDE-5298: Improve federated auth error message to include AH_ORGANIZATION_UUID guidance#2031deepakmishra2 wants to merge 2 commits into
Conversation
…TION_UUID guidance The existing hint only said "Run acli login" which was incomplete — users also need AH_ORGANIZATION_UUID exported first, and the order matters. Branch the help message on whether the env var is already set so Cloud IDE users (where the var is injected) get a different prompt than standalone users. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2031 +/- ##
=========================================
Coverage 92.49% 92.50%
- Complexity 1995 1996 +1
=========================================
Files 123 123
Lines 7238 7241 +3
=========================================
+ Hits 6695 6698 +3
Misses 543 543 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request updates the Federated Authentication-related error guidance emitted by ExceptionListener so that instructions differ depending on whether AH_ORGANIZATION_UUID is already present in the environment, and extends PHPUnit coverage for the new branching behavior.
Changes:
- Make the federated-auth help text conditional on
AH_ORGANIZATION_UUIDbeing set. - Update existing test expectations for the new “UUID not set” instructions.
- Add a new test covering the “UUID already set” branch (serial group due to env mutation).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/EventListener/ExceptionListener.php | Adds dynamic federated-auth remediation messages based on AH_ORGANIZATION_UUID. |
| tests/phpunit/src/Misc/ExceptionListenerTest.php | Updates provider expectations and adds a new test for the “UUID already set” branch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/2031/acli.phar |
|
@copilot can you apply the suggestion given by you |
Done. Replaced |
This pull request improves the guidance provided to users when they encounter authentication errors related to Federated Authentication. The main change is that the help message is now dynamic: it checks if the
AH_ORGANIZATION_UUIDenvironment variable is already set and provides tailored instructions accordingly. The test suite has also been updated to cover this new behavior.Improvements to error handling and user guidance:
ExceptionListener.phpto check forAH_ORGANIZATION_UUIDin the environment and provide step-by-step instructions based on its presence. If set, users are prompted to runacli auth:login; if not, users are guided to export the UUID first, then run the login command.Test coverage enhancements:
providerTestHelpinExceptionListenerTest.phpto match the new instructions for when the UUID is not set.testFederatedAuthHelpWithOrgUuidAlreadySet, to verify that the correct help message is shown whenAH_ORGANIZATION_UUIDis already present in the environment.Groupattribute import to support test grouping.