The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
docs - nightly doc gen (#62345)
Jeff Bruemmer8d655ac2daeb
diff --git a/.github/workflows/docs-master-generate.yml b/.github/workflows/docs-master-generate.ymlindex f3e5789953d..aa0316400ae 100644--- a/.github/workflows/docs-master-generate.yml+++ b/.github/workflows/docs-master-generate.yml@@ -1,8 +1,8 @@-name: Auto-update documentation+name: Auto-update documentation (master)on:schedule:- - cron: "0 1 * * 2" # Every Tuesday at 1 AM UTC+ - cron: "0 1 * * 1-5" # Every Monday through Friday at 1 AM UTCworkflow_dispatch:permissions:@@ -70,7 +70,7 @@ jobs:git checkout -b $BRANCH_NAMEgit add docs/- git commit -m "Auto-update documentation" --no-verify+ git commit -m "Update generated docs (master)" --no-verifygit push -u origin $BRANCH_NAMEecho "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT@@ -91,23 +91,22 @@ jobs:if gh pr create \--base master \--head ${{ steps.commit_and_push.outputs.branch_name }} \- --title "Auto-update documentation from Monday build" \- --body "This PR contains automatically generated documentation updates from the Monday build process.-- ## Changes detected- The following documentation files were updated:- $CHANGES_SUMMARY- $([ "$TOTAL_CHANGES" -gt 10 ] && echo "- ... and more files")-- ## Generation commands- Documentation was generated using:- - \`clojure -M:ee:doc environment-variables-documentation\`- - \`clojure -M:ee:doc config-template\`- - \`clojure -M:ee:doc api-documentation\`-- Please review the changes and merge if they look correct." \- --label "Type:Documentation" \- --label "no-backport"; then+ --title "Update generated docs (master)" \+ --body "API, config template, and environment variable doc updates.++## Changes made+$CHANGES_SUMMARY+$([ "$TOTAL_CHANGES" -gt 10 ] && echo "- ... and more files")++## Generation commands+Documentation was generated using:+- \`clojure -M:ee:doc environment-variables-documentation\`+- \`clojure -M:ee:doc config-template\`+- \`clojure -M:ee:doc api-documentation\`++Review the changes before merging." \+ --label "Type:Documentation" \+ --label "no-backport"; thenecho "PR created successfully on attempt $i"breakelsediff --git a/.github/workflows/docs-release-generate.yml b/.github/workflows/docs-release-generate.ymlnew file mode 100644index 00000000000..2423e0463ef--- /dev/null+++ b/.github/workflows/docs-release-generate.yml@@ -0,0 +1,143 @@+name: Auto-update documentation (release)++on:+ schedule:+ - cron: "0 1 * * 1-5" # Every Monday through Friday at 1 AM UTC+ workflow_dispatch:++# Define the release branch to target+env:+ RELEASE_BRANCH: release-x.56.x++permissions:+ contents: write+ pull-requests: write++jobs:+ update-docs:+ name: Update documentation+ runs-on: ubuntu-22.04+ timeout-minutes: 30+ steps:+ - name: Checkout code+ uses: actions/checkout@v4+ with:+ fetch-depth: 0+ token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}+ ref: ${{ env.RELEASE_BRANCH }}++ - name: Prepare backend environment+ uses: ./.github/actions/prepare-backend+ with:+ m2-cache-key: "auto-update-docs-release"++ - name: Generate environment variables documentation+ id: generate_env_docs+ run: |+ set -e # Exit on any error+ clojure -M:ee:doc environment-variables-documentation+ continue-on-error: false++ - name: Generate config template documentation+ id: generate_config_docs+ run: |+ set -e # Exit on any error+ clojure -M:ee:doc config-template+ continue-on-error: false++ - name: Generate API documentation+ id: generate_api_docs+ run: |+ set -e # Exit on any error+ clojure -M:ee:doc api-documentation+ continue-on-error: false++ - name: Check for changes+ id: check_changes+ run: |+ if git diff --quiet docs/; then+ echo "changes=false" >> $GITHUB_OUTPUT+ echo "No changes detected in docs directory"+ else+ echo "changes=true" >> $GITHUB_OUTPUT+ echo "Changes detected in docs directory"+ fi++ - name: Create branch and commit changes+ id: commit_and_push+ if: steps.check_changes.outputs.changes == 'true'+ run: |+ # Use timestamp with seconds to avoid conflicts+ BRANCH_NAME="docs/auto-update-release-$(date +%Y-%m-%d-%H%M%S)"++ git config user.name github-actions+ git config user.email [email protected]+ git checkout -b $BRANCH_NAME++ git add docs/+ git commit -m "Update generated docs (${{ env.RELEASE_BRANCH }})" --no-verify+ git push -u origin $BRANCH_NAME++ echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT++ - name: Create pull request+ if: steps.check_changes.outputs.changes == 'true'+ env:+ GITHUB_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}+ run: |+ # Generate a summary of changes+ CHANGES_SUMMARY=$(git diff --name-only HEAD~1 docs/ 2>/dev/null | head -10 | sed 's/^/- /' || echo "- No specific files detected")++ # Count total changes for conditional message+ TOTAL_CHANGES=$(git diff --name-only HEAD~1 docs/ 2>/dev/null | wc -l || echo "0")++ # Retry PR creation up to 3 times+ for i in {1..3}; do+ if gh pr create \+ --base ${{ env.RELEASE_BRANCH }} \+ --head ${{ steps.commit_and_push.outputs.branch_name }} \+ --title "Update generated docs (${{ env.RELEASE_BRANCH }})" \+ --body "API, config template, and environment variable doc updates.++## Changes made+$CHANGES_SUMMARY+$([ "$TOTAL_CHANGES" -gt 10 ] && echo "- ... and more files")++## Generation commands+Documentation was generated using:+- \`clojure -M:ee:doc environment-variables-documentation\`+- \`clojure -M:ee:doc config-template\`+- \`clojure -M:ee:doc api-documentation\`++Review the changes before merging." \+ --label "Type:Documentation" \+ --label "no-backport"; then+ echo "PR created successfully on attempt $i"+ break+ else+ echo "PR creation failed on attempt $i"+ if [ $i -eq 3 ]; then+ echo "All retry attempts failed. PR creation unsuccessful."+ exit 1+ fi+ echo "Retrying in 10 seconds..."+ sleep 10+ fi+ done++ - name: Skip PR creation+ if: steps.check_changes.outputs.changes == 'false'+ run: |+ echo "No documentation changes detected, skipping PR creation"++ - name: Workflow summary+ if: always()+ run: |+ if [ "${{ steps.check_changes.outputs.changes }}" == "true" ]; then+ echo "## ✅ Documentation Updated Successfully" >> $GITHUB_STEP_SUMMARY+ echo "- Created branch: \`${{ steps.commit_and_push.outputs.branch_name }}\`" >> $GITHUB_STEP_SUMMARY+ echo "- Created PR for review targeting ${{ env.RELEASE_BRANCH }}" >> $GITHUB_STEP_SUMMARY+ else+ echo "## ℹ️ No Documentation Changes" >> $GITHUB_STEP_SUMMARY+ echo "- All documentation is up to date" >> $GITHUB_STEP_SUMMARY+ fi