Skip to content

Commit 0043ebd

Browse files
CLOUDP-296431: Add IPA metrics release to OAS release workflow (#388)
1 parent f321972 commit 0043ebd

File tree

3 files changed

+42
-26
lines changed

3 files changed

+42
-26
lines changed

.github/workflows/release-IPA-metrics.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,19 @@ name: IPA Validation Metrics Release
22
on:
33
workflow_call:
44
secrets: # all secrets are passed explicitly in this workflow
5-
# aws_access_key:
6-
# required: true
7-
# aws_secret_key:
8-
# required: true
9-
# aws_s3_bucket_prefix:
10-
# required: true
11-
api_bot_pat:
5+
aws_access_key:
6+
required: true
7+
aws_secret_key:
128
required: true
13-
IPA_S3_BUCKET_DW_STAGING_USERNAME:
9+
aws_s3_bucket_prefix:
1410
required: true
15-
IPA_S3_BUCKET_DW_STAGING_PASSWORD:
11+
api_bot_pat:
1612
required: true
17-
IPA_S3_BUCKET_DW_STAGING_PREFIX:
13+
inputs:
14+
env:
15+
description: 'Environment for the FOAS to use for IPA metrics collection'
1816
required: true
19-
# inputs:
20-
# env:
21-
# description: 'Environment for the FOAS to use for IPA metrics collection'
22-
# required: true
23-
# type: string
17+
type: string
2418
workflow_dispatch:
2519

2620
permissions:
@@ -67,21 +61,21 @@ jobs:
6761
- name: Install npm dependencies
6862
run: npm install
6963

70-
# - name: Download openapi-foas
71-
# uses: actions/download-artifact@v4
72-
# with:
73-
# name: openapi-foas-dev # TODO: Change to passed input env
74-
# github-token: ${{ secrets.api_bot_pat }}
75-
# run-id: ${{ github.run_id }}
64+
- name: Download openapi-foas
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: openapi-foas-${{ inputs.env }}
68+
github-token: ${{ secrets.api_bot_pat }}
69+
run-id: ${{ github.run_id }}
7670

7771
- name: Run Metric Collection Job
7872
working-directory: ./tools/spectral/ipa/metrics/scripts
79-
run: node runMetricCollection.js ../../../../../openapi/v2.json # TODO: Change to foas from above
73+
run: node runMetricCollection.js ../../../../../openapi-foas.json
8074

8175
- name: Dump Metric Collection Job Data to S3
8276
env:
83-
AWS_ACCESS_KEY_ID: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_USERNAME }} # TODO: Change to passed secret
84-
AWS_SECRET_ACCESS_KEY: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PASSWORD }} # TODO: Change to passed secret
85-
S3_BUCKET_PREFIX: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PREFIX }} # TODO: Change to passed secret
77+
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key }}
78+
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_key }}
79+
S3_BUCKET_PREFIX: ${{ secrets.aws_s3_bucket_prefix }}
8680
working-directory: ./tools/spectral/ipa/metrics/scripts
8781
run: node dataDump.js

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
secrets:
5353
api_bot_pat: ${{ secrets.API_BOT_PAT }}
5454
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
55+
ipa_aws_access_key: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_USERNAME}}
56+
ipa_aws_secret_key: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PASSWORD}}
57+
ipa_aws_s3_bucket_prefix: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PREFIX}}
5558
with:
5659
aws_default_region: ${{ vars.AWS_DEFAULT_REGION}}
5760
aws_s3_bucket: ${{ vars.S3_BUCKET_DEV}}

.github/workflows/release-spec.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ on:
4343
required: false
4444
jira_api_token:
4545
required: true
46+
ipa_aws_access_key:
47+
required: false
48+
ipa_aws_secret_key:
49+
required: false
50+
ipa_aws_s3_bucket_prefix:
51+
required: false
4652

4753
permissions:
4854
contents: write
@@ -178,9 +184,22 @@ jobs:
178184
branch: ${{ inputs.branch }}
179185
foascli_version: ${{ inputs.foascli_version }}
180186

187+
release-IPA-metrics:
188+
name: Release IPA Validation Metrics
189+
needs: release
190+
if: ${{ inputs.env == 'dev' && needs.release.outputs.changes_detected == 'true' }}
191+
uses: ./.github/workflows/release-IPA-metrics.yml
192+
secrets:
193+
aws_access_key: ${{ secrets.ipa_aws_access_key}}
194+
aws_secret_key: ${{ secrets.ipa_aws_secret_key}}
195+
aws_s3_bucket_prefix: ${{ secrets.ipa_aws_s3_bucket_prefix}}
196+
api_bot_pat: ${{ secrets.api_bot_pat }}
197+
with:
198+
env: ${{ inputs.env }}
199+
181200
failure-handler:
182201
name: Failure Handler
183-
needs: [ release, release-postman, release-changelog ]
202+
needs: [ release, release-postman, release-changelog, release-IPA-metrics ]
184203
if: ${{ always() && contains(needs.*.result, 'failure') }}
185204
uses: ./.github/workflows/failure-handler.yml
186205
with:

0 commit comments

Comments
 (0)