Skip to content

Commit 4cb147f

Browse files
CLOUDP-285964: Merge main
2 parents d509d03 + ac5b7e4 commit 4cb147f

28 files changed

+105246
-28
lines changed

.github/workflows/release-spec-runner.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,19 @@ jobs:
117117
spectral_version: ${{ vars.SPECTRAL_VERSION }}
118118
foascli_version: ${{ vars.FOASCLI_VERSION }}
119119
atlas_prod_base_url: ${{ vars.ATLAS_PROD_BASE_URL }}
120+
121+
release-spec-v1-prod:
122+
name: Release OpenAPI Spec V1 (Deprecated) for PROD
123+
if: >-
124+
github.event_name == 'schedule' || contains(inputs.env_to_release, 'prod')
125+
uses: ./.github/workflows/release-spec-v1.yml
126+
secrets:
127+
api_bot_pat: ${{ secrets.API_BOT_PAT }}
128+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_PROD }}
129+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PROD }}
130+
mms_deployed_sha_url: ${{ secrets.MMS_DEPLOYED_SHA_URL_PROD }}
131+
with:
132+
aws_default_region: ${{ vars.AWS_DEFAULT_REGION}}
133+
aws_s3_bucket: ${{ vars.S3_BUCKET_PROD}}
134+
env: prod
135+
branch: main
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: 'Release OpenAPI Spec V1 for a given environment'
2+
on:
3+
workflow_call:
4+
inputs:
5+
aws_default_region:
6+
description: 'AWS Default Region.'
7+
required: true
8+
type: string
9+
aws_s3_bucket:
10+
description: 'AWS S3 Bucket.'
11+
required: true
12+
type: string
13+
env:
14+
description: 'Environment to generate the OpenAPI Spec for.'
15+
required: true
16+
type: string
17+
branch:
18+
description: 'Branch to release the OpenAPI Spec to.'
19+
required: true
20+
type: string
21+
secrets: # all secrets are passed explicitly in this workflow
22+
api_bot_pat:
23+
required: true
24+
aws_access_key_id:
25+
required: true
26+
aws_secret_access_key:
27+
required: true
28+
mms_deployed_sha_url:
29+
required: true
30+
31+
permissions:
32+
contents: write
33+
issues: write
34+
35+
jobs:
36+
release-v1-oas-apis:
37+
name: Release OpenAPI Spec for V1 (DEPRECATED) APIs
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Download v1 Spec
41+
env:
42+
AWS_DEFAULT_REGION: ${{inputs.aws_default_region}}
43+
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
44+
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
45+
S3_BUCKET: ${{ inputs.aws_s3_bucket }}
46+
MMS_DEPLOYED_SHA_URL: ${{secrets.mms_deployed_sha_url}}
47+
run: |
48+
sha=$(curl "${MMS_DEPLOYED_SHA_URL}")
49+
echo "Downloading the OpenAPI Spec for v1 with sha ${sha}"
50+
aws s3 cp "s3://${S3_BUCKET}/openapi/oas/mms-v1/${sha}.json" "v1.json"
51+
- name: Generate YAML spec
52+
run: |
53+
sudo snap install yq
54+
yq -P '.' v1.json > v1.yaml
55+
- name: Upload artifact
56+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
57+
with:
58+
name: openapi-v1-${{ inputs.env }}
59+
path: |
60+
v1.json
61+
v1.yaml
62+
- name: Checkout repository
63+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
64+
with:
65+
ref: ${{ inputs.branch }}
66+
token: ${{secrets.api_bot_pat}}
67+
- name: Download artifact
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: openapi-v1-${{ inputs.env }}
71+
github-token: ${{ secrets.api_bot_pat }}
72+
run-id: ${{ github.run_id }}
73+
path: openapi/v1-deprecated
74+
- name: Commit changes
75+
id: commit
76+
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
77+
env:
78+
target_env: ${{ inputs.env }}
79+
target_branch: ${{ inputs.branch }}
80+
run_id: ${{ github.run_id }}
81+
with:
82+
commit_message: "(${{env.target_env}}) Release OpenAPI Spec V1 :rocket:. See https://github.com/mongodb/openapi/actions/runs/${{env.run_id}}."
83+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
84+
branch: ${{env.target_branch}}
85+
file_pattern: "openapi/v1-deprecated/*"

.github/workflows/release-spec.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
spectral_version: ${{ vars.SPECTRAL_VERSION }}
8686

8787
release:
88-
name: Release OpenAPI Spec
88+
name: Release OpenAPI Spec for V2 APIs
8989
runs-on: ubuntu-latest
9090
needs: [run-required-validations]
9191
outputs:
@@ -152,7 +152,7 @@ jobs:
152152
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
153153
branch: ${{env.target_branch}}
154154
file_pattern: "openapi/*"
155-
155+
156156
release-postman:
157157
name: Release Postman
158158
needs: [release]

changelog/internal/metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"runDate": "2024-12-06",
3-
"specRevision": "b903698c32d68d6f0309672dac59ac77f616d50e",
4-
"specRevisionShort": "b903698c32d",
3+
"specRevision": "242018939c903b554d80a3ddb640394b701c7832",
4+
"specRevisionShort": "242018939c9",
55
"versions": [
66
"2023-01-01",
77
"2023-02-01",

openapi/v1-deprecated/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
> [!WARNING]
44
> The APIs in these OpenAPI Specifications are deprecated. Please use the OpenAPI Specifications of the v2 APIs available at [openapi/v2](../v2).
55
6+
[![OpenAPI (jp)](https://img.shields.io/badge/openapi-click%20to%20preview-rgb(71%2C162%2C72)?style=for-the-badge&logo=mongodb)](https://htmlpreview.github.io/?https://github.com/mongodb/openapi/blob/main/openapi/v1-deprecated/branded-preview.html)
7+
[![GO SDK (jp)](https://img.shields.io/badge/GO%20SDK-click%20to%20open-rgb(21%2C151%2C183)?style=for-the-badge&logo=go)](https://github.com/mongodb/go-client-mongodb-atlas)
68

79
This folder contains the OpenAPI Specifications of the MongoDB Atlas Administration API (1.0).
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<body>
4+
<h2>Preview docs for:</h2>
5+
<ul>
6+
<li><a href='https://www.mongodb.com/docs/openapi/preview/?src=https://raw.githubusercontent.com/mongodb/openapi/main/openapi/v1-deprecated/v1.json' target="_blank">v1.json</a></li><li><a href='https://www.mongodb.com/docs/openapi/preview/?src=https://raw.githubusercontent.com/mongodb/openapi/main/openapi/v1-deprecated/v1.yaml' target="_blank">v1.yaml</a></li>
7+
</ul>
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)