Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Improves Update Atlas SDK cache issues #1922

Closed
wants to merge 10 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions scripts/update-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@
set -euo pipefail

LATEST_SDK_TAG=$(curl -sSfL -X GET https://api.github.com/repos/mongodb/atlas-sdk-go/releases/latest | jq -r '.tag_name')

LATEST_SDK_RELEASE=$(echo "${LATEST_SDK_TAG}" | cut -d '.' -f 1)
echo "==> Updating SDK to latest major version ${LATEST_SDK_TAG}"

Copy link
Collaborator

@andreaangiolillo andreaangiolillo Feb 7, 2024

Choose a reason for hiding this comment

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

Could you clarify what was the issue and how the improvement should help with? Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

as an example a new Atlas Go SDK version was released this morning, but it took many hours until the script was successful because Go caches. We want to try to avoid/minimize that delay

echo "==> Updating SDK to latest major version tag: ${LATEST_SDK_TAG}, release: ${LATEST_SDK_RELEASE}"

echo "Refreshing cache info and waiting 60s"
curl -sSfL -X GET "https://proxy.golang.org/go.mongodb.org/atlas-sdk/${LATEST_SDK_RELEASE}/@v/${LATEST_SDK_TAG}.info"
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI this may trigger the go proxy to do a fetch but it happens in the background so the next step may still fail

lantoli marked this conversation as resolved.
Show resolved Hide resolved
echo
sleep 60

gomajor get "go.mongodb.org/atlas-sdk/${LATEST_SDK_RELEASE}@${LATEST_SDK_TAG}"
go mod tidy
echo "Done"

echo "Done"
Loading