Skip to content
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
62 changes: 49 additions & 13 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ The fork is deliberately small. Out of the box upstream, plus:
`--web.socket-permissions`), hooked into upstream's exporter-toolkit
`bootstrap` startup through the metrics handler factory.
2. CloudLinux packaging recipes (`node_exporter.spec`, `debian/`).
3. A versioned tests subpackage at `/opt/node_exporter_tests/` used by the
CloudLinux QA pipeline.
3. A versioned tests subpackage at `/opt/node_exporter_tests/`, run by QA's
`rpm_tests/p_cl-node-exporter` in the Build System RPM tests.
4. A `/usr/share/cloudlinux/cl-node-exporter` version file, read by Sentry
for package-version tagging.
5. A Makefile change that runs `test-e2e` twice (TCP + unix-socket) so the
fork-local feature is exercised on every build.
fork-local feature is exercised by `make` in GitHub Actions and locally
(the RPM/deb builds run `make test`, not `test-e2e`).

Everything else in this repo — collectors, metric semantics, command-line
flags, build targets — is upstream and should be understood by reading
Expand Down Expand Up @@ -56,12 +57,45 @@ update the spec in the same commit.
socket support), prefer deleting the fork-local copy and documenting
the change.

`AGENTS.md` is upstream's agent guide (collector rules, build/test commands,
fixtures, toolchain); it applies to this fork as well.

## Repository and CI

The code lives on GitHub: https://github.com/cloudlinux/node_exporter (default
branch `master`, no branch protection; PRs are reviewed there and merged with a
merge commit). Commit titles start with the Jira key: `CLOS-1234: <what changed>`.

