Netdata Vendoring Preflight
Purpose
Netdata consumes NetIPC from this repository as vendored source. Before touching
a Netdata checkout, prove that the source plugin-ipc commit is safe enough to
copy downstream.
Mandatory Rule
Do this preflight before any Netdata vendoring work, even if the user only asks
to copy, sync, vendor, merge, push, or continue.
Do not modify the Netdata vendored copy until:
- the candidate
plugin-ipc commit is identified;
- source CI and GitHub code/security scanner status are checked;
- the last vendored baseline is identified or explicitly reconstructed;
- two-way drift is understood:
- what changed in
plugin-ipc since the last vendoring;
- what changed in Netdata's vendored NetIPC copy since the last vendoring;
- a migration plan exists for every drift class;
- failures and open alerts are fixed, documented as evidence-backed false
positives, or explicitly risk-accepted by the user in the active SOW.
Scope Trigger
Load this skill for any task involving:
~/src/netdata-ktsaou.git or another Netdata checkout receiving NetIPC files;
vendor-to-netdata.sh;
diff-netdata-vendor.sh;
- Netdata paths such as:
src/libnetdata/netipc/
src/crates/netipc/
src/go/pkg/netipc/
- statements like "vendor", "vendored", "copy to Netdata", "sync to Netdata",
"merge to Netdata", or "update Netdata's NetIPC copy".
Preflight Steps
Resolve the source commit.
git rev-parse HEAD
git status --short --branch
git remote -v
The source commit must be pushed or otherwise available to GitHub checks.
If local uncommitted source changes are intended for vendoring, stop and
make the source repository state explicit before touching Netdata.
Check GitHub Actions and commit checks for the source commit.
gh run list --repo netdata/plugin-ipc --commit "$COMMIT" \
--limit 50 \
--json databaseId,name,status,conclusion,createdAt,updatedAt,url,headBranch,headSha
gh api "repos/netdata/plugin-ipc/commits/$COMMIT/check-runs" \
--jq '.check_runs[] | {name, status, conclusion, html_url}'
gh api "repos/netdata/plugin-ipc/commits/$COMMIT/status" \
--jq '{state, total_count, statuses}'
Required result: no failing, cancelled, timed-out, or pending required checks
unless the active SOW records why the result does not apply.
Check GitHub code/security scanners.
gh api 'repos/netdata/plugin-ipc/code-scanning/alerts?state=open&per_page=100' \
--jq '[.[] | {number, tool: .tool.name, rule: .rule.id, severity: .rule.severity, path: .most_recent_instance.location.path, line: .most_recent_instance.location.start_line, message: .most_recent_instance.message.text, url: .html_url}]'
gh api 'repos/netdata/plugin-ipc/dependabot/alerts?state=open&per_page=100' \
--jq '[.[] | {number, package: .dependency.package.name, ecosystem: .dependency.package.ecosystem, severity: .security_advisory.severity, manifest: .dependency.manifest_path, url: .html_url}]'
gh api 'repos/netdata/plugin-ipc/secret-scanning/alerts?state=open&per_page=100' \
--jq '[.[] | {number, secret_type, state, resolution, url: .html_url}]'
Required result: no untriaged open code-scanning, dependency, or secret
alerts for the candidate source branch/commit. If alerts exist, record exact
files/rules and stop unless they are fixed, evidence-backed false positives,
or explicitly accepted by the user.
Establish the last vendored baseline.
Find the last Netdata commit or PR that updated the vendored NetIPC trees:
git -C "$NETDATA_ROOT" log --oneline --decorate -- \
src/libnetdata/netipc \
src/crates/netipc \
src/go/pkg/netipc
Then identify the matching plugin-ipc source commit from one of:
- Netdata commit message or PR description;
- prior SOW evidence;
- previous vendor-sync commit in
plugin-ipc;
- a reconstructed normalized match using
diff-netdata-vendor.sh against
candidate source commits.
If the matching source commit cannot be identified with enough confidence,
stop before vendoring. Record the uncertainty and propose a baseline
reconstruction plan.
Perform two-way gap analysis.
Direction 1: source changes since the last vendoring:
git diff --stat "$BASE_PLUGIN_IPC_COMMIT"..HEAD -- \
src/libnetdata/netipc \
src/crates/netipc/src \
src/go/pkg/netipc
git diff "$BASE_PLUGIN_IPC_COMMIT"..HEAD -- \
src/libnetdata/netipc \
src/crates/netipc/src \
src/go/pkg/netipc
Direction 2: Netdata vendored-copy changes since the last vendoring:
git -C "$NETDATA_ROOT" diff --stat "$BASE_NETDATA_VENDOR_COMMIT"..HEAD -- \
src/libnetdata/netipc \
src/crates/netipc \
src/go/pkg/netipc
git -C "$NETDATA_ROOT" diff "$BASE_NETDATA_VENDOR_COMMIT"..HEAD -- \
src/libnetdata/netipc \
src/crates/netipc \
src/go/pkg/netipc
Classify every change as one of:
- upstream source change to vendor into Netdata;
- Netdata-only wrapper/build/package/import-path difference to preserve;
- Netdata vendored-source fix that must first be backported to
plugin-ipc;
- real conflict requiring a migration decision before copying;
- obsolete downstream drift that can be replaced by upstream source.
Write the migration plan in the active SOW before vendoring.
The plan must say:
- exact baseline source commit and Netdata vendor commit;
- files changed upstream since baseline;
- files changed downstream since baseline;
- for each file/class, whether upstream wins, Netdata-local changes are
preserved, downstream fixes are backported first, or user decision is
needed;
- expected post-vendor diff after normal exclusions and Go import-path
normalization.
If any downstream vendored-source change is not understood, do not run
vendor-to-netdata.sh.
Record the CI/scanner preflight in the active SOW before vendoring.
Include:
- source repository and commit;
- GitHub Actions/check-run summary;
- code-scanning summary by tool and severity;
- Dependabot and secret-scanning summary;
- decision: proceed, block, or proceed with explicit risk acceptance.
Only after the CI/scanner preflight and two-way migration plan pass, update
the Netdata vendored copy using the project-local vendor workflow.
bash ./diff-netdata-vendor.sh /path/to/netdata
bash ./vendor-to-netdata.sh /path/to/netdata
bash ./diff-netdata-vendor.sh /path/to/netdata
Validate in the Netdata checkout.
Run the targeted Netdata build/tests required by the active SOW. At minimum,
prove:
- the vendor diff is expected after copying;
- Netdata-only wrapper files were not overwritten;
- unrelated Netdata files were not staged or modified by the vendoring step.
Blockers
Stop and report if any of these are true:
- source commit has no GitHub CI/check-run evidence;
- source CI is failing, pending, cancelled, or timed out;
- GitHub code scanning has untriaged open alerts;
- Dependabot has untriaged open alerts;
- secret scanning has open alerts;
- the last source-to-Netdata vendoring baseline cannot be identified or
reconstructed with evidence;
- either side has NetIPC changes since the last vendoring that are not
understood;
- the active SOW does not contain a migration plan for both directions;
- source tree has uncommitted changes that are intended for vendoring;
- Netdata checkout has unrelated changes that would be hard to isolate.
Reporting Shape
Use this concise report before vendoring:
Netdata vendoring preflight:
- Source commit: <sha>
- Baseline: plugin-ipc <sha>, Netdata <sha>
- CI/checks: <pass/fail/pending summary>
- Code scanning: <count by tool/severity, exact blockers>
- Dependabot: <open count>
- Secret scanning: <open count>
- Upstream gap: <summary of plugin-ipc changes since baseline>
- Downstream gap: <summary of Netdata vendored changes since baseline>
- Migration plan: <preserve/backport/overwrite/decision summary>
- Decision: proceed | blocked | proceed with user-accepted risk
1---2name: project-netdata-vendoring3description: Mandatory workflow for copying, syncing, vendoring, or merging plugin-ipc NetIPC source changes into a Netdata checkout. Use whenever work mentions Netdata vendoring, vendor drift, vendor-to-netdata, diff-netdata-vendor.sh, vendor-to-netdata.sh, or updating src/libnetdata/netipc, src/crates/netipc, or src/go/pkg/netipc in Netdata.4---56# Netdata Vendoring Preflight78## Purpose910Netdata consumes NetIPC from this repository as vendored source. Before touching11a Netdata checkout, prove that the source `plugin-ipc` commit is safe enough to12copy downstream.1314## Mandatory Rule1516Do this preflight before any Netdata vendoring work, even if the user only asks17to copy, sync, vendor, merge, push, or continue.1819Do not modify the Netdata vendored copy until:2021- the candidate `plugin-ipc` commit is identified;22- source CI and GitHub code/security scanner status are checked;23- the last vendored baseline is identified or explicitly reconstructed;24- two-way drift is understood:25 - what changed in `plugin-ipc` since the last vendoring;26 - what changed in Netdata's vendored NetIPC copy since the last vendoring;27- a migration plan exists for every drift class;28- failures and open alerts are fixed, documented as evidence-backed false29 positives, or explicitly risk-accepted by the user in the active SOW.3031## Scope Trigger3233Load this skill for any task involving:3435- `~/src/netdata-ktsaou.git` or another Netdata checkout receiving NetIPC files;36- `vendor-to-netdata.sh`;37- `diff-netdata-vendor.sh`;38- Netdata paths such as:39 - `src/libnetdata/netipc/`40 - `src/crates/netipc/`41 - `src/go/pkg/netipc/`42- statements like "vendor", "vendored", "copy to Netdata", "sync to Netdata",43 "merge to Netdata", or "update Netdata's NetIPC copy".4445## Preflight Steps46471. Resolve the source commit.4849 ```bash50 git rev-parse HEAD51 git status --short --branch52 git remote -v53 ```5455 The source commit must be pushed or otherwise available to GitHub checks.56 If local uncommitted source changes are intended for vendoring, stop and57 make the source repository state explicit before touching Netdata.58592. Check GitHub Actions and commit checks for the source commit.6061 ```bash62 gh run list --repo netdata/plugin-ipc --commit "$COMMIT" \63 --limit 50 \64 --json databaseId,name,status,conclusion,createdAt,updatedAt,url,headBranch,headSha6566 gh api "repos/netdata/plugin-ipc/commits/$COMMIT/check-runs" \67 --jq '.check_runs[] | {name, status, conclusion, html_url}'6869 gh api "repos/netdata/plugin-ipc/commits/$COMMIT/status" \70 --jq '{state, total_count, statuses}'71 ```7273 Required result: no failing, cancelled, timed-out, or pending required checks74 unless the active SOW records why the result does not apply.75763. Check GitHub code/security scanners.7778 ```bash79 gh api 'repos/netdata/plugin-ipc/code-scanning/alerts?state=open&per_page=100' \80 --jq '[.[] | {number, tool: .tool.name, rule: .rule.id, severity: .rule.severity, path: .most_recent_instance.location.path, line: .most_recent_instance.location.start_line, message: .most_recent_instance.message.text, url: .html_url}]'8182 gh api 'repos/netdata/plugin-ipc/dependabot/alerts?state=open&per_page=100' \83 --jq '[.[] | {number, package: .dependency.package.name, ecosystem: .dependency.package.ecosystem, severity: .security_advisory.severity, manifest: .dependency.manifest_path, url: .html_url}]'8485 gh api 'repos/netdata/plugin-ipc/secret-scanning/alerts?state=open&per_page=100' \86 --jq '[.[] | {number, secret_type, state, resolution, url: .html_url}]'87 ```8889 Required result: no untriaged open code-scanning, dependency, or secret90 alerts for the candidate source branch/commit. If alerts exist, record exact91 files/rules and stop unless they are fixed, evidence-backed false positives,92 or explicitly accepted by the user.93944. Establish the last vendored baseline.9596 Find the last Netdata commit or PR that updated the vendored NetIPC trees:9798 ```bash99 git -C "$NETDATA_ROOT" log --oneline --decorate -- \100 src/libnetdata/netipc \101 src/crates/netipc \102 src/go/pkg/netipc103 ```104105 Then identify the matching `plugin-ipc` source commit from one of:106107 - Netdata commit message or PR description;108 - prior SOW evidence;109 - previous vendor-sync commit in `plugin-ipc`;110 - a reconstructed normalized match using `diff-netdata-vendor.sh` against111 candidate source commits.112113 If the matching source commit cannot be identified with enough confidence,114 stop before vendoring. Record the uncertainty and propose a baseline115 reconstruction plan.1161175. Perform two-way gap analysis.118119 Direction 1: source changes since the last vendoring:120121 ```bash122 git diff --stat "$BASE_PLUGIN_IPC_COMMIT"..HEAD -- \123 src/libnetdata/netipc \124 src/crates/netipc/src \125 src/go/pkg/netipc126127 git diff "$BASE_PLUGIN_IPC_COMMIT"..HEAD -- \128 src/libnetdata/netipc \129 src/crates/netipc/src \130 src/go/pkg/netipc131 ```132133 Direction 2: Netdata vendored-copy changes since the last vendoring:134135 ```bash136 git -C "$NETDATA_ROOT" diff --stat "$BASE_NETDATA_VENDOR_COMMIT"..HEAD -- \137 src/libnetdata/netipc \138 src/crates/netipc \139 src/go/pkg/netipc140141 git -C "$NETDATA_ROOT" diff "$BASE_NETDATA_VENDOR_COMMIT"..HEAD -- \142 src/libnetdata/netipc \143 src/crates/netipc \144 src/go/pkg/netipc145 ```146147 Classify every change as one of:148149 - upstream source change to vendor into Netdata;150 - Netdata-only wrapper/build/package/import-path difference to preserve;151 - Netdata vendored-source fix that must first be backported to `plugin-ipc`;152 - real conflict requiring a migration decision before copying;153 - obsolete downstream drift that can be replaced by upstream source.1541556. Write the migration plan in the active SOW before vendoring.156157 The plan must say:158159 - exact baseline source commit and Netdata vendor commit;160 - files changed upstream since baseline;161 - files changed downstream since baseline;162 - for each file/class, whether upstream wins, Netdata-local changes are163 preserved, downstream fixes are backported first, or user decision is164 needed;165 - expected post-vendor diff after normal exclusions and Go import-path166 normalization.167168 If any downstream vendored-source change is not understood, do not run169 `vendor-to-netdata.sh`.1701717. Record the CI/scanner preflight in the active SOW before vendoring.172173 Include:174175 - source repository and commit;176 - GitHub Actions/check-run summary;177 - code-scanning summary by tool and severity;178 - Dependabot and secret-scanning summary;179 - decision: proceed, block, or proceed with explicit risk acceptance.1801818. Only after the CI/scanner preflight and two-way migration plan pass, update182 the Netdata vendored copy using the project-local vendor workflow.183184 ```bash185 bash ./diff-netdata-vendor.sh /path/to/netdata186 bash ./vendor-to-netdata.sh /path/to/netdata187 bash ./diff-netdata-vendor.sh /path/to/netdata188 ```1891909. Validate in the Netdata checkout.191192 Run the targeted Netdata build/tests required by the active SOW. At minimum,193 prove:194195 - the vendor diff is expected after copying;196 - Netdata-only wrapper files were not overwritten;197 - unrelated Netdata files were not staged or modified by the vendoring step.198199## Blockers200201Stop and report if any of these are true:202203- source commit has no GitHub CI/check-run evidence;204- source CI is failing, pending, cancelled, or timed out;205- GitHub code scanning has untriaged open alerts;206- Dependabot has untriaged open alerts;207- secret scanning has open alerts;208- the last source-to-Netdata vendoring baseline cannot be identified or209 reconstructed with evidence;210- either side has NetIPC changes since the last vendoring that are not211 understood;212- the active SOW does not contain a migration plan for both directions;213- source tree has uncommitted changes that are intended for vendoring;214- Netdata checkout has unrelated changes that would be hard to isolate.215216## Reporting Shape217218Use this concise report before vendoring:219220```text221Netdata vendoring preflight:222- Source commit: <sha>223- Baseline: plugin-ipc <sha>, Netdata <sha>224- CI/checks: <pass/fail/pending summary>225- Code scanning: <count by tool/severity, exact blockers>226- Dependabot: <open count>227- Secret scanning: <open count>228- Upstream gap: <summary of plugin-ipc changes since baseline>229- Downstream gap: <summary of Netdata vendored changes since baseline>230- Migration plan: <preserve/backport/overwrite/decision summary>231- Decision: proceed | blocked | proceed with user-accepted risk232```