Skip to content

IDE-5298: Improve federated auth error message to include AH_ORGANIZATION_UUID guidance - #2031

Draft
deepakmishra2 wants to merge 2 commits into
mainfrom
IDE-5298
Draft

IDE-5298: Improve federated auth error message to include AH_ORGANIZATION_UUID guidance#2031
deepakmishra2 wants to merge 2 commits into
mainfrom
IDE-5298

Conversation

@deepakmishra2

Copy link
Copy Markdown
Contributor

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_UUID environment 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:

  • Updated the help messages in ExceptionListener.php to check for AH_ORGANIZATION_UUID in the environment and provide step-by-step instructions based on its presence. If set, users are prompted to run acli auth:login; if not, users are guided to export the UUID first, then run the login command.

Test coverage enhancements:

  • Updated the expected help messages in providerTestHelp in ExceptionListenerTest.php to match the new instructions for when the UUID is not set.
  • Added a new test, testFederatedAuthHelpWithOrgUuidAlreadySet, to verify that the correct help message is shown when AH_ORGANIZATION_UUID is already present in the environment.
  • Added the Group attribute import to support test grouping.

…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>
Copilot AI review requested due to automatic review settings July 30, 2026 07:50
@deepakmishra2 deepakmishra2 self-assigned this Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.50%. Comparing base (92c4337) to head (017c7c1).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_UUID being 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.

Comment thread tests/phpunit/src/Misc/ExceptionListenerTest.php Outdated
Comment thread src/EventListener/ExceptionListener.php Outdated
@github-actions

Copy link
Copy Markdown

Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/2031/acli.phar

curl -OL https://acquia-cli.s3.amazonaws.com/build/pr/2031/acli.phar
chmod +x acli.phar

@deepakmishra2

Copy link
Copy Markdown
Contributor Author

@copilot can you apply the suggestion given by you

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown

@copilot can you apply the suggestion given by you

Done. Replaced <uuid> with YOUR_ORG_UUID in both ExceptionListener.php (line 100) and the matching test expectation in ExceptionListenerTest.php (line 131), so the placeholder is safe from Symfony Console's output formatter. Committed in fa47f97.

@deepakmishra2
deepakmishra2 marked this pull request as draft July 30, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants