-
Notifications
You must be signed in to change notification settings - Fork 138
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
feat: support temporal score and Environmental Score #1198
base: main
Are you sure you want to change the base?
Conversation
It would be nice if these changes could be done in a purely additive manner with any breaking changes as a last resort and kept as minimal as possible. This crate has been post-1.0 for over 5 years and any unnecessary changes will cause breakages/churn. |
@tarcieri How about this commit? |
@bxf12315, could you please add a description to this PR ? |
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.
The code looks good to me.
Although the use of abbreviations for the metrics of the various groups is confusing.
It makes sense in a context of a specification document but it's makes the code obscure and hard to read.
For the base group, dubbing the file 'attack_vector.rs', instead of 'av' is clear about its purpose, especially because there are many files such as 'ac', 'av', etc.
But I suppose the main issue is because the file name should reflect the name of the struct or object it manages.
Also I think the use of mod.rs inside of base, environmental and temporal modules would be more idiomatic to Rust as of today.
Note that Please don't use |
@gildub you are suggesting breaking changes that are more or less bikeshedding. This crate has been stable, for many, many years. Please don't make any superfluous changes, and please follow the existing conventions. |
Regarding the mod.rs style, I thought it was the other way around, thanks for the link ! Regarding the file names, shouldn't the file name reflect the struct it contains ? |
@gildub I'm not good at naming, but I personally think that naming conventions consistent with the whole project are reasonable. |
Hi @xiabai, |
I do not think change file's name is necessary. Keep changes to a minimum.
I do not think change file's name is necessary. Keep changes to a minimum. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@gildub the changes you are proposing are, at best, off-topic for this PR. Please open a separate issue. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@tarcieri How to trigger the github workflow, I find an compile error, it's just happened on rust 1.6, I want to rebuild it. |
@bxf12315 it should run automatically from now on |
This comment was marked as off-topic.
This comment was marked as off-topic.
1babc4d
to
27ba93e
Compare
cvss/src/metric.rs
Outdated
/// Get CVSS v3.1 score for this metric. | ||
fn score(self) -> f64; | ||
// fn score(self) -> f64; |
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 a breaking change
So yeah, this PR includes many, many breaking changes by decomposing what are currently inherent methods into traits. That's not necessarily a dealbreaker for this PR but it will signal the start of another breaking release cycle where it would be good to also address #1087, and would therefore delay any usage of these new features outside of prereleases. I think it can probably still be written in a purely additive way that doesn't break any existing APIs (again, this is a v2.0 crate which has been stable for many years), and perhaps introduce those changes separately in a PR that starts a new breaking release cycle. |
ok, I got your point, I will drop these three traits MetricScore and ScopedScore, and ModifiedScore, keep the old logic. |
ca7d5cc
to
a2a9c0f
Compare
@tarcieri updated, please check again. |
@tarcieri please review the PR. Thanks |
@tarcieri hi please review the PR. Thanks |
@bxf12315 I will try to review soon, however I am the maintainer for a large number of projects and this PR is something of a lower priority to me |
I'm a little confused how referencing |
Please check again. Thanks |
No description provided.