Make sure enterprise api clients don't drift
This commit is contained in:
@@ -178,6 +178,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
extract_error_message='ERROR! API client generation failed!'
|
extract_error_message='ERROR! API client generation failed!'
|
||||||
yarn generate-apis || (echo "${extract_error_message}" && false)
|
yarn generate-apis || (echo "${extract_error_message}" && false)
|
||||||
|
- name: Generate Enterprise API clients
|
||||||
|
run: |
|
||||||
|
extract_error_message='ERROR! API client generation failed!'
|
||||||
|
yarn generate-enterprise-apis || (echo "${extract_error_message}" && false)
|
||||||
- name: Verify generated clients
|
- name: Verify generated clients
|
||||||
run: |
|
run: |
|
||||||
uncommited_error_message="ERROR! API client generation has not been committed. Please run 'yarn generate-apis', commit the changes and push again."
|
uncommited_error_message="ERROR! API client generation has not been committed. Please run 'yarn generate-apis', commit the changes and push again."
|
||||||
@@ -187,3 +191,13 @@ jobs:
|
|||||||
echo "${uncommited_error_message}"
|
echo "${uncommited_error_message}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
- name: Verify generated enterprise clients
|
||||||
|
run: |
|
||||||
|
uncommited_error_message="ERROR! Enterprise API client generation has not been committed. Please run 'yarn generate-enterprise-apis', commit the changes and push again."
|
||||||
|
cd ../grafana-enterprise
|
||||||
|
file_diff="$(git diff)"
|
||||||
|
if [ -n "$file_diff" ]; then
|
||||||
|
echo "$file_diff"
|
||||||
|
echo "${uncommited_error_message}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
"plugin:test:ci": "nx run-many -t test:ci --projects='tag:scope:plugin' --maxParallel=2",
|
"plugin:test:ci": "nx run-many -t test:ci --projects='tag:scope:plugin' --maxParallel=2",
|
||||||
"plugin:i18n-extract": "nx run-many -t i18n-extract --projects='tag:scope:plugin'",
|
"plugin:i18n-extract": "nx run-many -t i18n-extract --projects='tag:scope:plugin'",
|
||||||
"generate-apis": "yarn workspace @grafana/api-clients generate-apis",
|
"generate-apis": "yarn workspace @grafana/api-clients generate-apis",
|
||||||
|
"generate-enterprise-apis": "yarn workspace @grafana/api-clients process-specs && NODE_OPTIONS='--disable-warning=ExperimentalWarning' rtk-query-codegen-openapi ./local/generate-enterprise-apis.ts",
|
||||||
"generate:api-client": "yarn workspace @grafana/api-clients generate:api-client"
|
"generate:api-client": "yarn workspace @grafana/api-clients generate:api-client"
|
||||||
},
|
},
|
||||||
"grafana": {
|
"grafana": {
|
||||||
|
|||||||
Reference in New Issue
Block a user