Skip to content

Avoid unnecessary curl#206

Merged
kpenfound merged 1 commit intodagger:mainfrom
perwestling:avoid_unused_curl_for_dagger_version
Mar 17, 2026
Merged

Avoid unnecessary curl#206
kpenfound merged 1 commit intodagger:mainfrom
perwestling:avoid_unused_curl_for_dagger_version

Conversation

@perwestling
Copy link
Contributor

@perwestling perwestling commented Mar 16, 2026

This commit will use curl to get the SHA for latest version of dagger, only if user has requested to use 'latest' version. If requesting a specific version the curl call is avoided.

This will help to alleviate issue with Error 429 if using a specific dagger-for-github version.


This is a small change to existing action. The code change is exercised by the existing tests. The change is in the "skip installation if already installed" logic, and the existing tests already cover the relevant scenarios:

  • existing-install — pre-installs v0.18.17, then requests v0.18.16 → should override (tests the $version == $VERSION path)

  • latest-install — pre-installs v0.18.17, then requests "latest" → should override if latest is newer (tests the new lazy curl path)

The latest-install job is actually already exercising the new code path. It pre-installs an older version, then runs the action with version: "latest".

This change means it will now:

  • See dagger is installed → enter the check block

  • $VERSION is empty (since "latest" gets cleared) → run the curl to fetch latest

  • Compare the installed version against latest → override if different

So the existing latest-install test already validates the change.

One scenario that's harder to test is the "skip" case — where dagger is already at the latest version and the curl confirms it matches. That would require pre-installing whatever the current latest is, which is a moving target and would make the test brittle.

@perwestling perwestling marked this pull request as draft March 16, 2026 14:09
@perwestling perwestling marked this pull request as ready for review March 16, 2026 14:30
@kpenfound
Copy link
Contributor

Thanks for the fix @perwestling , can you fix DCO and I'll approve/merge?

@perwestling
Copy link
Contributor Author

Thanks for the fix @perwestling , can you fix DCO and I'll approve/merge?

First PR for me in this repo. I will look into the DCO tomorrow.

Thanks

This commit will use curl to get the SHA for latest version of dagger, only
if user has requested to use 'latest' version. If requesting a specific version
the curl call is avoided.

This will help to alleviate issue with Error 429 if using a specific dagger-for-github version.

Signed-off-by: u102348 (Per Westling) <per.westling1@saabgroup.com>
@perwestling perwestling force-pushed the avoid_unused_curl_for_dagger_version branch from 8219bb6 to a20c137 Compare March 17, 2026 08:28
@perwestling
Copy link
Contributor Author

@kpenfound Did a rebase + signoff, otherwise no changes.

Copy link
Contributor

@kpenfound kpenfound left a comment

Choose a reason for hiding this comment

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

Thank you!

@kpenfound kpenfound merged commit 27b130b into dagger:main Mar 17, 2026
16 checks passed
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