Skip to content

Commit ca02427

Browse files
CLOUDP-296431: Add IPA metrics release to OAS release workflow
1 parent f321972 commit ca02427

File tree

2 files changed

+33
-26
lines changed

2 files changed

+33
-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.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,22 @@ jobs:
178178
branch: ${{ inputs.branch }}
179179
foascli_version: ${{ inputs.foascli_version }}
180180

181+
release-IPA-metrics:
182+
name: Release IPA Validation Metrics
183+
needs: release
184+
if: ${{ inputs.env == 'dev' && needs.release.outputs.changes_detected == 'true' }}
185+
uses: ./.github/workflows/release-IPA-metrics.yml
186+
secrets:
187+
aws_access_key: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_USERNAME}}
188+
aws_secret_key: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PASSWORD}}
189+
aws_s3_bucket_prefix: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PREFIX}}
190+
api_bot_pat: ${{ secrets.api_bot_pat }}
191+
inputs:
192+
env: ${{ inputs.env }}
193+
181194
failure-handler:
182195
name: Failure Handler
183-
needs: [ release, release-postman, release-changelog ]
196+
needs: [ release, release-postman, release-changelog, release-IPA-metrics ]
184197
if: ${{ always() && contains(needs.*.result, 'failure') }}
185198
uses: ./.github/workflows/failure-handler.yml
186199
with:

0 commit comments

Comments
 (0)