Skip to content
Open
Show file tree
Hide file tree
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
59 changes: 47 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -226,18 +228,48 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Export build information
run: |
echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV

echo "EXTRA_LABELS<<EOF
git.repository=${{ github.repository }}
git.commit-sha=${{ github.sha }}
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ssZ'}}
org.opencontainers.image.vendor=${{ github.repository_owner }}
EOF" >> $GITHUB_ENV

# dev pre-release of the next patch, e.g. 9.5.11-dev.gabc1234
LATEST_TAG=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*' --exclude '*-*')
MAJOR=$(echo "$LATEST_TAG" | cut -d. -f1)
MINOR=$(echo "$LATEST_TAG" | cut -d. -f2)
PATCH=$(echo "$LATEST_TAG" | cut -d. -f3)
echo "DEV_TAG=${MAJOR}.${MINOR}.$((PATCH + 1))-dev.g${GITHUB_SHA::7}" >> "$GITHUB_ENV"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The PR description says the dev tag has a commit count (9.5.12-dev.3.sha-abc1234), but this builds X.Y.Z-dev.g<sha> with no count. Without the count, semver compares the prerelease part as text, so two dev builds of the same patch sort by sha, not by age. Add the count, or fix the description.

Suggested change
echo "DEV_TAG=${MAJOR}.${MINOR}.$((PATCH + 1))-dev.g${GITHUB_SHA::7}" >> "$GITHUB_ENV"
COUNT=$(git rev-list --count "${LATEST_TAG}..HEAD")
echo "DEV_TAG=${MAJOR}.${MINOR}.$((PATCH + 1))-dev.${COUNT}.sha-${GITHUB_SHA::7}" >> "$GITHUB_ENV"


- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
# CI jobs pull the images by commit sha
tags: |
type=raw,value=${{ env.DEV_TAG }}
type=raw,value=${{ github.sha }}
labels: ${{ env.EXTRA_LABELS }}
annotations: ${{ env.EXTRA_LABELS }}

- name: Build and push cloudserver image
uses: docker/build-push-action@v5
with:
push: true
context: .
target: production
provenance: false
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
labels: |
git.repository=${{ github.repository }}
git.commit-sha=${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
build-args: |
SOURCE_DATE_EPOCH=${{ env.SOURCE_DATE_EPOCH }}
cache-from: type=gha,scope=cloudserver
cache-to: type=gha,mode=max,scope=cloudserver

Expand All @@ -250,9 +282,11 @@ jobs:
provenance: false
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}-testcoverage
labels: |
git.repository=${{ github.repository }}
git.commit-sha=${{ github.sha }}
ghcr.io/${{ github.repository }}:${{ env.DEV_TAG }}-testcoverage
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
build-args: |
SOURCE_DATE_EPOCH=${{ env.SOURCE_DATE_EPOCH }}
cache-from: type=gha,scope=cloudserver
cache-to: type=gha,mode=max,scope=cloudserver

Expand All @@ -264,11 +298,12 @@ jobs:
provenance: false
build-args: |
CLOUDSERVER_VERSION=${{ github.sha }}
SOURCE_DATE_EPOCH=${{ env.SOURCE_DATE_EPOCH }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}-federation
labels: |
git.repository=${{ github.repository }}
git.commit-sha=${{ github.sha }}
ghcr.io/${{ github.repository }}:${{ env.DEV_TAG }}-federation
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha,scope=federation
cache-to: type=gha,mode=max,scope=federation

Expand Down Expand Up @@ -311,7 +346,7 @@ jobs:

- name: Push dashboards
run: |
oras push ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}-dashboards:${{ github.sha }} \
oras push ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}-dashboards:${{ github.sha }},${{ env.DEV_TAG }} \
dashboard.json:application/grafana-dashboard+json \
alerts.yaml:application/prometheus-alerts+yaml
working-directory: monitoring
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scality/cloudserver",
"version": "9.5.10",
"version": "9.5.11",
"description": "Zenko CloudServer, an open-source Node.js implementation of a server handling the Amazon S3 protocol",
"main": "index.js",
"engines": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"@opentelemetry/instrumentation-http": "~0.222.0",
"@opentelemetry/instrumentation-ioredis": "~0.70.0",
"@opentelemetry/instrumentation-mongodb": "~0.75.0",
"@scality/arsenal": "^8.6.3",
"@scality/arsenal": "^8.6.7",
"@scality/bucketclient": "scality/bucketclient#8.3.0",
"@scality/cloudserverclient": "1.0.13",
"@scality/scubaclient": "1.2.2",
Expand Down
57 changes: 22 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1305,10 +1305,10 @@
resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8"
integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==

