-
Notifications
You must be signed in to change notification settings - Fork 35
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
Metrics and Events don't require attributes #494
Metrics and Events don't require attributes #494
Conversation
9297170
to
1a91ee7
Compare
…/jerbly/weaver into metrics-don't-require-attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and thank you!
@jerbly This PR is still in draft mode. Is that intentional? If not, please click “Ready for Review,” and I’ll proceed with merging it. Thanks! |
@lquerel it's currently failing unrelated clippy checks. One is a simple fix. The other is documentation and formatting in the generated code in weaver-codegen - I'm not sure what to do with it. Perhaps change clippy settings in that crate? |
Regarding Clippy, I suggest implementing the changes proposed in Clippy’s report regarding the possibility of eliding certain lifetimes. Currently, our build pipeline is configured to always use the latest version of the Rust toolchain, which has the advantage of benefiting from the latest changes and improvements but also the drawback of introducing new Clippy errors unrelated to the PR. We could pin the toolchain version to avoid this, but at the same time, the current approach ensures we don’t forget to update it. |
The lifetimes one is easy. The doc problems in the generated code was where I had my doubts it was worth the effort. I'll work on it. |
@lquerel - I've fixed those issues so this is ready to merge now. :) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #494 +/- ##
=====================================
Coverage 73.9% 73.9%
=====================================
Files 50 50
Lines 3902 3911 +9
=====================================
+ Hits 2886 2893 +7
- Misses 1016 1018 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed something but I didn’t understand the changes to the code generation section. What was the issue exactly? Why comment out that part of the code generation?
//! Attributes for the `{{ attributes_root_namespace.root_namespace }}` namespace. | ||
//! pub mod {{ attributes_root_namespace.root_namespace | snake_case }}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn’t understand these changes. Why comment out this part of the code generation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clippy was complaining about the documentation and formatting. The jinja template previously created:
/// Attributes for the `system` namespace.
pub mod system;
for example.
Then here:
weaver/crates/weaver_codegen_test/build.rs
Lines 84 to 89 in 4220324
// For the purpose of the integration test located in `tests/codegen.rs`, we need to: | |
// - Combine all generated files to form a single file containing all the generated code | |
// organized in nested modules. | |
// - Replace `//!` with `//` | |
// - Remove `pub mod` lines | |
create_single_generated_rs_file(target_dir.as_path()); |
pub mod
lines are removed leaving a floating ///
doc comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. I had forgotten about that part of the plumbing in the code :-)
//! Metrics for the `{{ attributes_root_namespace.root_namespace }}` namespace. | ||
//! pub mod {{ attributes_root_namespace.root_namespace | snake_case }}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer ;)
Fix for issue #405
extends
orattributes
requirement mandatory for all group types exceptmetric
andevent
.