-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add symlink parameter #468
base: main
Are you sure you want to change the base?
Conversation
…r improved symlink handling
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.
This is going in the right direction.
src/main.rs
Outdated
/// The WeaverArgs will be shared across all commands. So only the general options should be | ||
/// included here. | ||
#[derive(Args, Debug)] | ||
pub struct WeaverArgs { |
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 suggest renaming this struct to CommonRegistryArgs
and moving it to src/registry/mod.rs
, as it will encapsulate the common arguments for all the registry
subcommands. For global arguments (e.g., --debug), Clap already provides a mechanism. However, that mechanism cannot be used here because --follow-symlinks
does not apply to commands unrelated to the registry.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #468 +/- ##
=======================================
- Coverage 72.5% 72.5% -0.1%
=======================================
Files 49 49
Lines 3635 3634 -1
=======================================
- Hits 2639 2637 -2
- Misses 996 997 +1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
…e imports across the registry modules
I have fixed the changes you mentioned above and I manually tested the command with a symbolic link folder, and it worked flawlessly. Please let me know if there are any other major changes needed; otherwise, I’ll proceed with writing the tests! @lquerel |
@Leo6Leo Sounds good. Let me know when you are ready for the next review. Thanks |
@lquerel The tests have been added, the PR should be ready for review imo, PTAL, thanks! |
fixes #441
Summary of the change I have made:
Added an option to follow symbolic links when loading the registry in various parts of the codebase. The primary change is the addition of a
follow_symlinks
parameter, which is passed through multiple functions and structures to control this behavior.Key changes include:
follow_symlinks
param asWeaverArg
acrossSchemaResolver
,SnippetGenerator
, andResolvedSemconvRegistry
to enable optional symbolic link following during registry operations.-The
WeaverArgs
struct impacted various commands (check
,generate
,resolve
,update-markdown
,stats
) to include and handle thefollow_symlinks
option.SchemaResolver
to configurewalkdir::WalkDir
with thefollow_symlinks
parameter and use thefollow_links function
.follow_symlinks
= false.The ideal outcome would be:
After running the command
weaver will read symbolic linked folders under
sementic-conventions/model
and generate the artifacts.PS: I try to raise this PR first to get some early feedback. As I am new to Rust and Otel, I am open to suggestions and feedback.