Skip to content

Improve reliability of the sbt launcher SHA-1 checksum download#329

Open
Malax wants to merge 1 commit into
mainfrom
malax/sbt-checksum-curl-retries
Open

Improve reliability of the sbt launcher SHA-1 checksum download#329
Malax wants to merge 1 commit into
mainfrom
malax/sbt-checksum-curl-retries

Conversation

@Malax

@Malax Malax commented Jun 10, 2026

Copy link
Copy Markdown
Member

The SHA-1 checksum download for the sbt launcher used a bare curl invocation without retries, timeouts, or HTTP status code checks. This makes it match the established best practices already used for the sbt launcher jar download in the same function: --retry 3, --retry-connrefused, --connect-timeout 5, --max-time 60, and an explicit HTTP status code check. The error message also now includes the failing URL, HTTP status, and curl exit code.

W-22927377

@Malax Malax marked this pull request as ready for review June 10, 2026 11:25
@Malax Malax requested a review from a team as a code owner June 10, 2026 11:25
@Malax Malax enabled auto-merge (squash) June 10, 2026 12:27
Comment thread lib/sbt.sh

local sha1_curl_exit_code=$?

if [[ "${sha1_curl_exit_code}" -ne 0 || "${sha1_http_status_code}" != "200" ]]; then

@edmorley edmorley Jun 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this approach will work, since set -e will cause the script to be aborted before this runs?

Is this more complex approach needed? The original if ! <command>; then <print error>; exit 1; fi pattern works very well and is what I use for Python etc.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is actually a very good catch - I copied that pattern from another place in this buildpack. That one will be broken too. I didn't even question it. I'll create a separate PR for fixing that and update this one.

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