"@scality/arsenal@^8.6.0-0", "@scality/arsenal@^8.6.3":
version "8.6.3"
resolved "https://registry.yarnpkg.com/@scality/arsenal/-/arsenal-8.6.3.tgz#49d729706318c5e271b7ccae4ea2233af66df64a"
integrity sha512-If/jbSrx1dP93Va/9AE+OGqrAeaqfDt+6+ETeT3Wd2N3I3tbNa9J4ic4EQMwf8ndehnWX7imMfm7ZaWVW5oNwA==
"@scality/arsenal@^8.6.0-0", "@scality/arsenal@^8.6.7":
version "8.6.7"
resolved "https://registry.yarnpkg.com/@scality/arsenal/-/arsenal-8.6.7.tgz#35eeba6032230d88f7047e1c26f4f9da8bb46cdb"
integrity sha512-/N/l2Qov/QxIAW1UzizBKiy+UnyxUlSyc7O55okDHLzAIfHLuuvgJgHjxkAQsn1J7eU7tuA4MeeK9vosAcRCGw==
dependencies:
"@aws-sdk/client-kms" "^3.975.0"
"@aws-sdk/client-s3" "^3.975.0"
Expand All @@ -1323,7 +1323,7 @@
"@opentelemetry/sdk-node" "^0.223.0"
"@opentelemetry/sdk-trace-base" "^2.12.0"
"@scality/hdclient" "^1.3.2"
"@smithy/node-http-handler" "^4.3.0"
"@smithy/node-http-handler" "^4.4.0"
"@smithy/protocol-http" "^5.3.5"
JSONStream "^1.3.5"
agentkeepalive "^4.6.0"
Expand Down Expand Up @@ -1497,12 +1497,12 @@
"@smithy/types" "^3.7.2"
tslib "^2.6.2"

"@smithy/core@^3.33.2", "@smithy/core@^3.33.3", "@smithy/core@^3.35.0", "@smithy/core@^3.36.1", "@smithy/core@^3.37.0":
version "3.37.0"
resolved "https://registry.yarnpkg.com/@smithy/core/-/core-3.37.0.tgz#dc83e936032b7a7756df856a95c2b6fb7fdfc5fe"
integrity sha512-97imTcCyiPd8k0e9+ts/Sp0W65Dn9Ti357J7M09Ov4tI8Q1JDJVFSoAJtjEVKqfHEr3Pdo2jfolqKCaaiszH0g==
"@smithy/core@^3.33.2", "@smithy/core@^3.33.3", "@smithy/core@^3.35.0", "@smithy/core@^3.36.1", "@smithy/core@^3.39.0":
version "3.41.1"
resolved "https://registry.yarnpkg.com/@smithy/core/-/core-3.41.1.tgz#2108d8ff39ab52bba4bcb2d06849beb3f554c2e0"
integrity sha512-24LyiHSY0R/MLcbTylurWXU6Uy4lzI6KJgsdzxkNnjT9/OLWc2zGPb/3k5AM1f0vcgCGrExanUG339t+TBiIrA==
dependencies:
"@smithy/types" "^4.19.0"
"@smithy/types" "^4.20.0"
tslib "^2.6.2"

"@smithy/credential-provider-imds@^4.5.2":
Expand Down Expand Up @@ -1575,13 +1575,13 @@
"@smithy/types" "^3.7.2"
tslib "^2.6.2"

