Repository: mindsdb/mindsdb
Pull request: Added Job to Trigger a Release of the Docker Desktop Extension
## Description

This PR adds a job to the production workflow that deploys MindsDB artifacts to trigger a new release of the Docker Desktop extension. This is done by triggering [this workflow](https://github.com/mindsdb/mindsdb-docker-extension/blob/main/.github/workflows/bump-mindsdb-version.yml) setup in the repository for the extension.

Fixes https://github.com/mindsdb/mindsdb-docker-extension/issues/6
Fixes https://github.com/mindsdb/mindsdb_private/issues/575

## Type of change

- [X] ⚡ New feature (non-breaking change which adds functionality)

## Checklist:

- [ ] My code follows the style guidelines(PEP 8) of MindsDB - N/A
- [X] I have appropriately commented on my code, especially in complex areas.
- [ ] Necessary documentation updates are either made or tracked in issues.
- [ ] Relevant unit and integration tests are updated or added - N/A

Problem statement:
Auto-update MindsDB Container When New Image is Released
At the moment, since the extension is using Docker Compose to bring up the containers, if the MindsDB image (mindsdb/mindsdb:latest) has already been pulled by the user (or if the extension was installed) and a new version of the image is released subsequently, the extension will continue to use the old version of the image. This is the default behavior of Docker Compose.

Ideally, each time a new version of the MindsDB image (latest tag) is released, the extension should begin using it. However, one slight issue that arises in doing so is the fact that, because Docker Compose will spin up a brand new container with the new version of the image that is pulled, any changes that were made to the previous container will be lost. This applies mostly to the dependencies that are installed for integrations by the user; these will be lost as a result of the update.

Therefore, while the image is auto-updated, it is also necessary to persist the dependencies that were installed by the user across new versions.

Hints from issue discussion:
Only partially resolved by https://github.com/mindsdb/mindsdb-docker-extension/pull/12

Commit message: updated the var used to access tag

Patch to review:
diff --git a/.github/workflows/build_deploy_prod.yml b/.github/workflows/build_deploy_prod.yml
index 9b5541cbb61..09002cc02c6 100644
--- a/.github/workflows/build_deploy_prod.yml
+++ b/.github/workflows/build_deploy_prod.yml
@@ -4,8 +4,8 @@ on:
   release:
     types: [published]
     paths-ignore:
-      - 'docs/**'
-      - 'README.md'
+      - "docs/**"
+      - "README.md"
 
 # Cancel any existing runs of this workflow on the same branch/pr
 # We always want to build/deploy/test a new commit over an older one
@@ -18,38 +18,38 @@ jobs:
     runs-on: mdb-dev
     if: github.actor != 'mindsdbadmin'
     steps:
-    - uses: actions/checkout@v4
-    # Get clean environment variables via https://github.com/marketplace/actions/github-environment-variables-action
-    - uses: FranzDiebold/github-env-vars-action@v2
-    - name: Set up Python
-      uses: actions/setup-python@v5.1.0
-      with:
-        python-version: ${{ vars.CI_PYTHON_VERSION }}
-    - name: Check Version
-      run: |
-        PYTHONPATH=./ python tests/scripts/check_version.py ${{ env.CI_REF_NAME }} ${{ github.event.release.prerelease }}
+      - uses: actions/checkout@v4
+      # Get clean environment variables via https://github.com/marketplace/actions/github-environment-variables-action
+      - uses: FranzDiebold/github-env-vars-action@v2
+      - name: Set up Python
+        uses: actions/setup-python@v5.1.0
+        with:
+          python-version: ${{ vars.CI_PYTHON_VERSION }}
+      - name: Check Version
+        run: |
+          PYTHONPATH=./ python tests/scripts/check_version.py ${{ env.CI_REF_NAME }} ${{ github.event.release.prerelease }}
 
   deploy_to_pypi:
     runs-on: mdb-dev
     needs: check-version
     if: github.actor != 'mindsdbadmin'
     steps:
-    - uses: actions/checkout@v4
-    - name: Set up Python
-      uses: actions/setup-python@v5.1.0
-      with:
-        python-version: ${{ vars.CI_PYTHON_VERSION }}
-    - name: Install dependencies
-      run: |
-        pip install -r requirements/requirements-dev.txt
-    - name: Build and publish
-      env:
-        TWINE_USERNAME:  __token__
-        TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
-      run: |
-        # This uses the version string from __about__.py, which we checked matches the git tag above
-        python setup.py sdist
-        twine upload dist/*
+      - uses: actions/checkout@v4
+      - name: Set up Python
+        uses: actions/setup-python@v5.1.0
+        with:
+          python-version: ${{ vars.CI_PYTHON_VERSION }}
+      - name: Install dependencies
+        run: |
+          pip install -r requirements/requirements-dev.txt
+      - name: Build and publish
+        env:
+          TWINE_USERNAME: __token__
+          TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+        run: |
+          # This uses the version string from __about__.py, which we checked matches the git tag above
+          python setup.py sdist
+          twine upload dist/*
 
   docker_build:
     # Build our docker images based on our bake file
@@ -114,9 +114,31 @@ jobs:
           ref: main
           client_payload: '{"image-tag-prefix": "${{ env.CI_REF_NAME }}", "deploy-env": "prod"}'
 
+  trigger_dd_extension_release:
+    # Trigger private repo to deploy to prod env
+    runs-on: mdb-dev
+    needs: docker_build
+    if: github.actor != 'mindsdbadmin'
+    environment:
+      name: prod
+    # We only want to run one deploy job for an env at a time
+    # Don't cancel in progress jobs because it may be for a different PR
+    concurrency:
+      group: deploy-prod
+      cancel-in-progress: false
+    steps:
+      - uses: FranzDiebold/github-env-vars-action@v2
+      - uses: convictional/trigger-workflow-and-wait@v1.6.5
+        with:
+          owner: mindsdb
+          repo: mindsdb-docker-extension
+          github_token: ${{ secrets.DD_EXT_REPO_DISPATCH_PAT_TOKEN }}
+          workflow_file_name: bump-mindsdb-version.yml
+          ref: main
+          client_payload: '{"version": "${{ env.CI_REF_NAME_SLUG }}"}'
 
   run_tests:
     name: Run Post-Deploy Tests
     needs: [trigger_deploy]
     uses: ./.github/workflows/test_on_deploy.yml
-    secrets: inherit
\ No newline at end of file
+    secrets: inherit


Code review comments:
diff_hunk: @@ -114,9 +114,31 @@ jobs:
           ref: main
           client_payload: '{"image-tag-prefix": "${{ env.CI_REF_NAME }}", "deploy-env": "prod"}'
 
+  trigger_dd_extension_release:
+    # Trigger private repo to deploy to prod env
+    runs-on: mdb-dev
+    needs: docker_build
+    if: github.actor != 'mindsdbadmin'
+    environment:
+      name: prod
+    # We only want to run one deploy job for an env at a time
+    # Don't cancel in progress jobs because it may be for a different PR
+    concurrency:
path: .github/workflows/build_deploy_prod.yml
text: @user1:
I think you can get rid of the concurrency group here

@author:
Done.

diff_hunk: @@ -114,9 +114,31 @@ jobs:
           ref: main
           client_payload: '{"image-tag-prefix": "${{ env.CI_REF_NAME }}", "deploy-env": "prod"}'
 
+  trigger_dd_extension_release:
+    # Trigger private repo to deploy to prod env
+    runs-on: mdb-dev
+    needs: docker_build
+    if: github.actor != 'mindsdbadmin'
+    environment:
+      name: prod
+    # We only want to run one deploy job for an env at a time
+    # Don't cancel in progress jobs because it may be for a different PR
+    concurrency:
+      group: deploy-prod
+      cancel-in-progress: false
+    steps:
+      - uses: FranzDiebold/github-env-vars-action@v2
+      - uses: convictional/trigger-workflow-and-wait@v1.6.5
+        with:
+          owner: mindsdb
+          repo: mindsdb-docker-extension
+          github_token: ${{ secrets.DD_EXT_REPO_DISPATCH_PAT_TOKEN }}
path: .github/workflows/build_deploy_prod.yml
text: @user1:
Can we use `REPO_DISPATCH_PAT_TOKEN` here? I have updated `REPO_DISPATCH_PAT_TOKEN` to allow access to the docker extension repo

@author:
Done.