Skip to content

Generate Preview SDK #488

Generate Preview SDK

Generate Preview SDK #488

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@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
with:
go-version-file: 'go.mod'
- run: make install-goimports
- name: Fetch changes
working-directory: ./tools
run: make fetch_openapi
env:
API_BASE_URL: https://raw.githubusercontent.com/mongodb/openapi/refs/heads/dev/openapi/v2
- name: Verify Changed files
run: |
FILES_CHANGED=false
if git diff --name-only | grep -qE '^openapi/atlas-api.yaml'; then
FILES_CHANGED=true
fi
echo "FILES_CHANGED=${FILES_CHANGED}" >> "$GITHUB_ENV"
- name: Run generation
if: env.FILES_CHANGED == 'true'
working-directory: ./tools
run: |
export PATH=${PATH}:`go env GOPATH`/bin
make clean_and_generate
- name: Update Preview version
if: env.FILES_CHANGED == 'true'
working-directory: ./tools
run: make preview-version
- name: Run mock generation
working-directory: ./tools
if: env.FILES_CHANGED == 'true'
run: make generate_mocks
- name: Fix import order issues
run: goimports -l -w .
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
if: env.FILES_CHANGED == 'true'
with:
token: ${{ secrets.APIX_BOT_PAT }}
title: "APIBot: GO SDK Dev Preview"
commit-message: "temp: client update"
delete-branch: 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