From 2dc0362586f17a3e06beff2d96b2a1f980607456 Mon Sep 17 00:00:00 2001 From: Ryan Laurie Date: Tue, 28 Jul 2026 14:48:41 -0600 Subject: [PATCH 1/2] version support tags and warnings --- .github/workflows/update-version-support.yml | 104 +++++++++++++++++++ _config.yml | 1 + _data/major_version_support.json | 62 +++++++++++ _includes/docs/blockquotes.html | 15 ++- _includes/docs_version.html | 12 ++- _includes/head.html | 6 ++ _layouts/docs.html | 8 ++ _plugins/jekyll_version_support_plugin.rb | 77 ++++++++++++++ all.md | 5 +- docs/docs-local.css | 55 ++++++++++ 10 files changed, 339 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/update-version-support.yml create mode 100644 _data/major_version_support.json create mode 100644 _plugins/jekyll_version_support_plugin.rb create mode 100644 docs/docs-local.css diff --git a/.github/workflows/update-version-support.yml b/.github/workflows/update-version-support.yml new file mode 100644 index 0000000000..0094161622 --- /dev/null +++ b/.github/workflows/update-version-support.yml @@ -0,0 +1,104 @@ +name: Update version support data + +on: + workflow_dispatch: + schedule: + # Nightly, an hour before the nightly docs update + - cron: "0 1 * * *" + +run-name: Nightly version support update + +env: + VERSION_INFO_URL: https://static.metabase.com/version-info.json + DATA_FILE: _data/major_version_support.json + +concurrency: + group: update-version-support + cancel-in-progress: false + +jobs: + update: + name: Update major_version_support.json + runs-on: ubuntu-latest + timeout-minutes: 10 + env: + GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }} + BRANCH_NAME: update-version-support-${{ github.run_id }} + steps: + - uses: actions/checkout@v6 + with: + ref: master + token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }} + + - name: Fetch major_version_support from version-info.json + run: | + curl --fail --silent --show-error --retry 3 --retry-delay 5 \ + "$VERSION_INFO_URL" -o version-info.json + + # Bail out rather than commit garbage if the key is missing or empty + if ! jq -e '.major_version_support | arrays and length > 0' version-info.json > /dev/null; then + echo "::error::major_version_support is missing or empty in $VERSION_INFO_URL" + exit 1 + fi + + # Every entry needs a numeric major, otherwise the docs templates can't match on it + if ! jq -e '.major_version_support | all(.major | numbers)' version-info.json > /dev/null; then + echo "::error::every major_version_support entry must have a numeric \"major\"" + exit 1 + fi + + jq '.major_version_support' version-info.json > "$DATA_FILE" + rm version-info.json + + - name: Check for changes + id: diff + run: | + if git diff --quiet -- "$DATA_FILE"; then + echo "changed=false" >> "$GITHUB_OUTPUT" + echo "No changes to $DATA_FILE" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + git --no-pager diff -- "$DATA_FILE" + fi + + - name: Push the update + if: steps.diff.outputs.changed == 'true' + run: | + git config user.name github-actions + git config user.email github-actions@github.com + + git checkout -B "$BRANCH_NAME" + git add "$DATA_FILE" + git commit -m "Update major version support data" + git push --force origin "$BRANCH_NAME" + + - name: Open PR + id: create_pr + if: steps.diff.outputs.changed == 'true' + env: + GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }} + run: | # sh + DATE=$(date +'%Y-%m-%d') + + URL=$(gh pr create \ + --base master \ + --head "$BRANCH_NAME" \ + --title "Update version support data $DATE" \ + --body "Automated nightly update of the major version support data\`.") + + PR_NUMBER=${URL##*/} + echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT" + + - name: Auto approve PR + if: steps.diff.outputs.changed == 'true' + uses: juliangruber/approve-pull-request-action@68fcc9a5a73b5641cadf757cf99d73720dcb05d0 # v2.1.0 + with: + github-token: ${{ github.token }} + number: ${{ steps.create_pr.outputs.pr_number }} + + - name: Enable Pull Request Automerge + if: steps.diff.outputs.changed == 'true' + run: gh pr merge --squash --auto "$PR_NUMBER" + env: + GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }} + PR_NUMBER: ${{ steps.create_pr.outputs.pr_number }} diff --git a/_config.yml b/_config.yml index a17efb596b..edda7245fe 100644 --- a/_config.yml +++ b/_config.yml @@ -18,6 +18,7 @@ whitelist: - jekyll_include_plugin - jekyll_dirname_payload_plugin - jekyll_responsive_table_labels_plugin + - jekyll_version_support_plugin jekyll_include_plugin: snippet_prefix: "" sass: diff --git a/_data/major_version_support.json b/_data/major_version_support.json new file mode 100644 index 0000000000..cff21a9a9c --- /dev/null +++ b/_data/major_version_support.json @@ -0,0 +1,62 @@ +[ + { + "major": 63, + "released": "2026-07-07", + "lts": false, + "eol": "2026-09-07" + }, + { + "major": 62, + "released": "2026-06-01", + "lts": false, + "eol": "2026-09-01" + }, + { + "major": 61, + "released": "2026-04-30", + "lts": false, + "eol": "2026-09-01" + }, + { + "major": 60, + "released": "2026-03-26", + "lts": false, + "eol": "2026-09-01" + }, + { + "major": 59, + "released": "2026-02-12", + "lts": false, + "eol": "2026-09-01" + }, + { + "major": 58, + "released": "2025-12-17", + "lts": true, + "eol": "2027-02-17" + }, + { + "major": 57, + "released": "2025-11-01", + "lts": false, + "eol": "2026-05-31" + }, + { + "major": 56, + "released": "2025-08-01", + "lts": false, + "eol": "2026-05-31" + }, + { + "major": 55, + "released": "2025-06-02", + "lts": false, + "eol": "2026-05-31" + }, + { + "major": 54, + "released": "2025-03-25", + "lts": false, + "eol": "2026-05-31" + } +] diff --git a/_includes/docs/blockquotes.html b/_includes/docs/blockquotes.html index 930ac45774..1bed1a1a2d 100644 --- a/_includes/docs/blockquotes.html +++ b/_includes/docs/blockquotes.html @@ -6,10 +6,17 @@ Check out the docs for the current stable version, Metabase {{site.docs_version}}. {% else %} -
- These are the docs for Metabase {{ page.version }}. - Check out the docs for the current stable version, Metabase {{site.docs_version}}. -
+ {% assign support = site.data.version_support[page.version] %} + {% if support.status == "unsupported" %} +
+ Version {{ page.version }} of Metabase is no longer supported. Check out the docs for the current stable version, Metabase {{site.docs_version}}. +
+ {% else %} +
+ These are the docs for Metabase {{ page.version }}. + Check out the docs for the current stable version, Metabase {{site.docs_version}}. +
+ {% endif %} {% endif %} {% endif %} diff --git a/_includes/docs_version.html b/_includes/docs_version.html index 39337249a4..90034590c0 100644 --- a/_includes/docs_version.html +++ b/_includes/docs_version.html @@ -13,9 +13,19 @@