Skip to content

Commit f868c9e

Browse files
committed
Revert "AAP-37014: Make Wisdom's Chatbot interfaces available to RH employees only (#1443)"
This reverts commit ce8aa94.
1 parent 6a6e8ac commit f868c9e

File tree

12 files changed

+96
-210
lines changed

12 files changed

+96
-210
lines changed

.tekton/ansible-ai-connect-service-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ spec:
6969
- name: name
7070
value: summary
7171
- name: bundle
72-
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.2
72+
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.2@sha256:ac5b078500566c204eaa23e3aea1e2f7e003ac750514198419cb322a2eaf177a
7373
- name: kind
7474
value: task
7575
resolver: bundles

ansible_ai_connect/ai/api/model_pipelines/dummy/pipelines.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@
9898
},
9999
]
100100

101-
ROLE_OUTLINE = """
102-
1. Install the Nginx packages
103-
2. Start the service
104-
"""
105-
106-
PLAYBOOK_OUTLINE = """
101+
OUTLINE = """
107102
1. First, ensure that your RHEL 9 system is up-to-date.
108103
2. Next, you install the Nginx package using the package manager.
109104
3. After installation, start the ginx service.
@@ -167,7 +162,9 @@ def __init__(self, config: DummyConfiguration):
167162

168163
def invoke(self, params: PlaybookGenerationParameters) -> PlaybookGenerationResponse:
169164
create_outline = params.create_outline
170-
return PLAYBOOK, PLAYBOOK_OUTLINE.strip() if create_outline else "", []
165+
if create_outline:
166+
return PLAYBOOK, OUTLINE, []
167+
return PLAYBOOK, "", []
171168

172169
def self_test(self) -> Optional[HealthCheckSummary]:
173170
raise NotImplementedError
@@ -181,7 +178,7 @@ def __init__(self, config: DummyConfiguration):
181178

182179
def invoke(self, params: RoleGenerationParameters) -> RoleGenerationResponse:
183180
create_outline = params.create_outline
184-
return "install_nginx", ROLE_FILES, ROLE_OUTLINE.strip() if create_outline else ""
181+
return "install_nginx", ROLE_FILES, OUTLINE if create_outline else ""
185182

186183
def self_test(self) -> Optional[HealthCheckSummary]:
187184
raise NotImplementedError

ansible_ai_connect/ai/api/serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ class GenerationWarningResponseSerializer(serializers.Serializer):
608608
class GenerationRoleFileEntrySerializer(serializers.Serializer):
609609
path = serializers.CharField()
610610
content = serializers.CharField()
611-
file_type = serializers.CharField()
611+
fileType = serializers.CharField()
612612

613613

614614
class GenerationResponseSerializer(serializers.Serializer):
@@ -625,7 +625,7 @@ class GenerationResponseSerializer(serializers.Serializer):
625625

626626

627627
class GenerationRoleResponseSerializer(serializers.Serializer):
628-
role = serializers.CharField(help_text=("Name of the role."))
628+
name = serializers.CharField()
629629
files = serializers.ListField(child=GenerationRoleFileEntrySerializer())
630630
generationId = serializers.UUIDField(
631631
format="hex_verbose",

ansible_ai_connect/ai/api/tests/test_views.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3975,7 +3975,6 @@ def setUp(self):
39753975
super().setUp()
39763976
(org, _) = Organization.objects.get_or_create(id=123, telemetry_opt_out=False)
39773977
self.user.organization = org
3978-
self.user.rh_employee = True
39793978

39803979
@staticmethod
39813980
def mocked_requests_post(*args, **kwargs):
@@ -4283,7 +4282,6 @@ def test_chat_rate_limit(self):
42834282
)
42844283
(org, _) = Organization.objects.get_or_create(id=123, telemetry_opt_out=False)
42854284
self.user2.organization = org
4286-
self.user2.rh_employee = True
42874285
# Call chart API five times using self.user2
42884286
for i in range(5):
42894287
self.assert_test(TestChatView.VALID_PAYLOAD, user=self.user2)
@@ -4292,18 +4290,3 @@ def test_chat_rate_limit(self):
42924290
finally:
42934291
if self.user2:
42944292
self.user2.delete()
4295-
4296-
def test_not_rh_employee_user(self):
4297-
try:
4298-
username = "u" + "".join(random.choices(string.digits, k=5))
4299-
self.user2 = get_user_model().objects.create_user(
4300-
username=username,
4301-
)
4302-
self.user2.organization = Organization.objects.get_or_create(
4303-
id=123, telemetry_opt_out=False
4304-
)[0]
4305-
self.user2.rh_employee = False
4306-
self.assert_test(TestChatView.VALID_PAYLOAD, expected_status_code=403, user=self.user2)
4307-
finally:
4308-
if self.user2:
4309-
self.user2.delete()

ansible_ai_connect/ai/api/views.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
)
9999
from ansible_ai_connect.users.models import User
100100

101-
from ...main.permissions import IsRHEmployee, IsTestUser
102101
from ...users.throttling import EndpointRateThrottle
103102
from ..feature_flags import FeatureFlags
104103
from .data.data_model import ContentMatchPayloadData, ContentMatchResponseDto
@@ -1120,7 +1119,6 @@ class ChatEndpointThrottle(EndpointRateThrottle):
11201119
permission_classes = [
11211120
permissions.IsAuthenticated,
11221121
IsAuthenticatedOrTokenHasScope,
1123-
IsRHEmployee | IsTestUser,
11241122
]
11251123
required_scopes = ["read", "write"]
11261124
throttle_classes = [ChatEndpointThrottle]

ansible_ai_connect/users/one_click_trial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def __init__(self, user):
1212
def is_available(self):
1313
return (
1414
settings.ANSIBLE_AI_ENABLE_ONE_CLICK_TRIAL
15-
and self.user.organization
1615
and self.user.is_authenticated
1716
and self.user.is_oidc_user
1817
and self.user.rh_org_has_subscription

ansible_ai_connect_chatbot/package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)