Skip to content

Generate Preview SDK #316

Generate Preview SDK

Generate Preview SDK #316

name: Generate Preview SDK
on:
workflow_dispatch:
schedule:
- cron: '30 8 * * 1,3,5'
jobs:
generate-client:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: make install-goimports
- name: Fetch changes
working-directory: ./tools
run: make fetch_openapi
env:
API_BASE_URL: ${{ secrets.MDB_CURRENT_API_PREVIEW_URL }}
S3_BUCKET: ${{ secrets.MDB_CURRENT_API_PREVIEW_S3_BUCKET }}
- name: Verify Changed files
uses: tj-actions/verify-changed-files@530d86d0a237225c87beaa000750988f8965ee31
id: verify-changed-files
with:
files: |
**/atlas-api.yaml
- name: Run generation
if: steps.verify-changed-files.outputs.files_changed == 'true'
working-directory: ./tools
run: |
export PATH=${PATH}:`go env GOPATH`/bin
make clean_and_generate
- name: Update Preview version
if: steps.verify-changed-files.outputs.files_changed == 'true'
working-directory: ./tools
run: make preview-version
- name: Run mock generation
working-directory: ./tools
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: make generate_mocks
- uses: peter-evans/create-pull-request@v7
if: steps.verify-changed-files.outputs.files_changed == 'true'
with:
token: ${{ secrets.APIX_BOT_PAT }}
title: "APIBot: GO SDK Dev Preview"
commit-message: "temp: client update"
delete-branch: true
draft: true
branch: dev-latest
body: |
Automatic update for MongoDB Atlas Go Client based on *release candidate* OpenAPI file.
**DO NOT MERGE THIS PR TO THE MAIN BRANCH**
> NOTE: This PR provides notifications for stability of the RC OpenAPI files
> It is not intented to be merged!
> When PR is closed the new PR will be automatically regenerated
## Using early preview changes
```sh
go get github.com/mongodb/atlas-sdk-go@dev-latest
```
## Automated checks done for preview sdk
1. Compilation and unit tests
2. Documentation style
3. Transformation engine linting
## Breaking Changes
For list of possible breaking changes please refer to `Detect Breaking Changes` job.
## Release schedule
PR is updated 3 times a week with latest changes from the RC for the API.
PR can be updated manually by running workflow: https://github.com/mongodb/atlas-sdk-go/actions/workflows/autoupdate-preview.yaml