diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 771c62fcf..349647422 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -118,4 +118,4 @@ jobs: sleep 10 make create-cachetable make update-openapi-schema - git diff --exit-code -- tools/openapi-schema/ansible-wisdom-service.yaml + git diff --exit-code -- tools/openapi-schema/ansible-ai-connect-service.yaml diff --git a/Makefile b/Makefile index 7795c8599..ca67dfbd5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ ENVIRONMENT ?= development TAG ?= latest +ANSIBLE_AI_PROJECT_NAME ?= "Ansible AI Connect" # Choose between docker and podman based on what is available ifeq (, $(shell which podman)) @@ -91,7 +92,7 @@ stop-backends: .PHONY: update-openapi-schema # Update OpenAPI 3.0 schema while running the service in development env update-openapi-schema: - curl -X GET http://localhost:8000/api/schema/ -o tools/openapi-schema/ansible-wisdom-service.yaml + curl -X GET http://localhost:8000/api/schema/ -o tools/openapi-schema/ansible-ai-connect-service.yaml .PHONY: docker-compose-clean docker-compose-clean: @@ -126,7 +127,7 @@ create-superuser: create-cachetable .PHONY: create-application create-application: create-superuser - wisdom-manage createapplication --name "Ansible Lightspeed for VS Code" --client-id Vu2gClkeR5qUJTUGHoFAePmBznd6RZjDdy5FW2wy --redirect-uris "vscode://redhat.ansible" public authorization-code + wisdom-manage createapplication --name "${ANSIBLE_AI_PROJECT_NAME} for VS Code" --client-id Vu2gClkeR5qUJTUGHoFAePmBznd6RZjDdy5FW2wy --redirect-uris "vscode://redhat.ansible" public authorization-code .PHONY: test test: diff --git a/README.md b/README.md index 8ad4250f6..b88f41cf1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Red Hat Ansible Lightspeed with IBM watsonx Code Assistant. -- [Red Hat Ansible Lightspeed with IBM watsonx Code Assistant.](#red-hat-ansible-lightspeed-with-ibm-watsonx-code-assistant) +# Ansible AI Connect. +- [Ansible AI Connect.](#ansible-ai-connect) - [Wisdom Service](#wisdom-service) - [Admin Portal](#admin-portal) - [Using pre-commit](#using-pre-commit) @@ -419,7 +419,7 @@ and then run the Django command to create the application: ```bash wisdom-manage createapplication \ - --name "Ansible Lightspeed for VS Code" \ + --name "Ansible AI Connect for VS Code" \ --client-id Vu2gClkeR5qUJTUGHoFAePmBznd6RZjDdy5FW2wy \ --redirect-uris "vscode://redhat.ansible vscodium://redhat.ansible vscode-insiders://redhat.ansible code-oss://redhat.ansible checode://redhat.ansible" \ public authorization-code @@ -545,7 +545,7 @@ You can enable postprocess with [Ansible Lint](https://github.com/ansible/ansibl ## Application metrics as a Prometheus-style endpoint We enabled the Prometheus endpoint to scrape the configuration and check the service status to build observability into -the Lightspeed service for monitoring and measuring its availability. +the service for monitoring and measuring its availability. To provide feedback for operational needs as well as for continuous service improvement. @@ -558,7 +558,7 @@ the development environment only**. - **Note:** It is not enabled in the production environment regardless of any settings. -If you want to test Lightspeed APIs using Swagger UI, +If you want to test APIs using Swagger UI, 1. Open http://localhost:8000/ and get an authentication token by following the instructions described in the @@ -581,7 +581,7 @@ Another OpenAPI UI in the ReDoc format is also available at http://localhost:80 ### OpenAPI 3.0 Schema The static OpenAPI Schema YAML file is stored as -[/tools/openapi-schema/ansible-wisdom-service.yaml](https://github.com/ansible/ansible-wisdom-service/blob/main/tools/openapi-schema/ansible-wisdom-service.yaml) +[/tools/openapi-schema/ansible-ai-connect-service.yaml](https://github.com/ansible/ansible-ai-connect-service/blob/main/tools/openapi-schema/ansible-ai-connect-service.yaml) in this repository. When you make code changes, please update the static OpenAPI Schema YAML file @@ -642,7 +642,7 @@ If the execution was successful, results in HTML are showin in Chrome. For executing unit tests from command line, You need to set some environment variables -that are read by Lightspeed Service. +that are read by the Service. If you are using PyCharm for development, you can use [the EnvFile plugin](https://plugins.jetbrains.com/plugin/7861-envfile) with the following `.env` file: diff --git a/ansible_wisdom/ai/api/permissions.py b/ansible_wisdom/ai/api/permissions.py index bdbb31c92..9cc277129 100644 --- a/ansible_wisdom/ai/api/permissions.py +++ b/ansible_wisdom/ai/api/permissions.py @@ -59,7 +59,9 @@ class BlockUserWithoutSeatAndWCAReadyOrg(permissions.BasePermission): """ code = 'permission_denied__org_ready_user_has_no_seat' - message = "Org's LightSpeed subscription is active but user has no seat." + message = ( + f"Org's {settings.ANSIBLE_AI_PROJECT_NAME} subscription is active but user has no seat." + ) def has_permission(self, request, view): user = request.user diff --git a/ansible_wisdom/ai/api/serializers.py b/ansible_wisdom/ai/api/serializers.py index c851ca7df..8fb20c68f 100644 --- a/ansible_wisdom/ai/api/serializers.py +++ b/ansible_wisdom/ai/api/serializers.py @@ -259,7 +259,7 @@ class Meta: required=False, label='Additional Comment', help_text='Additional comment describing why the \ - change was required in Lightspeed suggestion.', + change was required in suggestion.', ) diff --git a/ansible_wisdom/healthcheck/views.py b/ansible_wisdom/healthcheck/views.py index e5e266ae7..675b59238 100644 --- a/ansible_wisdom/healthcheck/views.py +++ b/ansible_wisdom/healthcheck/views.py @@ -87,7 +87,7 @@ def render_to_response_json(self, plugins, status, user): # customize JSON outp class WisdomServiceHealthView(APIView): """ - Lightspeed Service Health Check + Service Health Check """ permission_classes = [permissions.AllowAny] @@ -134,7 +134,7 @@ def get(self, request, *args, **kwargs): class WisdomServiceLivenessProbeView(APIView): """ - Lightspeed Service Liveness Probe View + Service Liveness Probe View """ permission_classes = [permissions.AllowAny] diff --git a/ansible_wisdom/main/settings/base.py b/ansible_wisdom/main/settings/base.py index 11eef5ab4..3516d1d89 100644 --- a/ansible_wisdom/main/settings/base.py +++ b/ansible_wisdom/main/settings/base.py @@ -17,6 +17,7 @@ # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +ANSIBLE_AI_PROJECT_NAME = os.getenv("ANSIBLE_AI_PROJECT_NAME") or "Ansible AI Connect" # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ diff --git a/ansible_wisdom/main/settings/development.py b/ansible_wisdom/main/settings/development.py index fb5fdc256..f016bea7e 100644 --- a/ansible_wisdom/main/settings/development.py +++ b/ansible_wisdom/main/settings/development.py @@ -7,7 +7,7 @@ if DEBUG: SPECTACULAR_SETTINGS = { - 'TITLE': 'Ansible Lightspeed with IBM watsonx Code Assistant.', + 'TITLE': f'{ANSIBLE_AI_PROJECT_NAME}.', # noqa: F405 'DESCRIPTION': 'Equip the automation developer at Lightspeed.', 'VERSION': '0.0.8', 'SERVE_INCLUDE_SCHEMA': False, diff --git a/ansible_wisdom/main/templates/base.html b/ansible_wisdom/main/templates/base.html index b94f2aa58..0079437ed 100644 --- a/ansible_wisdom/main/templates/base.html +++ b/ansible_wisdom/main/templates/base.html @@ -2,7 +2,7 @@
-NOTE: Due to overwhelming positive demand, we have extended the availability of the Ansible Lightspeed Technical Preview from December 31, 2023 to March 11, 2024.
+NOTE: Due to overwhelming positive demand, we have extended the availability of the {{ project_name }} Technical Preview from December 31, 2023 to March 11, 2024.
- The Ansible Lightspeed Technical Preview is no longer available. For continued access to the commercial service, please see Getting started with Red Hat Ansible Lightspeed with IBM watsonx Code Assistant. + The {{ project_name }} Technical Preview is no longer available. For continued access to the commercial service, please see Getting started with {{ project_name }}.
- You are a Red Hat organization administrator for Ansible Lightspeed. IBM watsonx Code Assistant model settings have not been configured for your organization. - Click here to access the Lightspeed admin portal to complete configuration. + You are a Red Hat organization administrator for {{ project_name }}. IBM watsonx Code Assistant model settings have not been configured for your organization. + Click here to access the {{ project_name }} admin portal to complete configuration.
- You do not have a licensed seat for Ansible Lightspeed and your organization has configured a commercial model. + You do not have a licensed seat for {{ project_name }} and your organization has configured a commercial model. Contact your Red Hat account organization administrator for more information on how to assign a named seat.
@@ -33,7 +33,7 @@- You do not have a licensed seat for Ansible Lightspeed. You will be limited to features of the Lightspeed tech preview until you are assigned a named seat. + You do not have a licensed seat for {{ project_name }}. You will be limited to features of the {{ project_name }} tech preview until you are assigned a named seat. Contact your Red Hat account organization administrator for more information on how to assign a named seat.
@@ -55,7 +55,7 @@Your organization doesn't have access to Ansible Lightspeed. +
Your organization doesn't have access to {{ project_name }}.
Contact your Red Hat Organization's administrator for more information. @@ -69,7 +69,7 @@
Contact your Red Hat Organization's administrator for more information on how to get a licensed seat. @@ -82,8 +82,8 @@
You are a licensed Lightspeed user but your administrator has not configured the service for your organization. -
Contact your organization administrator to have them complete Lightspeed configuration. +
You are a licensed {{ project_name }} user but your administrator has not configured the service for your organization. +
Contact your organization administrator to have them complete {{ project_name }} configuration.
Contact your Red Hat Organization's administrator for more information. @@ -91,10 +91,10 @@