Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After CDK Publish, Auto-Generate PR to Bump CDK in Connector Builder Repo #79

Closed
Tracked by #33
aaronsteers opened this issue Nov 20, 2024 · 2 comments
Closed
Tracked by #33

Comments

@aaronsteers
Copy link
Contributor

aaronsteers commented Nov 20, 2024

Example PR here:

Created from code here:

https://github.com/airbytehq/airbyte/pull/48470/files#diff-3249d7445228172f9b36422eb8685d1b2def3c8953331f8d393756c64d9be7e9L285-L388

  update-connector-builder:
    needs:
      - bump-version
      - bump-manifest-source
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-python@v4
        with:
          python-version: "3.10"
      - name: Checkout Airbyte Platform Internal
        uses: actions/checkout@v3
        with:
          repository: airbytehq/airbyte-platform-internal
          token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
      - name: Update CDK version
        run: |
          PREVIOUS_VERSION=$(cat oss/airbyte-connector-builder-resources/CDK_VERSION)
          sed -i "s/${PREVIOUS_VERSION}/${{needs.bump-version.outputs.new_cdk_version}}/g" oss/airbyte-connector-builder-server/Dockerfile
          sed -i "s/${PREVIOUS_VERSION}/${{needs.bump-version.outputs.new_cdk_version}}/g" cloud/airbyte-connector-builder-server-wrapped/Dockerfile
          sed -i "s/airbyte-cdk==${PREVIOUS_VERSION}/airbyte-cdk==${{needs.bump-version.outputs.new_cdk_version}}/g" oss/airbyte-connector-builder-server/requirements.in
          echo ${{needs.bump-version.outputs.new_cdk_version}} > oss/airbyte-connector-builder-resources/CDK_VERSION
          cd oss/airbyte-connector-builder-server
          pip install pip-tools
          pip-compile --upgrade
      - name: Create Pull Request
        id: create-pull-request
        uses: peter-evans/create-pull-request@v6
        with:
          token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
          commit-message: "chore: update CDK version following release"
          title: "chore: update CDK version following release"
          body: This is an automatically generated PR triggered by a CDK release
          branch: automatic-cdk-release
          base: master
          delete-branch: true
      - name: Post success to Slack channel dev-connectors-extensibility
        uses: slackapi/[email protected]
        continue-on-error: true
        with:
          channel-id: C04J1M66D8B
          payload: |
            {
                "text": "A new version of Python CDK has been released!",
                "blocks": [
                    {
                        "type": "section",
                        "text": {
                            "type": "mrkdwn",
                            "text": "A new version of Python CDK has been released with <https://github.com/airbytehq/airbyte/blob/master/airbyte-cdk/python/CHANGELOG.md|changelog>: ${{ github.event.inputs.changelog-message }}\n\n"
                        }
                    },
                    {
                        "type": "section",
                        "text": {
                            "type": "mrkdwn",
                            "text": "A PR has also been created for the <${{ steps.create-pull-request.outputs.pull-request-url }}|Connector Builder>\n"
                        }
                    },
                    {
                        "type": "section",
                        "text": {
                            "type": "mrkdwn",
                            "text": "See details on <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|GitHub>\n"
                        }
                    }
                ]
            }
        env:
          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
      - name: Post failure to Slack channel dev-connectors-extensibility
        if: ${{ failure() }}
        uses: slackapi/[email protected]
        continue-on-error: true
        with:
          channel-id: C04J1M66D8B
          payload: |
            {
                "text": ":warning: A new version of Python CDK has been released but Connector Builder hasn't been automatically updated",
                "blocks": [
                    {
                        "type": "section",
                        "text": {
                            "type": "mrkdwn",
                            "text": "A new version of Python CDK has been released with <https://github.com/airbytehq/airbyte/blob/master/airbyte-cdk/python/CHANGELOG.md|changelog>: ${{ github.event.inputs.changelog-message }}\n\n"
                        }
                    },
                    {
                        "type": "section",
                        "text": {
                            "type": "mrkdwn",
                            "text": ":warning: Could not automatically create a PR for Connector Builder>\n"
                        }
                    },
                    {
                        "type": "section",
                        "text": {
                            "type": "mrkdwn",
                            "text": "See details on <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|GitHub>\n"
                        }
                    }
                ]
            }
        env:
          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
This was referenced Nov 20, 2024
@erohmensing
Copy link
Contributor

There are 2 separate things at play here

  • the version of the CDK used in the builder: this is done via the autogenerated PR and merged manually
  • the SDM version used by running syncs: we auto-update the version so that it mirrors more of a cloud-like experience of getting new updates automatically. This is handled by the DeclarativeSourcesUpdater which keeps a list in the db of the latest version for each major version.

octavia-squidington-iii pushed a commit to airbytehq/airbyte-platform that referenced this issue Dec 3, 2024
Update the platform's CDK version to v6.7.2.

This PR was manually created by running the commands that used to run as part of a github action, modified slightly to hardcode the new version and work when running locally on a mac (i.e. adding `''` after `-i` in `sed`, see [this SO post](https://stackoverflow.com/a/42667816) for why):
```
PREVIOUS_VERSION=$(cat oss/airbyte-connector-builder-resources/CDK_VERSION)
NEW_VERSION=6.7.2
sed -i '' "s/${PREVIOUS_VERSION}/${NEW_VERSION}/g" oss/airbyte-connector-builder-server/Dockerfile
sed -i '' "s/${PREVIOUS_VERSION}/${NEW_VERSION}/g" cloud/airbyte-connector-builder-server-wrapped/Dockerfile
sed -i '' "s/airbyte-cdk==${PREVIOUS_VERSION}/airbyte-cdk==${NEW_VERSION}/g" oss/airbyte-connector-builder-server/requirements.in
echo ${NEW_VERSION} > oss/airbyte-connector-builder-resources/CDK_VERSION
cd oss/airbyte-connector-builder-server
pip install pip-tools
pip-compile --upgrade
```

This will be automated again soon; see [this issue](airbytehq/airbyte-python-cdk#79)
@aaronsteers
Copy link
Contributor Author

Closing as complete. Was shipped a little while ago...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants