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

CLOUDP-269114: Change release postman trigger #192

Merged
merged 8 commits into from
Aug 22, 2024
23 changes: 14 additions & 9 deletions .github/workflows/release-postman.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
name: Postman Release
on:
pull_request:
branches:
- main
types:
- closed
workflow_call:
inputs:
atlas_prod_base_url:
description: 'Base URL of Atlas.'
required: true
type: string
secrets: # all secrets are passed explicitly in this workflow
postman_api_key:
required: true
workspace_id:
required: true
workflow_dispatch:
permissions:
issues: write

jobs:
release-postman:
if: ${{ github.head_ref == 'api-bot-update' && github.event.pull_request.merged }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -40,7 +45,7 @@ jobs:
- name: Transform Postman Collection
id: transform
env:
BASE_URL: ${{ vars.ATLAS_PROD_BASE_URL }}
BASE_URL: ${{ inputs.atlas_prod_base_url }}
working-directory: ./tools/postman
run: |
make transform_collection
Expand All @@ -56,8 +61,8 @@ jobs:

- name: Upload Collection to Postman
env:
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
WORKSPACE_ID: ${{ secrets.WORKSPACE_ID }}
POSTMAN_API_KEY: ${{ secrets.postman_api_key }}
WORKSPACE_ID: ${{ secrets.workspace_id }}
working-directory: ./tools/postman
run: |
make upload_collection
3 changes: 3 additions & 0 deletions .github/workflows/release-spec-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ jobs:
api_bot_pat: ${{ secrets.API_BOT_PAT }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_PROD }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PROD }}
postman_api_key: ${{ secrets.POSTMAN_API_KEY }}
workspace_id: ${{ secrets.WORKSPACE_ID }}
with:
aws_default_region: ${{ vars.AWS_DEFAULT_REGION}}
aws_s3_bucket: ${{ vars.S3_BUCKET_PROD}}
env: prod
branch: main
spectral_version: ${{ vars.SPECTRAL_VERSION }}
foascli_version: ${{ vars.FOASCLI_VERSION }}
atlas_prod_base_url: ${{ vars.ATLAS_PROD_BASE_URL }}
23 changes: 22 additions & 1 deletion .github/workflows/release-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@ on:
description: 'Version of FOASCLI to use.'
required: true
type: string
atlas_prod_base_url:
description: 'Base URL of Atlas.'
required: false
type: string
secrets: # all secrets are passed explicitly in this workflow
api_bot_pat:
required: true
aws_access_key_id:
required: true
aws_secret_access_key:
required: true

postman_api_key:
required: false
workspace_id:
required: false

permissions:
contents: write
issues: write
Expand Down Expand Up @@ -77,6 +85,8 @@ jobs:
name: Release OpenAPI Spec
runs-on: ubuntu-latest
needs: [run-required-validations]
outputs:
changes_detected: ${{ steps.commit.outputs.changes_detected }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down Expand Up @@ -149,3 +159,14 @@ jobs:
title: "(${{env.target_env}}) Release: the Commit Changes step failed :scream_cat:"
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
token: ${{ secrets.GITHUB_TOKEN }}

release-postman:
name: Release Postman
needs: [release]
if: ${{ inputs.env == 'Prod' && needs.release.outputs.changes_detected == 'true' }}
Luke-Sanderson marked this conversation as resolved.
Show resolved Hide resolved
uses: ./.github/workflows/release-postman.yml
secrets:
postman_api_key: ${{ secrets.postman_api_key }}
workspace_id: ${{ secrets.workspace_id }}
with:
atlas_prod_base_url: ${{ inputs.atlas_prod_base_url}}
4 changes: 3 additions & 1 deletion tools/postman/collection-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ Once you have your cluster up and running, follow [this guide](https://www.mongo
- public API key as the value for a key named \`mongodb-public-api-key\`
- private API key as the value for a key named \`mongodb-private-api-key\`

You can now explore the various endpoints. For each endpoint, edit the query and path variables such as group ID and organization ID. For some requests, like POST requests, editing the body of the request is also required.
You can now explore the various endpoints. For each endpoint, edit the query and path variables such as group ID and organization ID. For some requests, like POST requests, editing the body of the request is also required.

For more details, you can follow along with the [Configuring Atlas in Postman With the Atlas Administration API](https://www.mongodb.com/developer/products/atlas/admin-api-postman/) blog.
Loading