Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

settings: add the ANSIBLE_AI_ENABLE_ROLE_GEN_ENDPOINT config key #1529

Conversation

goneri
Copy link
Contributor

@goneri goneri commented Feb 12, 2025

Add ANSIBLE_AI_ENABLE_ROLE_GEN_ENDPOINT to be able to enable roleGen when needed.
This will later be enabled by default.

manstis
manstis previously approved these changes Feb 12, 2025
Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Minor comment... up to you what to do with it.

@@ -363,6 +363,9 @@ def invoke(self, params: RoleGenerationParameters) -> RoleGenerationResponse:
if outline:
data["outline"] = outline

if not settings.ANSIBLE_AI_ENABLE_ROLE_GEN_ENDPOINT:
Copy link
Contributor

Choose a reason for hiding this comment

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

IDK if it'd be clearer to move this closer to the start of the function?

e.g.

def invoke(self, params: PlaybookGenerationParameters) -> PlaybookGenerationResponse:
if settings.ANSIBLE_AI_ENABLE_PLAYBOOK_ENDPOINT:
return super().invoke(params)
else:
raise FeatureNotAvailable

The function performs some (potentially expensive) operations that are thrown away if not enabled.

Add `ANSIBLE_AI_ENABLE_ROLE_GEN_ENDPOINT` to be able to enable roleGen when needed.
This will later be enabled by default.
@goneri goneri force-pushed the goneri/settings-add-the-ANSIBLE_AI_ENABLE_ROLE_GEN_ENDPOINT-config-key_31333 branch from 67eadca to dd70716 Compare February 13, 2025 19:45
Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@goneri goneri merged commit 4f8cb13 into main Feb 18, 2025
11 checks passed
@goneri goneri deleted the goneri/settings-add-the-ANSIBLE_AI_ENABLE_ROLE_GEN_ENDPOINT-config-key_31333 branch February 18, 2025 13:05
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.

2 participants