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

MSD diff #149

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
66 changes: 66 additions & 0 deletions .github/workflows/multiservice-discovery-diff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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_MAIN="$HOME/tmp/main-registry"
REGISTRY_DIR_BRANCH="$HOME/tmp/branch-registry"
TARGETS_DIR_MAIN="$HOME/main-targets"
TARGETS_DIR_BRANCH="$HOME/branch-targets"

mkdir -p "$REGISTRY_DIR_MAIN" \
"$REGISTRY_DIR_BRANCH" \
"$TARGETS_DIR_MAIN" \
"$TARGETS_DIR_BRANCH"
chmod +x multiservice-discovery

# Run multiservice-discovery for main targets
./multiservice-discovery \
--targets-dir "$REGISTRY_DIR_MAIN" \
--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_BRANCH" \
--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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Serialize for PrometheusFileSdConfig {
#[derive(Debug, Clone)]
pub struct PrometheusConfigBuilder {}

pub const IC_NAME: &str = "ic";
pub const IC_NAME: &str = "ic-test-diff";
pub const IC_NODE: &str = "ic_node";
pub const IC_SUBNET: &str = "ic_subnet";
pub const JOB: &str = "job";
Expand Down
Loading