vector icon indicating copy to clipboard operation
vector copied to clipboard

chore(config): Fix `InlineSingleUseReferencesVisitor` failing merges

Open bruceg opened this issue 5 months ago • 1 comments
trafficstars

Summary

The above visitor is intended to inline schemas in the references section for which there is only a single reference. This visitor is, however, unable to detect some cases where there are in fact multiple references, ending up inlining the schema multiple times. This has led to bloat in generated schemas.

In the core Vector schema, this affects 121 structures, shaving 844 lines off of the generated schema.

I've labelled this as a chore as it doesn't actually make any functional change to the result.

Change Type

  • [ ] Bug fix
  • [ ] New feature
  • [x] Non-functional (chore, refactoring, docs)
  • [ ] Performance

Is this a breaking change?

  • [ ] Yes
  • [ ] No

How did you test this PR?

Does this PR include user facing changes?

  • [ ] Yes. Please add a changelog fragment based on our guidelines.
  • [x] No. A maintainer will apply the "no-changelog" label to this PR.

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • The CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • cargo fmt --all
      • cargo clippy --workspace --all-targets -- -D warnings
      • cargo nextest run --workspace (alternatively, you can run cargo test --all)
      • ./scripts/check_changelog_fragments.sh
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please run cargo vdev build licenses to regenerate the license inventory and commit the changes (if any). More details here.

References

bruceg avatar Jun 13 '25 22:06 bruceg

Datadog Report

Branch report: bruceg/fix-inline-single-visitor Commit report: 1c6f57e Test service: vector

:white_check_mark: 0 Failed, 7 Passed, 0 Skipped, 25.26s Total Time

There's a failing check: https://github.com/vectordotdev/vector/actions/runs/15645373779/job/44081780346?pr=23207

pront avatar Jun 16 '25 18:06 pront