diff --git a/.github/scripts/immich-vchord-allowed-version.sh b/.github/scripts/immich-vchord-allowed-version.sh new file mode 100755 index 000000000..b7fee45d1 --- /dev/null +++ b/.github/scripts/immich-vchord-allowed-version.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# renovate: datasource=docker depName=ghcr.io/immich-app/immich-server +version=v2.4.1 + +# Get file from immich repo that includes VectorChord version range +SOURCE_CONSTANTS=$(curl -s https://raw.githubusercontent.com/immich-app/immich/$version/server/src/constants.ts) + +# Extract the upper bound constraint (e.g., "<0.6" or "<=0.6") from VECTORCHORD_VERSION_RANGE +ALLOWED_VERSION=$(echo "$SOURCE_CONSTANTS" | sed -n "s/.*VECTORCHORD_VERSION_RANGE = '>=[0-9.]* \(<[=]*[0-9.]*\)'.*/\1/p") + +# Update renovate config for vchord-scratch +sed -i "s/allowedVersions: \"<[^\"]*\", \/\/ immich/allowedVersions: \"${ALLOWED_VERSION}\", \/\/ immich/" .renovate/allowedVersions.json5 diff --git a/.github/workflows/scan-immich-vchord-version.yaml b/.github/workflows/scan-immich-vchord-version.yaml new file mode 100644 index 000000000..fe65bbbc5 --- /dev/null +++ b/.github/workflows/scan-immich-vchord-version.yaml @@ -0,0 +1,45 @@ +--- +name: Scan supported VChord versions in Immich + +on: # yamllint disable-line rule:truthy + workflow_dispatch: + push: + branches: + - main + paths: + - ".github/scripts/immich-vchord-allowed-version.sh" + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + scan-versions: + name: Check if we should allow newer VChord versions + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: Generate Token + uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 + id: generate-token + with: + app-id: "${{ secrets.HOMEOPS_BOT_APP_ID }}" + private-key: "${{ secrets.HOMEOPS_BOT_PRIVATE_KEY }}" + + - name: Scan files + run: | + .github/scripts/immich-vchord-allowed-version.sh + + - uses: gr2m/create-or-update-pull-request-action@v1 + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + with: + title: "feat(immich): update allowed VChord version" + body: "Immich supports a new VChord version. The allowedVersions file has been updated." + branch: "update-allowed-vchord-version" + path: ".renovate/allowedVersions.json5" + commit-message: "Update allowedVersions.json5 with new VChord version." + labels: size/XS, area/database, type/minor + update-pull-request-title-and-body: true diff --git a/.github/workflows/scan-supported-k8s-version.yaml b/.github/workflows/scan-supported-k8s-version.yaml index 7d3ccf213..577b32c24 100644 --- a/.github/workflows/scan-supported-k8s-version.yaml +++ b/.github/workflows/scan-supported-k8s-version.yaml @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy branches: - main paths: - - "kubernetes/talos/machineconfig.yaml.j2" + - ".github/scripts/kubernetes-version.sh" concurrency: group: ${{ github.ref }}-${{ github.workflow }} diff --git a/.renovate/allowedVersions.json5 b/.renovate/allowedVersions.json5 index 04aa5a4c3..8f491698b 100644 --- a/.renovate/allowedVersions.json5 +++ b/.renovate/allowedVersions.json5 @@ -9,5 +9,12 @@ "registry.k8s.io/kubectl", ], }, + { + allowedVersions: "<0.6", // immich dependency + matchDatasources: ["docker"], + matchPackageNames: [ + "ghcr.io/tensorchord/vchord-scratch", + ], + }, ], } diff --git a/.renovate/customManagers.json5 b/.renovate/customManagers.json5 index fad2dda48..8a776c5a3 100644 --- a/.renovate/customManagers.json5 +++ b/.renovate/customManagers.json5 @@ -59,5 +59,15 @@ datasourceTemplate: "docker", versioningTemplate: "regex:^(?\\d+)\\.(?\\d+)-(?\\d+)-(?.*)$", }, + { + customType: "regex", + description: "Tensorchord Vchord container", + fileMatch: [ + "kubernetes/apps/databases/postgres18/app/.+\\.yaml$", + ], + matchStrings: ["reference: (?.*?):(?.*)"], + datasourceTemplate: "docker", + versioningTemplate: "regex:^pg18-v(?\\d+)\\.(?\\d+)\\.(?\\d+)$", + }, ], }