Append WCA suffix to project title based on service configuration #1734
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.
Jira Issue: https://issues.redhat.com/browse/AAP-51590
Assisted-by: claude-code
Description
An alternative approach to #1729
This approach is a bit of the inverse of the other approach. With these changes, the WCA bits are appended to the end of the project name and displayed on the login screen so long as one of the pipelines is configured with a wca provider. This means that the project name no longer needs to contain the WCA bits as the suffix will be added programatically. I set the default suffix in a new environment variable called
ANSIBLE_AI_PROJECT_WCA_SUFFIX
. We could hard code the suffix in the application code but I thought it would be nice to have the ability to overwrite it with a variable if needed (but this can be easily changed).This PR also adds the /chatbot "next" query parameter logic so that the suffix is not added if the user is attempting to navigate straight to the chatbot (which was the original issue outlined in https://issues.redhat.com/browse/AAP-50250
Note that I did add logic to NOT append the suffix if the suffix is already present in the project name. That means that (I think) these changes should not impact any current deployments of the ai-connect-service. In order to FULLY address AAP-50250 we'll need to make sure that any lightspeed service with an
ANSIBLE_AI_PROJECT_NAME
that includes the WCA suffix is updated to have the WCA suffix removed (so that the application code begins adding it dynamically).Testing
You can also remove the wca pipeline from your config and the suffix should go away
You can also navigate straight the chatbot endpoint (/chatbot) unauthenticated and the suffix should not be present on the login screen
Scenarios tested
Production deployment