"@smithy/node-http-handler@^4.12.1", "@smithy/node-http-handler@^4.3.0":
version "4.13.0"
resolved "https://registry.yarnpkg.com/@smithy/node-http-handler/-/node-http-handler-4.13.0.tgz#cc26fbea5572a482b35cb43ca55c0d182e4eff70"
integrity sha512-/GGcPoNJ2nzGytdAanpbx7mpp9Coa8LP+/Rpmbktr8YeLuIXs9B0SEz+X3AeonHdyzOIFJdKbN7jOZ+Tj+pMGw==
"@smithy/node-http-handler@^4.12.1", "@smithy/node-http-handler@^4.4.0":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@smithy/node-http-handler/-/node-http-handler-4.14.2.tgz#b3b44ed33af388322f13a1fd48694d1f9d490507"
integrity sha512-i1uORV1v3qBqP43ayRKzIdm1q5x14tf8N4Dd06/QUX1Szm6VxHMrTsu20X5E63UFsaNZCRjI4SXG0jDmqYa+3w==
dependencies:
"@smithy/core" "^3.37.0"
"@smithy/types" "^4.19.0"
"@smithy/core" "^3.39.0"
"@smithy/types" "^4.20.0"
tslib "^2.6.2"

"@smithy/protocol-http@^1.1.0":
Expand Down Expand Up @@ -1668,10 +1668,10 @@
dependencies:
tslib "^2.6.2"

"@smithy/types@^4.17.2", "@smithy/types@^4.18.0", "@smithy/types@^4.19.0":
version "4.19.0"
resolved "https://registry.yarnpkg.com/@smithy/types/-/types-4.19.0.tgz#a0dd9c9d7b2a070fc7c3d69efedea8404b3646be"
integrity sha512-r7jh49VJxGerfAcTQA6gXcKc+98zOp/tqRwzYjgOE+iSQsP6cEU1hq2QzbuipmP68QtYdY9wKEhiCQZIzHgZ4Q==
"@smithy/types@^4.17.2", "@smithy/types@^4.18.0", "@smithy/types@^4.19.0", "@smithy/types@^4.20.0":
version "4.20.0"
resolved "https://registry.yarnpkg.com/@smithy/types/-/types-4.20.0.tgz#20dee95d543f7c89682fbe73c765f5f0ef3a2c12"
integrity sha512-lCA6QG22dPk9ecHbv91jDQZsmtPUjdS1aE2Il6NNPqe7DrYc0dZQi6DhcESk2KYXH2sp5xbAcGdYMZDFnuzA2A==
dependencies:
tslib "^2.6.2"

Expand Down Expand Up @@ -4093,26 +4093,13 @@ http2-wrapper@^1.0.0-beta.5.2:
quick-lru "^5.1.1"
resolve-alpn "^1.0.0"

"httpagent@git+https://github.com/scality/httpagent#1.1.0":
version "1.1.0"
resolved "git+https://github.com/scality/httpagent#8f9958eb9cde086db7819a86582fba640a5f8876"
dependencies:
agentkeepalive "^4.5.0"

"httpagent@git+https://github.com/scality/httpagent#1.1.1":
version "1.1.1"
uid "7c6ef8be1cd89b56651f4a922ea5c92d7673ee2e"
resolved "git+https://github.com/scality/httpagent#7c6ef8be1cd89b56651f4a922ea5c92d7673ee2e"
dependencies:
agentkeepalive "^4.6.0"

"httpagent@github:scality/httpagent#1.1.0":
"httpagent@git+https://github.com/scality/httpagent#1.1.0", "httpagent@github:scality/httpagent#1.1.0":
version "1.1.0"
resolved "https://codeload.github.com/scality/httpagent/tar.gz/8f9958eb9cde086db7819a86582fba640a5f8876"
dependencies:
agentkeepalive "^4.5.0"

"httpagent@github:scality/httpagent#1.1.1", httpagent@scality/httpagent#1.1.1:
"httpagent@git+https://github.com/scality/httpagent#1.1.1", "httpagent@github:scality/httpagent#1.1.1", httpagent@scality/httpagent#1.1.1:
version "1.1.1"
resolved "https://codeload.github.com/scality/httpagent/tar.gz/7c6ef8be1cd89b56651f4a922ea5c92d7673ee2e"
dependencies:
Expand Down
Loading