Skip to content

updated update import version scripts to account for ingestion helper updates#2067

Open
dwnoble wants to merge 1 commit into
datacommonsorg:masterfrom
dwnoble:ingestion-helper-update
Open

updated update import version scripts to account for ingestion helper updates#2067
dwnoble wants to merge 1 commit into
datacommonsorg:masterfrom
dwnoble:ingestion-helper-update

Conversation

@dwnoble

@dwnoble dwnoble commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +34 to +37
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}\"}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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
  1. 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.

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