chore(dev): kill Ruby and port release scripts to native vdev#25379
chore(dev): kill Ruby and port release scripts to native vdev#25379
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26839667cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
thomasqueirozb
left a comment
There was a problem hiding this comment.
Glad to see all of this deleted 👍
Codex review on PR #25379 caught two regressions in the previous commits: P1: scripts/environment/Dockerfile still COPYed scripts/Gemfile and scripts/Gemfile.lock — both deleted in this branch. The dev container build would fail at the COPY step. Drop those lines. P2: scripts/check-events is still a Ruby script and is wrapped by `vdev check events` (vdev/src/commands/check/mod.rs:35), so `make check-events` requires a Ruby interpreter. The previous cleanup of bootstrap-macos.sh and bootstrap-ubuntu-24.04.sh was too aggressive: it stripped Ruby itself, not just the bundler / Gemfile-related bits. Restore `ruby` (Homebrew on macOS, apt on Ubuntu) and re-list it in vdev/README.md as a prerequisite, scoped specifically to `vdev check events`. scripts/check-events only uses the Ruby standard library (`require 'find'`), so the Gemfile and bundler stay deleted. The remaining Ruby footprint is now exactly: one runtime dependency for one scripted check, queued for a follow-up port. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a04f070ee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- rustfmt cleanup over the previous commit (pre-push hook).
- generate_cue: change `git log v{last}..` to `v{last}...`. Codex review
on PR #25379 noted that `--cherry-pick --right-only` is a no-op with
the asymmetric two-dot range — the Ruby script the port replaces used
three dots (`v#{last_version}...`) so it could omit commits already
released on a patch branch. With two dots, fixes from a back-released
patch could re-appear in the next minor release CUE.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2401331aff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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>
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>
1f4b272 to
2f0b924
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f0b924cae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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>
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>
Pre-push hook reformatting on the format-check + dedup fixes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`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>
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>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c841c3a94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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>
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>
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>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bec41f4905
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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>
Summary
Removes Ruby from the Vector release flow and trims the dead release-tooling that the Ruby scripts had been propping up. The release CUE generator is preserved as a native Rust library function called from
vdev release prepare; the standalone CLI surface around it that nobody actually used is deleted.One Ruby script remains:
scripts/check-events(a 515-line static analyzer used byvdev check events). Porting it is scoped as a follow-up so this PR stays focused on the release-flow cleanup. Bundler and theGemfileare gone for good —check-eventsonly uses the Ruby standard library — but the Ruby interpreter itself stays in the bootstrap scripts untilcheck-eventsis ported.Motivation
release-commit.rbpointed atdocs/reference/releases, a directory that has not existed in this repo for some time. The script could not have run successfully against the current tree, but nobody noticed — a strong signal it had been dead long enough to delete.cargo vdevalready exists as Vector's Rust-native dev CLI. Maintaining a parallel Ruby toolchain alongside it is duplicate cost with no upside. This PR continues the migration started in Rewritescripts/generate-component-docs.rbin Rust #22350 / feat(dev): rewrite scripts/generate-component-docs.rb in Rust (#22350) #24781 (which portedgenerate-component-docs.rb).vdev releasesubcommands and Makefile targets were revealed as orphaned. Removing them shrinks the operator-facing surface to just the commands that real callers (CI workflows, the issue templates) actually use.Vector configuration
N/A. Internal release tooling only.
How did you test this PR?
vdevcover bump-type computation, conventional-commit parsing, changelog-fragment parsing, commit validation, and CUE rendering.git worktreeof master withcargo vdev release prepare --version 0.56.0 --vrl-version 0.32.0 --dry-run. Produced 6 commits on the prep branch, generated0.56.0.cue, retired allchangelog.d/*.mdfragments viagit rm, andcue fmtaccepted the output. No pushes, no PR, no impact on the primary checkout.cargo clippy -p vdev --no-depsis clean (pedantic + warnings denied).Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References
Follow-up to #22350 / #24781, which removed
generate-component-docs.rb.