-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: add new pre-commit hook: validate ibm_catalog.json inputs #1080
base: main
Are you sure you want to change the base?
Conversation
from subprocess import PIPE, Popen | ||
|
||
IBM_CATALOG_FILE = "ibm_catalog.json" | ||
DA_FOLDER = "solutions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all DAs will be in a solutions folder (for example landing zone in in patterns folder and WatsonX SaaS DA is in root level). The working directory of the DA will be in the ibm_catalog.json. And if its not, it means it defaults to the root directory of the repo.
inputs = [] | ||
with open(IBM_CATALOG_FILE) as f: | ||
ibm_catalog = json.load(f) | ||
if ibm_catalog and "products" in ibm_catalog and ibm_catalog["products"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make sure we only do this for "product_kind": "solution",
? Since we also have module
types, and they should be excluded from this check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see initial comments
Description
Check if all solution input variables are defined in ibm_catalog.json file. Same time checks if any input is defined in catalog.json file which is not defined in solutions input.
Release required?
x.x.X
)x.X.x
)X.x.x
)Release notes content
Run the pipeline
If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.
Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:
Checklist for reviewers
For mergers