Skip to content

ProductDoctor: Reassure users about what was just verified, given the active stock availability mode #11337

ProductDoctor: Reassure users about what was just verified, given the active stock availability mode

ProductDoctor: Reassure users about what was just verified, given the active stock availability mode #11337

name: MacawUI migration
on:
pull_request:
types:
- opened
- labeled
- edited
- synchronize
permissions: {}
jobs:
current_state:
runs-on: ubuntu-latest
name: "Calculate current state"
permissions:
contents: read
outputs:
main_statistics: ${{ steps.store_import_stats.outputs.MAIN_STATISTICS }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.base.sha }}
persist-credentials: false
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: "package.json"
cache: "pnpm"
- name: Install deps
run: |
pnpm install
- name: Store import stats
id: store_import_stats
run: |
stats=$(pnpm exec depcruise --config .dependency-cruiser.mjs src --output-type json | jq ".summary.info")
echo "Statistics on main branch: ${stats}"
echo "MAIN_STATISTICS=${stats}" >> $GITHUB_OUTPUT
check_migation_status:
runs-on: ubuntu-latest
name: "Migration check"
needs: current_state
if: ${{ !contains( github.event.pull_request.labels.*.name, 'skip macaw migration check') }}
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: "package.json"
cache: "pnpm"
- name: Install deps
run: |
pnpm install
- name: "Calculate stats"
env:
latest: ${{ needs.current_state.outputs.main_statistics }}
run: |
current=$(pnpm exec depcruise --config .dependency-cruiser.mjs src --output-type json | jq ".summary.info")
difference=$(( $current - $latest ))
echo "Imports in main: ${latest}"
echo "Incoming imports: ${current}"
echo "Difference: ${difference}"
echo "IMPORT_DIFFERENCE=${difference}" >> $GITHUB_ENV
- name: "MacawUI regression reported"
if: ${{ env.IMPORT_DIFFERENCE > 0 }}
run: |
echo "Regression detected: +${IMPORT_DIFFERENCE} imports"
exit 1
- name: "MacawUI migration progress"
if: ${{ env.IMPORT_DIFFERENCE <= 0 }}
run: |
echo "Progress by: ${IMPORT_DIFFERENCE} imports"
exit 0