[minor] Add --aiservice-install-plan-approval CLI parameter support#2233
[minor] Add --aiservice-install-plan-approval CLI parameter support#2233Sakshi-Singhroha1 wants to merge 22 commits intomasterfrom
Conversation
…-aiservice-install-plan-approval
mnivedithaa
left a comment
There was a problem hiding this comment.
Please cleanup the commented lines, resolve the conflicts.
Also you need to update gitops_aiservice pipeline and task changes here as well (changes done in saas-tekton)
|
|
||
|
|
||
|
|
||
| masAppsArgGroup.add_argument( |
There was a problem hiding this comment.
Is this arg required for cli?
There was a problem hiding this comment.
Yes, This accepts and validates user input.
Without this, the CLI won't recognize the --aiservice-install-plan-approval flag
| @@ -343,6 +340,11 @@ def buildCommand(self) -> str: | |||
| if self.getParam('aiservice_channel') != "": | |||
| command += f" --aiservice-channel \"{self.getParam('aiservice_channel')}\"{newline}" | |||
|
|
|||
|
|
|||
| if self.getParam('aiservice_install_plan_approval') != "": | |||
There was a problem hiding this comment.
Is this arg required for cli?
There was a problem hiding this comment.
Yes, this passes the parameter to the gitops-aiservice function.
Without this, the parameter is accepted but never used
…and updated gitops_aiservice pipeline and task
whitfiea
left a comment
There was a problem hiding this comment.
Please see comments.
Also I would expect that the aiservice-tenant would have the same setting as I thought was was now a subscription itself? I don't think it would make sense to have the aiservice as manual and the aiservice-tenant has automatic
| --aiservice-channel ${TEXT_RESET}AISERVICE_CHANNEL${TEXT_RESET} | ||
| --mas-catalog-source ${TEXT_RESET}MAS_CATALOG_SOURCE${TEXT_RESET} | ||
|
|
||
| --aiservice-install-plan-approval ${TEXT_RESET}AISERVICE_INSTALL_PLAN_APPROVAL${TEXT_RESET} |
There was a problem hiding this comment.
this should be under ibm aiservice(required): lines 23:26
There was a problem hiding this comment.
I’ve updated the code and placed it under ibm aiservice (required)
|
|
||
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
I’ve cleaned up the unnecessary whitespace.
There was a problem hiding this comment.
Everything under the python package is used for the non-gitops cli installer, if we are not making changes for the non-gitops then we shouldn't have any changes under this python folder.
There was a problem hiding this comment.
This shouldn't be needed if this is gitops only
…subscription installPlanApproval change
JIRA:
MASCORE-12745 https://jsw.ibm.com/browse/MASCORE-12745
MASCORE-13410 https://jsw.ibm.com/browse/MASCORE-13410
MASCORE-13462 https://jsw.ibm.com/browse/MASCORE-13462
Problem: The AIService operator subscription's installPlanApproval field was hardcoded as "Automatic" in the GitOps templates. This prevented users from controlling whether operator updates require manual approval or install automatically.
Requirement: Add CLI parameter support for configurable --aiservice-install-plan-approval flag, allowing users to specify install plan approval strategy and pass it to GitOps templates.
Why these changes are needed:
CLI needs to accept install plan approval parameter from Tekton pipeline
Parameter must be passed to GitOps templates for Kubernetes Subscription configuration
Enables teams to control operator upgrade behavior per environment (Manual for production, Automatic for dev/test)
Provides default value "Automatic" for backward compatibility
Completes the parameter flow: saas-envs → Tekton → CLI → GitOps → Kubernetes
What was changed:
This PR adds comprehensive CLI parameter support for the AIService operator install plan approval setting across bash functions, Python argument parsers, and Jinja templates.
Changes made:
File 1: image/cli/mascli/functions/gitops_aiservice
Line 37 - Added parameter to help text:
Line 91 - Added default value:
Lines 178-180 - Added parameter parsing:
Line 355 - Added parameter display in summary:
File 2: image/cli/mascli/templates/gitops/appset-configs/cluster/instance/ibm-aiservice.yaml.j2
Lines 48-49 - Added template variable:
File 3: python/src/mas/cli/aiservice/install/argBuilder.py
Lines 83-85 - Added parameter to command builder:
File 4: python/src/mas/cli/aiservice/install/argParser.py
Lines 176-184 - Added argument parser:
File 5: python/src/mas/cli/aiservice/install/params.py
Line 113 - Added parameter to params list:
File 6: python/src/mas/cli/install/argBuilder.py
Lines 344-346 - Added parameter to install command builder:
File 7: python/src/mas/cli/install/argParser.py
Lines 532-540 - Added argument parser for install command:
File 8: python/src/mas/cli/install/params.py
Line 221 - Added parameter to install params list:
File 9: tekton/src/params/install-aiservice.yml.j2
Lines 19-23 - Added Tekton parameter definition:
Impact:
✅ CLI accepts --aiservice-install-plan-approval parameter
✅ Only accepts "Automatic" or "Manual" values (enforced by argparse choices)
✅ Parameter flows to GitOps templates via environment variable AISERVICE_INSTALL_PLAN_APPROVAL
✅ Default value "Automatic" ensures backward compatibility
✅ Enables Manual or Automatic operator upgrade control per environment
✅ No breaking changes to existing CLI usage
Testing performed:
CLI Parameter Testing:
✅ Validated parameter parsing in bash function
✅ Confirmed parameter validation in Python argparse (accepts only "Automatic" or "Manual")
✅ Verified default value "Automatic" is set correctly
✅ Tested parameter passing to GitOps template
Deployment Verification:
✅ Deployed to noble8 ArgoCD cluster
✅ CLI command with --aiservice-install-plan-approval "Manual" executed successfully
✅ CLI command with --aiservice-install-plan-approval "Automatic" executed successfully
✅ GitOps configuration generated with correct aiservice_install_plan_approval value
Test Results:
✅ Parameter accepted by CLI
✅ Accepts valid values ("Manual", "Automatic")
✅ Rejects invalid values with error message
✅ Template renders correctly with parameter value
✅ Deployment to noble8 cluster successful
Related Pull Requests:
This change is part of a multi-repository feature implementation for MASCORE-12745:
saas-envs-starter: PR#158 - Added prompts and template parameters for install plan configuration
saas-deploy-py: PR#266 - Added JSON schema validation for aiservice_install_plan_approval field
saas-tekton: PR #223 - Added Tekton pipeline support for aiservice_install_plan_approval parameter
ibm-mas/gitops: PR #447 -Added configurable install plan approval for AIService operator