Skip to content

[ci] Disable monitoring for jobs of PRs of fork branches #3781

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

Merged
merged 1 commit into from
Mar 10, 2025
Merged
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
10 changes: 7 additions & 3 deletions .github/actions/run-monitored-tmpnet-cmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ runs:
GRAFANA_URL: https://grafana-poc.avax-dev.network/d/kBQpRdWnk/avalanche-main-dashboard?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.repository_owner }}%2F${{ inputs.repository_name }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
FILTER_BY_OWNER: ${{ inputs.filter_by_owner }}
- name: Warn that collection of metrics and logs will not be performed
if: (inputs.prometheus_username == '')
shell: bash
run: echo "::warning::Monitoring credentials not found. Skipping collector start. Is the PR from a fork branch?"
- name: Run command
shell: bash
# --impure ensures the env vars are accessible to the command
run: ${{ inputs.run_env }} nix develop --impure --command bash -x ${{ inputs.run }}
env:
TMPNET_START_COLLECTORS: true
TMPNET_START_COLLECTORS: ${{ inputs.prometheus_username != '' }}
LOKI_USERNAME: ${{ inputs.loki_username }}
LOKI_PASSWORD: ${{ inputs.loki_password }}
PROMETHEUS_USERNAME: ${{ inputs.prometheus_username }}
Expand All @@ -91,7 +95,7 @@ runs:
if-no-files-found: error
# TODO(marun) Maybe optionally run these checks in an AfterSuite step?
- name: Check that logs were collected
if: always()
if: (inputs.prometheus_username != '')
shell: bash
run: go run github.com/ava-labs/avalanchego/tests/fixture/tmpnet/cmd check-logs
env:
Expand All @@ -104,7 +108,7 @@ runs:
GH_RUN_ATTEMPT: ${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
- name: Check that metrics were collected
if: always()
if: (inputs.prometheus_username != '')
shell: bash
run: go run github.com/ava-labs/avalanchego/tests/fixture/tmpnet/cmd check-metrics
env:
Expand Down
Loading