- **GitHub Actions** (workflows inherited from upstream, on PRs and pushes to
`master`): `CI` (Go tests, ARM `make test-e2e`, node-mixin, promu crossbuild,
docker image), `golangci-lint`, `bsd` (e2e on the BSDs, Solaris and Darwin),
`GitHub Actions Security` (zizmor), `govulncheck` (also daily on schedule).
- **Build System (CLBS)** builds the RPM/deb from a PR (`git_change` ref shown as
`node_exporter#<PR>`), a branch or a tag. Its RPM tests stage installs
`cl-node-exporter-tests` and runs QA's `rpm_tests/p_cl-node-exporter`
(e2e over TCP and the unix socket on CL7-CL10; Ubuntu runs only the common
integrity checks).
- **GitLab CI test pipelines** started by CLBS: `cmt-end-server`
(https://gitlab.corp.cloudlinux.com/clos/monitoring/centralized-management,
`ci/cmt-end-server.yml`: the QA `cl-end-server-tools` suite, whose edition
ships `cl-node-exporter`) and `cl-node-exporter-check`
(`pipelines/node-exporter-upstream-checker.yml` in clos/ci-tools/gitlab-ci:
alerts Slack and fails when upstream `VERSION` differs from this fork's).
Both run for the daily CLPRO nightly build (`clpro-nightly` schedule of
clos/ci-tools/gitlab-ci, `node_exporter@master`); `cmt-end-server` is the job
to attach to a verification build. There are no Jenkins jobs.
- **Releases:** the PR carrying the change bumps the version and changelog in
`node_exporter.spec` and `debian/changelog`; after the merge, tag `master` as
`cl-node-exporter-<version>-<release>` (e.g. `cl-node-exporter-1.2.2-1`),
build the tag in CLBS with `cmt-end-server` and release it through the CLR
process.

## AI Workspace Required

Both the local-test and Build System workflows below assume you are inside an [AI Workspace](https://gitlab.corp.cloudlinux.com/primeos/cl-aiworkspaces) VM at `/root/ai-workspace/`. They depend on:

- the workspace's CloudLinux OS toolchain and any project-specific runtime (Python venv, Node, Docker, …) — needed by the local-build and unit-test targets;
- the workspace's `mcp-cli-wrapper.sh` and provisioned Build System / Jenkins tokens — needed by the BS payload helper.
- the workspace's `mcp-cli-wrapper.sh` and provisioned Build System token — needed by the BS payload helper.

Outside an AI Workspace these commands will not work as documented. Spin up a workspace via `cl-aiworkspaces` first.

Expand All @@ -76,7 +110,7 @@ Run from the repo root (`/root/ai-workspace/node_exporter/`):
| `make test-e2e` | Run the e2e harness (downloads collector fixtures on first run) |
| `make checkmetrics && make checkrules` | Validate metric and rule schemas |

**Integration/e2e tests** live in this repo: the harness `end-to-end-test.sh` (run via `make test-e2e`, exercised twice per build over TCP and the unix socket) plus the `collector/` fixtures. They are shipped as the versioned tests subpackage to `/opt/node_exporter_tests/` and consumed by the CloudLinux QA pipeline.
**Integration/e2e tests** live in this repo: the harness `end-to-end-test.sh` (run via `make test-e2e`, twice: over TCP and over the unix socket) plus the `collector/` fixtures. They are shipped as the versioned tests subpackage to `/opt/node_exporter_tests/` and run by QA's `rpm_tests/p_cl-node-exporter` in the Build System RPM tests.

## Build System

Expand All @@ -90,17 +124,19 @@ The `/build-create` skill fills most fields automatically; the table records wha
| --- | --- |
| BS project name | `node_exporter` |
| `build_type_id` | `5ac2787bdf7e526d4a5f0259` (CloudLinux OS packages) |
| `build_platforms` | `CL7`, `CL8`, `CL9`, `CL10`, `ubuntu22_04_ext_cpanel` |
| `build_platforms` | `CL7`, `CL8`, `CL9`, `CL10`, `ubuntu22_04_ext` |
| `build_flavors` | `alt-php-els` (id `68b1ad89aa0264b2618434c8`) |
| `target_channel` | `beta` |
| `build_ref.name` | **Branch (or tag) to build.** Taken from the current `git` checkout in the workspace — confirm you are on the intended branch (your feature branch, not `master`) before creating the build. |
| `build_ref.type` | `git_branch` or `git_tag`. |
| `testing.qa_ref` (per project) and top-level `qa_ref` | **Branch checked out in the QA repo for Jenkins jobs.** Defaults both to `"master"` regardless of `build_ref.name` — override to your feature branch if the QA side has matching changes. |
| `build_ref.type` | `git_branch`, `git_tag`, or `git_change` for a GitHub PR. |
| `testing.qa_ref` (per project) and top-level `qa_ref` | **Branch checked out in the QA repo** for the RPM tests stage and the QA-based GitLab CI pipelines. Defaults both to `"master"` regardless of `build_ref.name` — override to your feature branch if the QA side has matching changes. |

### Jenkins jobs (node_exporter-relevant)
### Test jobs

The `/build-create` skill generates the workspace-wide plan covering every project in the workspace. For a `node_exporter`-only build, filter `projects[]` down to `node_exporter` and keep **only** these jobs in `jenkins_jobs[]`:
The `/build-create` skill generates the workspace-wide plan covering every project in the workspace. For a `node_exporter`-only build, filter `projects[]` down to `node_exporter`. Keep `jenkins_jobs[]` empty: the Build System's project default still lists the Jenkins `Web-monitoring-tool` job, which does not test this package. `build-plan.py` does not fill `gitlab_ci_jobs[]`; add this entry by hand:

| Job name | Build System `_id` |
| --- | --- |
| `CMT-end-server-tools` | `635b962c2afd3e1feec603bd` |
| Build System name | `_id` | What it runs |
| --- | --- | --- |
| `cmt-end-server` | `6a3c5588c9769a88083c81ff` | centralized-management `ci/cmt-end-server.yml` (`TRIGGER_KIND=cmt-end-server`), QA `cl-end-server-tools` suite |

The RPM tests (`rpm_tests/p_cl-node-exporter`) need no job entry: the Build System runs them after the build unless testing is skipped.
Loading