Skip to content

MSD diff

MSD diff #88

name: MSD Diff
on:
pull_request:
branches:
- "main"
paths:
- 'rs/ic-observability/multiservice-discovery*/src/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
msd-diff:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: "🔧 Setup runner"
uses: ./.github/workflows/manage-runner-pre
- name: "📥 Download main test artifact"
uses: dawidd6/[email protected]
with:
name: test-artifacts
branch: main
workflow: main.yaml
- name: "🔭 Compute MSD"
id: msd-diff
run: |
set -exuo pipefail
REGISTRY_DIR="$HOME/tmp/main-registry"
TARGETS_DIR_MAIN="$HOME/main-targets"
TARGETS_DIR_BRANCH="$HOME/branch-targets"
mkdir -p "$REGISTRY_DIR" \
"$TARGETS_DIR_MAIN" \
"$TARGETS_DIR_BRANCH"
chmod +x multiservice-discovery
# Run multiservice-discovery for main targets
./multiservice-discovery \
--targets-dir "$REGISTRY_DIR" \
--render-prom-targets-to-stdout > "$TARGETS_DIR_MAIN/targets.json"
# Run multiservice-discovery for branch targets with bazel
bazel run //rs/ic-observability/multiservice-discovery -- \
--targets-dir "$REGISTRY_DIR" \
--render-prom-targets-to-stdout > "$TARGETS_DIR_BRANCH/targets.json"
echo "targets_main=$TARGETS_DIR_MAIN" >> $GITHUB_OUTPUT
echo "targets_branch=$TARGETS_DIR_BRANCH" >> $GITHUB_OUTPUT
- name: "Check MSD Diff"
uses: "int128/diff-action@v1"
with:
base: ${{ steps.msd-diff.outputs.targets_main }}
head: ${{ steps.msd-diff.outputs.targets_branch }}
comment-header: |
## MSD Diff
Remove `prevent-merging-MSD-diff` label to merge after inspection
label: prevent-merging-MSD-diff