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-298521: Decouple IPA Metrics Collection Job from FOAS Release GH Workflow (fixes) #405

Merged
merged 35 commits into from
Feb 6, 2025
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 25 additions & 26 deletions .github/workflows/release-IPA-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,58 @@ on:
workflow_dispatch:
permissions:
issues: write
env:
NODE_VERSION: '20.x'
OAS_BRANCH: 'dev'
OAS_FILE: 'openapi/v2.json'
IPA_PATH: ${{ github.workspace }}/ipa
DEV_OAS_PATH: ${{ github.workspace }}/dev-oas
contents: write

jobs:
# Generates and uploads the IPA validation metrics to S3
release-IPA-metrics:
name: Release IPA Validation Metrics
runs-on: ubuntu-latest
steps:
- name: Checkout repository (scripts)
- name: Fetch OAS file from Dev Branch
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
sparse-checkout:
tools/spectral/ipa
path: ipa
ref: 'dev'
sparse-checkout: openapi/v2.json

- name: Checkout repository (dev branch)
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Upload OAS file
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
ref: $OAS_BRANCH
sparse-checkout: $OAS_FILE
path: dev-oas
name: oas-dev
path: openapi/v2.json

- name: Validate OAS file
run: |
if [ ! -f "dev-oas/$OAS_FILE" ]; then
echo "::error::OAS file not found in $OAS_BRANCH branch"
exit 1
fi
- name: Checkout repository (scripts)
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
sparse-checkout: |
tools/spectral/ipa
package.json
package-lock.json

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: $NODE_VERSION
node-version: '20.x'
cache: 'npm'

- name: Install npm dependencies
run: npm install

- name: Download oas-dev
uses: actions/download-artifact@v4
with:
name: oas-dev

- name: Run Metric Collection Job
working-directory: $IPA_PATH/metrics/scripts
run: node runMetricCollection.js "$DEV_OAS_PATH/openapi/v2.json"
working-directory: tools/spectral/ipa/metrics/scripts
run: node runMetricCollection.js "${{ github.workspace }}/v2.json"

- name: Dump Metric Collection Job Data to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_USERNAME }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PASSWORD }}
S3_BUCKET_PREFIX: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PREFIX }}
working-directory: $IPA_PATH/metrics/scripts
working-directory: tools/spectral/ipa/metrics/scripts
run: node dataDump.js

failure-handler:
Expand All @@ -68,7 +67,7 @@ jobs:
if: ${{ failure() }}
uses: ./.github/workflows/failure-handler.yml
with:
env: $OAS_BRANCH
env: 'dev'
release_name: "IPA Metrics"
secrets:
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
Loading