Skip to content

ci: warn when plugin metric field names are removed or renamed#18957

Open
yaseen-vm wants to merge 5 commits into
influxdata:masterfrom
yaseen-vm:feat/ci-metric-name-change-warning
Open

ci: warn when plugin metric field names are removed or renamed#18957
yaseen-vm wants to merge 5 commits into
influxdata:masterfrom
yaseen-vm:feat/ci-metric-name-change-warning

Conversation

@yaseen-vm
Copy link
Copy Markdown

Summary

Closes #18955

  • Adds scripts/check-metric-names.sh — extracts backtick-quoted field names from plugin README metric tables and warns when any name present on master disappears in the PR
  • Adds .github/workflows/metric-names.yml — runs the script on every PR targeting master, only when plugin READMEs are modified
  • Always exits 0 (informational warning, not a hard block), consistent with the issue's request for a CI warning

How it works

Each plugin README documents its metrics in markdown tables like:

| `field_name` | include_option | type | description |

The script compares the set of backtick-quoted names in the first column between origin/master and HEAD. If any name is gone, a ::warning annotation is emitted pointing contributors to:

  1. Add a deprecation notice alongside the old name
  2. Keep the old name via a legacy_* include option
  3. Document the migration path in the PR description

Test

Verified locally by temporarily renaming n_cpusn_cpus_RENAMED in plugins/inputs/system/README.md (replicating the exact change from #18919 that triggered this issue). The check correctly identified n_cpus as removed and emitted the warning with guidance.

Test plan

  • Script runs cleanly on a branch with no README changes (No plugin READMEs changed)
  • Script fires ::warning when a field name is removed from a metric table
  • Script passes silently when only new fields are added (no false positives)
  • Workflow only triggers when plugins/**/README.md files are modified

🤖 Generated with Claude Code

yaseen-vm added 3 commits May 21, 2026 15:57
Adds scripts/check-metric-names.sh and a GitHub Actions workflow that
runs on every PR targeting master. When a plugin README's metric table
loses a field name that was present on master, the check emits a
::warning annotation and explains the backward-compatibility impact,
helping contributors acknowledge breaking changes before they merge.

Closes influxdata#18955
@telegraf-tiger
Copy link
Copy Markdown
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger Bot added the ci CI pipeline fixes, optimizations, and infrastructure label May 21, 2026
@yaseen-vm
Copy link
Copy Markdown
Author

!signed-cla

@telegraf-tiger
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI pipeline fixes, optimizations, and infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request - CI warning when changing existing metrics names

1 participant