updated update import version scripts to account for ingestion helper updates#2067
updated update import version scripts to account for ingestion helper updates#2067dwnoble wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the update_import_version.sh script by pointing the POST request to a more specific endpoint (/imports/version) and removing the actionType field from the JSON payload. The reviewer recommended adding the --fail flag to the curl command to ensure that HTTP errors correctly trigger a script failure under set -e.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| curl -X POST "${FUNCTION_URL}/imports/version" \ | ||
| -H "Authorization: bearer $(gcloud auth print-identity-token)" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "{\"actionType\": \"update_import_version\", \"importName\": \"${IMPORT_NAME}\", \"version\": \"${VERSION}\", \"override\": true, \"comment\": \"${COMMENT}\"}" | ||
| -d "{\"importName\": \"${IMPORT_NAME}\", \"version\": \"${VERSION}\", \"override\": true, \"comment\": \"${COMMENT}\"}" |
There was a problem hiding this comment.
Since set -e is enabled at the beginning of the script, the script is expected to exit immediately if any command fails. However, curl does not return a non-zero exit status on HTTP errors (such as 4xx or 5xx) by default. To ensure that HTTP failures cause the script to fail and exit, add the --fail (or -f) flag to the curl command.
| curl -X POST "${FUNCTION_URL}/imports/version" \ | |
| -H "Authorization: bearer $(gcloud auth print-identity-token)" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"actionType\": \"update_import_version\", \"importName\": \"${IMPORT_NAME}\", \"version\": \"${VERSION}\", \"override\": true, \"comment\": \"${COMMENT}\"}" | |
| -d "{\"importName\": \"${IMPORT_NAME}\", \"version\": \"${VERSION}\", \"override\": true, \"comment\": \"${COMMENT}\"}" | |
| curl --fail -X POST "${FUNCTION_URL}/imports/version" \ | |
| -H "Authorization: bearer $(gcloud auth print-identity-token)" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"importName\": \"${IMPORT_NAME}\", \"version\": \"${VERSION}\", \"override\": true, \"comment\": \"${COMMENT}\"}" |
References
- In a pull request with a focused scope, defer non-critical stylistic suggestions if the author prefers to minimize changes. These can be addressed in a follow-up.
Reference: https://github.com/datacommonsorg/import/pull/526/changes#r3377873284