Skip to content

BUILD-11298 Add CI metrics job-completed hook for self-hosted runners#270

Merged
matemoln merged 2 commits into
masterfrom
BUILD-11298-ci-metrics-hook
May 26, 2026
Merged

BUILD-11298 Add CI metrics job-completed hook for self-hosted runners#270
matemoln merged 2 commits into
masterfrom
BUILD-11298-ci-metrics-hook

Conversation

@matemoln
Copy link
Copy Markdown
Contributor

@matemoln matemoln commented May 22, 2026

Summary

This is not a GitHub Action — the script is used by the self-hosted runners to publish metrics at the end of the job. For implementation details see https://xtranet-sonarsource.atlassian.net/wiki/x/BIDiNgE

Out of scope

  • Removing the duplicate copy in github-runners-infra. Tracked at BUILD-11446

Test plan

@matemoln matemoln requested a review from a team as a code owner May 22, 2026 11:04
Copilot AI review requested due to automatic review settings May 22, 2026 11:04
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 22, 2026

Agentic Analysis: Early Results

Agentic Analysis and Context Augmentation are available on your project. Here are some issues that could have been prevented. Follow the links to learn how to put them into action.

15 issue(s) found across 1 file(s):

Rule File Line Message
shelldre:S7682 ci-metrics/job-completed.sh 31 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 73 Add an explicit return statement at the end of the function.
shelldre:S7679 ci-metrics/job-completed.sh 73 Assign this positional parameter to a local variable.
shelldre:S7679 ci-metrics/job-completed.sh 73 Assign this positional parameter to a local variable.
shelldre:S7682 ci-metrics/job-completed.sh 76 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 83 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 89 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 99 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 111 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 113 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 118 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 120 Add an explicit return statement at the end of the function.
shelldre:S7682 ci-metrics/job-completed.sh 192 Add an explicit return statement at the end of the function.
shelldre:S7679 ci-metrics/job-completed.sh 193 Assign this positional parameter to a local variable.
shelldre:S7679 ci-metrics/job-completed.sh 193 Assign this positional parameter to a local variable.

Analyzed by SonarQube Agentic Analysis in 2.8 s

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented May 22, 2026

BUILD-11298

@matemoln matemoln marked this pull request as draft May 22, 2026 11:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a runner-side “job completed” metrics hook script under ci-metrics/ intended to be downloaded and executed by WarpBuild runner images, and documents how consumers should enable and fetch it.

Changes:

  • Added ci-metrics/job-completed.sh to collect cgroup v2 + network totals, write job-metrics.json, and append a step-summary table (fail-open).
  • Documented the hook’s purpose, feature flag, and the pinned raw URL in README.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
README.md Documents the new ci-metrics/ hook, usage, feature flag, and consumer raw URL.
ci-metrics/job-completed.sh Introduces the job-completed hook script that collects and emits CI metrics + optional cache aggregation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ci-metrics/job-completed.sh
Comment thread ci-metrics/job-completed.sh
Comment thread ci-metrics/job-completed.sh
Comment thread ci-metrics/job-completed.sh
@matemoln matemoln force-pushed the BUILD-11298-ci-metrics-hook branch 2 times, most recently from 4dc4626 to 150d32c Compare May 26, 2026 11:55
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 26, 2026

Reviewing your code

Code Review ✅ Approved

Introduces the job-completed.sh hook for WarpBuild CI metrics to capture cgroup and network telemetry. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@matemoln matemoln force-pushed the BUILD-11298-ci-metrics-hook branch 2 times, most recently from b45a70d to 636e76d Compare May 26, 2026 13:19
Comment thread ci-metrics/job-completed.sh
Comment thread ci-metrics/README.md Outdated
@matemoln matemoln force-pushed the BUILD-11298-ci-metrics-hook branch from 636e76d to ce0b0c2 Compare May 26, 2026 13:31
Comment thread ci-metrics/job-completed.sh
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread ci-metrics/job-completed.sh
Comment thread ci-metrics/job-completed.sh
Comment thread ci-metrics/README.md
Comment thread ci-metrics/job-completed.sh
Comment thread ci-metrics/job-completed.sh
@matemoln matemoln marked this pull request as ready for review May 26, 2026 16:48
matemoln added 2 commits May 26, 2026 18:50
The round3 utility function is kept for consistency with round2 but is
not currently invoked, triggering SC2329 in pre-commit. Adding the
disable directive alongside the existing SC2317 suppression.
@matemoln matemoln force-pushed the BUILD-11298-ci-metrics-hook branch from d8087c2 to 11f8f16 Compare May 26, 2026 16:50
@matemoln matemoln deployed to sca-checking May 26, 2026 16:50 — with GitHub Actions Active
@matemoln matemoln changed the title BUILD-11298 Add CI metrics job-completed hook for WarpBuild runners BUILD-11298 Add CI metrics job-completed hook for self-hosted runners May 26, 2026
@sonarqubecloud
Copy link
Copy Markdown

@matemoln matemoln merged commit b329d39 into master May 26, 2026
13 checks passed
@matemoln matemoln deleted the BUILD-11298-ci-metrics-hook branch May 26, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants