Repository navigation
Commit cdb27e8
chore(dev): kill Ruby and port release scripts to native vdev (#25379)
* chore(dev): replace Ruby release flow with internal vdev functions
Ports the two remaining Ruby release scripts to native Rust and folds
the resulting `vdev release` surface down to the bits that are actually
called.
- `scripts/generate-release-cue.rb` (467 lines) is replaced by a
`pub(super) fn run` in `vdev/src/commands/release/generate_cue.rs`.
The function walks `git log v<last>...HEAD` (three-dot symmetric
difference, so `--cherry-pick --right-only` filters out commits
already released on a patch branch — the Ruby form), parses the
conventional-commit messages, processes `changelog.d/*.md` fragments
into the release CUE schema, and runs `cue fmt`. It is called only
from `vdev release prepare` (no standalone CLI subcommand).
- `scripts/release-commit.rb`, `vdev release commit`, `vdev release push`,
`vdev build release-cue`, and the corresponding Makefile targets
(`make release`, `release-commit`, `release-push`) are removed: none
of them were called by CI workflows, scripts, or issue templates, and
the original `release-commit.rb` had been broken for some time
(pointing at `docs/reference/releases`, a directory that no longer
exists). Manual operator tagging happens via `git tag` directly per
the release issue templates.
- The `scripts/util/*.rb` library, `Gemfile`, `Gemfile.lock`, and the
`Gemfile` COPY in `scripts/environment/Dockerfile` are deleted.
`ruby` itself stays in the bootstrap scripts and `vdev/README.md` —
`scripts/check-events` is the last remaining Ruby script and gets
ported in a follow-up commit.
- Docs, issue templates, the `changes.yml` workflow filter, and
`website/README.md` are repointed at `cargo vdev release prepare`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(dev): port scripts/check-events to vdev via syn AST
Replaces the last Ruby script in the repo (515 lines) with a native
`vdev check events` that walks Rust source via `syn`'s AST instead of
regex-scraping. The validation rules from `docs/specs/instrumentation.md`
are preserved unchanged; behaviour against the current tree matches
the Ruby script (`0 error(s)` on master, identical reports on a
synthetic fixture exercising every rule branch).
Implementation notes:
- Structural scanning (struct fields, impl-block trait/event names)
uses syn visitors. Macro argument parsing (`counter!(...)`,
`trace!(...)`, etc.) uses small targeted regexes on the macro's
already-tokenised input. Use-counting (`emit!(EventName)` /
`register!(...)`) uses one regex pass over the raw source because
syn does not descend into the bodies of opaque macros like
`tokio::select!` where some emit sites live.
- `## skip check-validity-events ##` is added to
`lib/vector-common/src/internal_event/component_events_dropped.rs`.
That impl block is the foundation type the `registered_event!` macro
abstracts over, so it has to implement `RegisterInternalEvent` by
hand. The Ruby script's regex never matched its multi-line `impl`
header and so silently let it through; the AST scanner sees it
correctly and the existing skip-marker mechanism makes the intent
explicit.
- `proc-macro2`, `quote`, and `syn` are declared as workspace deps with
default-features off; vdev opts into the syn `full`, `visit`,
`extra-traits`, `printing`, `parsing` features and proc-macro2's
`span-locations` locally. These features are already pulled in
transitively by Vector's existing dep graph (verified via
`cargo tree -p vector`), so the additions do not change Vector's
production binary.
- 32 unit tests are added: 14 covering the macro/log/metric arg
parsers (literal-first, named-field, variable, trailing-literal,
`%`-capture, message format checks, comma-arg nesting,
`CamelCase → snake_case`) and 18 driving every branch of
`validate_event` with synthetic `Event` structs.
- Differential test (run by hand against a worktree with a synthetic
fixture file): `ruby scripts/check-events` and `cargo vdev check
events` flagged the same eight events plus the same duplicate pair;
outputs differed only in sort order and a Ruby string-escape
artefact.
The bootstrap scripts (`scripts/environment/bootstrap-{macos,
ubuntu-24.04}.sh`), `vdev/README.md`, and `.ruby-version` lose their
Ruby references — there is no Ruby left in the repo to install.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(dev): make check-events robust to CWD and trailing-literal messages
Two bugs caught in code review of `vdev/src/commands/check/events.rs`:
1. The native check globbed `src/**/*.rs` and `lib/**/*.rs` relative to
the caller's CWD. The Ruby script wrapper used to chdir to the repo
root, so this silently regressed: running `vdev check events` from
anywhere outside the repo root produced `0 error(s)` without
scanning anything.
Fix: chdir to `paths::find_repo_root()` at the top of `Cli::exec`,
matching the previous wrapper's behaviour. Running from a subdir
now scans correctly; running from outside the repo errors out with
a useful message.
2. `parse_log_args` claimed the first bare positional expression as
the log message before scanning the rest of the args for a string
literal. For real Vector code that uses
`warn!(%error, "Failed to flush.")`, the literal is the actual
message but the function never reached it — so the message-format
check (capital + trailing period) silently never fired on those
sites.
Fix: walk all args once, classify each as a literal candidate,
`message =` named-field candidate, bare-positional candidate, or
plain parameter, then pick the message in that priority order.
Adds a regression test covering the bare-then-literal pattern.
Both bugs were flagged by Codex code review on PR #25379.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(dev): cover nested log calls and dedup against released metadata
Three review findings on the check-events / release-cue ports:
- `vdev check events` only ran its log-message format check via the
syn AST visitor, which does not descend into the bodies of opaque
outer macros like `tokio::select!` / `cfg_if!`. Log calls nested
inside those macros were silently exempt. Replaces the AST format
check with a raw-text pass that finds every `(trace|debug|info|
warn|error)!(...)` invocation regardless of nesting. Adds two unit
tests against the new pass — including one that asserts a violation
inside a synthetic `tokio::select!` block is still reported.
- `generate_cue::run` no longer relies on `--cherry-pick --right-only`
alone to dedupe commits against earlier releases — that flag only
filters patch-id-equivalent commits, so a conflict-resolved cherry-
pick (different SHA, same PR) could re-appear in the next release
CUE. Adds a `collect_released_identifiers` pass that pulls the SHA
and PR-number sets out of every existing
`website/cue/reference/releases/*.cue`, then filters the fetched
commit set against both. Two unit tests cover the extractor.
- `Commit::validate` now bails when the conventional-commit parser
could not classify the subject (`type: None`). Previously such
commits passed validation and landed in the published release CUE
with a null type — a malformed PR title would silently ship.
Also factors `parse_log_args` so it shares one `&str` implementation
with the new raw-text pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(dev): apply rustfmt over previous fix
Pre-push hook reformatting on the format-check + dedup fixes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(dev): replace map().unwrap_or(false) in check-events test helper
`cargo clippy -p vdev --all-targets` flagged two map_unwrap_or lints
in the test-only `check()` helper. Identical pattern to fixes already
applied in production code; just missed when test cases were added
later.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(dev): clean up vdev check-events module
Drop the pedantic clippy allows the file was carrying and refactor to
satisfy them: rename Event fields whose `_event` suffix tripped
struct_field_names, group the three skip flags into a SkipFlags
substruct (struct_excessive_bools), and split validate_event and
Cli::exec into smaller helpers (too_many_lines).
Also remove a redundant `name_ends_with` wrapper that just called
str::ends_with, and merge the parse_log_args TokenStream wrapper into
its `&str` body. One callsite was already operating on stringified
tokens, so it was doing a wasted parse-and-restringify round trip.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(deps): use convert_case for snake-casing in vdev check-events
Replace the bespoke `camel_to_snake` regex helper in vdev's check-events
with `convert_case::Casing::to_case`. Promote convert_case to a
workspace dep so vdev and vector-config-common share the same version
declaration.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: drop outdated comment on workspace proc-macro2/quote/syn deps
The comment claimed declaring these at the workspace level prevented
vdev's extra `syn` features from unifying into Vector's production
build. That's not what workspace declarations do — `cargo` unifies
features across the resolved dep graph regardless. The reason vdev's
features don't reach the `vector` package is simply that vdev isn't a
dep of `vector`. The comment was also stale: these crates are now
direct deps of vector-config-macros, vector-config-common, and
vector-common-macros, not just vdev.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(dev): accept uppercase release scopes in conventional-commit parser
The release-CUE generator rejected commit subjects with uppercase scope
characters (e.g. `fix(ARC): ...`), even though `.github/workflows/semantic.yml`
explicitly lists `ARC` as a valid scope. A PR title that passed semantic
validation could therefore block `release prepare` later. Widen the
scope character class to allow uppercase letters and add a regression
test.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(dev): track angle brackets in macro-arg splitter
split_comma_args only tracked `()[]{}` nesting, so a registered_event!
handle field with a generic type containing a comma would be split
mid-type. The existing src/internal_events/filter.rs field
`Registered<ComponentEventsDropped<'static, INTENTIONAL>> = register!(...)`
broke before the assignment, hiding the register! emission and causing
spurious missing-log/counter errors for FilterEventsDropped.
Track angle depth as a separate counter and only decrement `>` when
there is a matching `<`, so the `>` in `key => value` tag pairs (used
inside counter! args) stays unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bbde98b commit cdb27e8
36 files changed
Lines changed: 2616 additions & 1806 deletions
File tree
- .github
- ISSUE_TEMPLATE
- workflows
- docs
- lib
- vector-common/src/internal_event
- vector-config-common
- scripts
- environment
- util
- vdev
- src
- commands
- build
- check
- release
- utils
- website
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | 231 | | |
233 | 232 | | |
234 | 233 | | |
| |||
This file was deleted.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | 598 | | |
606 | 599 | | |
607 | 600 | | |
| |||
618 | 611 | | |
619 | 612 | | |
620 | 613 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | 614 | | |
626 | 615 | | |
627 | 616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments