Skip to content
Open
Changes from all 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
26 changes: 21 additions & 5 deletions .github/workflows/_extension_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,36 @@ jobs:
run: |
pwd
python3 -m pip install awscli
# A release and its variants can sit on one commit, and version sort

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.

Appreciate the big comment, but for code cleanliness its nice to have a more concise explanation of what is being done

# ranks anything suffixed above the release it belongs to, so v1.2.3-rc1
# would be picked over v1.2.3. A plain release tag is therefore matched
# first, because enumerating the suffixes cannot be complete: this
# registry carries `v0.2.3` beside `v0.2.3-cpp` today, and -cpp is not a
# pre-release anybody would have thought to name. The suffix list still
# decides between variants when the commit carries no plain tag at all.
# awk and not grep: grep exits 1 when nothing matches, and under this
# step's `-e -o pipefail` that status would abort the deploy for every
# commit whose tags are not plain releases. It survives today only
# because the line begins with `export`, which swallows the status.

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.

Hi, you're configuring the ordering of -rc, -beta, and -alpha, however the awk filter on line 154 strips out anything with a suffix before sorting. Therefore either the three git config calls should be deleted, or the awk filter changed

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.

Though I see that the fallback does go through the sorted list of tags, so it actually shouldn't be an issue, but could you confirm the intention? Thanks!

git config --global --add versionsort.suffix -rc
git config --global --add versionsort.suffix -beta
git config --global --add versionsort.suffix -alpha
if [ -n "${{ inputs.duckdb_tag }}" ]; then
export DUCKDB_VERSION="${{ inputs.duckdb_tag }}"
else
git config --global --add safe.directory '*'
cd duckdb
git fetch --tags
export DUCKDB_VERSION=`git tag --points-at HEAD`
export DUCKDB_VERSION=${DUCKDB_VERSION:=`git log -1 --format=%h`}
export DUCKDB_VERSION="$(git tag --points-at HEAD --sort=-v:refname | awk '/^v?[0-9]+([.][0-9]+)*$/' | head -n 1)"
export DUCKDB_VERSION="${DUCKDB_VERSION:-$(git tag --points-at HEAD --sort=-v:refname | head -n 1)}"
export DUCKDB_VERSION="${DUCKDB_VERSION:-$(git log -1 --format=%h)}"
cd ..
fi
git fetch --tags --no-recurse-submodules
export EXT_VERSION=`git tag --points-at HEAD`
export EXT_VERSION=${EXT_VERSION:=`git log -1 --format=%h`}
${{ inputs.deploy_script }} ${{ inputs.extension_name }} $EXT_VERSION $DUCKDB_VERSION ${{ matrix.duckdb_arch }} $BUCKET_NAME ${{inputs.deploy_latest || 'true' && 'false'}} ${{inputs.deploy_versioned || 'true' && 'false'}}
export EXT_VERSION="$(git tag --points-at HEAD --sort=-v:refname | awk '/^v?[0-9]+([.][0-9]+)*$/' | head -n 1)"
export EXT_VERSION="${EXT_VERSION:-$(git tag --points-at HEAD --sort=-v:refname | head -n 1)}"
export EXT_VERSION="${EXT_VERSION:-$(git log -1 --format=%h)}"
${{ inputs.deploy_script }} ${{ inputs.extension_name }} "$EXT_VERSION" "$DUCKDB_VERSION" ${{ matrix.duckdb_arch }} "$BUCKET_NAME" ${{inputs.deploy_latest || 'true' && 'false'}} ${{inputs.deploy_versioned || 'true' && 'false'}}

clean_cache:
needs:
Expand Down