Skip to content

Conversation

mabashian
Copy link
Member

Jira Issue: https://issues.redhat.com/browse/AAP-50250

Assisted-by: claude-code

Description

This is a bit of a messy "problem" to solve. The project name comes in via a setting which we append to the end of "Log in to " on the login page. The approach I've taken is to check to see if the ?next query param starts with /chatbot and then find/replace the intended text with an empty string. I don't think this is a particularly clever approach nor is it robust. If the setting (ANSIBLE_AI_PROJECT_NAME) string changes just a bit, this logic may break. I also don't love hard-coding references to WCA in the view. I'm open to suggestions for alternative ways to achieve this (or push back saying that this is a bad idea and we shouldn't do it).

Testing

  1. Pull down the PR
  2. Make sure that ANSIBLE_AI_PROJECT_NAME is set to 'Ansible Lightspeed with IBM watsonx Code Assistant' (note that I also had to add - ANSIBLE_AI_PROJECT_NAME=${ANSIBLE_AI_PROJECT_NAME} to compose.yml)
  3. Run the ai-connect-service
  4. Navigate to /login (should see the full project name)
  5. Navigate to /chatbot unauthenticated (should be redirected to /login and see the name without the WCA bits)

Scenarios tested

  1. Login screen renders correctly when no "next" param present
  2. Login screen renders correctly when "next" param is something other than /chatbot
  3. Login screen renders correctly when "next" param starts with /chatbot

Production deployment

  • This code change is ready for production on its own
  • This code change requires the following considerations before going to production:

@manstis
Copy link
Contributor

manstis commented Aug 5, 2025

Have you thought of an inverse approach, i.e. add " with WatsonX blah blah" if Wisdom Service is configured to use WCA? All AI features are defined in "ModelPipelines" and each has a Provider ID. It'd be quite simple to iterate them and check for wca or wca-onprem and add the extra text.

I'm not at my laptop now but can talk more later if you're interested.

@mabashian
Copy link
Member Author

@manstis that's an interesting idea - let me take a look at that as an alternative. That sounds like it could be a more clean solution.

@mabashian mabashian marked this pull request as ready for review August 12, 2025 15:54
The login view now removes 'with IBM watsonx Code Assistant' from the project name when the 'next' parameter is '/chatbot' or '/chatbot/'. Tests were added to verify this behavior and ensure the project name remains unchanged in other cases.
Removed unnecessary trailing whitespace in the get_context_data method of LoginView
@mabashian mabashian force-pushed the mabashian/AAP-50250-login-page-text branch from 4d8e49a to a84cf09 Compare August 13, 2025 17:52
Copy link

Copy link
Contributor

@goneri goneri left a comment

Choose a reason for hiding this comment

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

Good enough for now.

@mabashian
Copy link
Member Author

OK so the plan is to merge this PR and then revert it in #1734 and address this with a proper fix. This should be good enough for now and #1734 won't change the UX (just fix the technical debt).

@mabashian mabashian merged commit 00d92f6 into main Aug 14, 2025
12 checks passed
@mabashian mabashian deleted the mabashian/AAP-50250-login-page-text branch August 14, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants