Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(external): generate global option and common field from Rust macro #22408

Merged

Conversation

titaneric
Copy link
Contributor

Summary

This is follow-up PR for #22345

Change Type

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

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

make generate-component-docs
cd website
make run-production-site-locally

Does this PR include user facing changes?

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

Checklist

  • Please read our Vector contributor resources.
    • make check-all is a good command to run locally. This check is
      defined here. Some of these
      checks might not be relevant to your PR. For Rust changes, at the very least you should run:
      • cargo fmt --all
      • cargo clippy --workspace --all-targets -- -D warnings
      • cargo nextest run --workspace (alternatively, you can run cargo test --all)
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run dd-rust-license-tool write to regenerate the license inventory and commit the changes (if any). More details here.

References

@titaneric titaneric requested review from a team as code owners February 10, 2025 15:22
@github-actions github-actions bot added domain: ci Anything related to Vector's CI environment domain: external docs Anything related to Vector's external, public documentation domain: core Anything related to core crates i.e. vector-core, core-common, etc labels Feb 10, 2025
Copy link
Member

@pront pront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @titaneric, these improvements are much appreciated 👍

lib/vector-core/Cargo.toml Outdated Show resolved Hide resolved
scripts/generate-component-docs.rb Show resolved Hide resolved
@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Feb 10, 2025
@pront pront changed the title feat(external_docs): generate global option and common field from Rust macro docs(external): generate global option and common field from Rust macro Feb 10, 2025
common: false
required: false
}
acknowledgements: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that these configuration are generated from the Rust original code. I don't port the config from configuration.cue to Rust docs.

@@ -798,6 +798,17 @@ def resolve_schema(root_schema, schema)
end
end

# required for global option configuration
is_common_field = get_schema_metadata(schema, 'docs::common')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's temporary solution for Ruby docs generator, and I do believe that it would be much bettern when we port Ruby code to Rust.

@pront pront enabled auto-merge February 10, 2025 17:25
@pront pront added this pull request to the merge queue Feb 10, 2025
@jhgilbert jhgilbert self-assigned this Feb 10, 2025
Copy link
Contributor

@jhgilbert jhgilbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delaying approval since there seems to be an internal comment in the PR, but I will loop back. Thank you!

updated before they expire and are removed.

Set this to a value larger than your `internal_metrics` scrape interval (default 5 minutes)
that metrics live long enough to be emitted and captured,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
that metrics live long enough to be emitted and captured,
so metrics live long enough to be emitted and captured.


configuration: {
// expire_metrics's type is a little bit tricky, we could not generate `uint` from `docs::type_override` metadata macro easily.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this comment is internal, should it be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment I wrote would not be displayed on the docs, and I think it might need to be kept since it's specifically handled case.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhgilbert , would you please check it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checked and leaving the comment is fine.

auto-merge was automatically disabled February 10, 2025 18:38

Pull Request is not mergeable

@pront pront removed this pull request from the merge queue due to a manual request Feb 10, 2025
@titaneric titaneric requested a review from jhgilbert February 11, 2025 00:44
@pront pront enabled auto-merge February 12, 2025 15:22
@pront pront added this pull request to the merge queue Feb 12, 2025
Merged via the queue into vectordotdev:master with commit c9076aa Feb 12, 2025
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: ci Anything related to Vector's CI environment domain: core Anything related to core crates i.e. vector-core, core-common, etc domain: external docs Anything related to Vector's external, public documentation no-changelog Changes in this PR do not need user-facing explanations in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants