-
Notifications
You must be signed in to change notification settings - Fork 99
feat: Make settings not thread-local #1444
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1444 +/- ##
==========================================
- Coverage 78.41% 77.98% -0.43%
==========================================
Files 162 162
Lines 39515 40058 +543
==========================================
+ Hits 30986 31240 +254
- Misses 8529 8818 +289 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #1444 will improve performances by 12.26%Comparing Summary
Benchmarks breakdown
Footnotes
|
let mut validation_log = StatusTracker::default(); | ||
|
||
let settings = Settings::default(); | ||
// ^^ TO REVIEW: Is there a reason we'd need non-default settings here? |
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.
Is there actually a setting already that changes things in here? If so, it could be useful to investigate why that setting came to be - might answer the question as side-effect.
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 don't think this will be a problem, see here:
#1444 (comment)
// "builder.auto_opened_action.source_type", | ||
// ); | ||
// | ||
// ... which omits the ".actions" node after "builder" |
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.
My 2 cents: It would be good to keep the settings structured. The missing actions node feels like a typo to me?
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 agree. What I don't know is how to repair the test in question. @gpeacock?
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 source type is only necessary for the c2pa.created
action. We can safely remove this from the test_settings.toml
that the test uses.
use common::test_signer; | ||
|
||
#[test] | ||
#[ignore = "See discussion in builder.rs near line 1190"] |
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.
@gpeacock please review this before we merge.
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.
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.
Leaving lots of reviews to track progress.
// TO DO (https://github.com/contentauth/c2pa-rs/issues/1454): | ||
// Make this the official API? |
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'd defer this work to #1465.
// TO DO (https://github.com/contentauth/c2pa-rs/issues/1454): | ||
// Make this the official API? |
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'd defer this work to #1465.
// TO DO BEFORE MERGE: Passing `verify` may be redundant now that we're | ||
// passing settings. |
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.
TODO: internal
// TO DO BEFORE MERGE: Passing `verify` may be redundant now that we're | ||
// passing settings. |
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.
TODO: internal
// TO DO (https://github.com/contentauth/c2pa-rs/issues/1454): | ||
// Add a Settings argument here? |
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'd defer this work to #1465.
// TO REVIEW: I think in this case, we're doing structural validation of | ||
// time stamps but not trust validation. If so, the below is correct. (I think.) |
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.
TODO: internal
let settings = crate::settings::get_settings().unwrap_or_default(); | ||
// TO DO BEFORE MERGE? Pass Settings in here? |
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.
TODO: internal
let settings = Settings::default(); | ||
// ^^ TO REVIEW: Is there a reason we'd need non-default settings here? | ||
// If so, that means we hae to rework CAIReader and CAIWriter traits | ||
// to take a &Settings arg and that is a pretty huge change. |
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 think Settings
in the Store
constructors are only used for configuring trust. In this scenario we are only using the Store
to reconstruct the split manifest stores in BMFF, the trust is validated with a higher-level Store
. It does feel wrong to create default settings and pass it in as a parameter here, but I don't think it'll be a problem for the time being.
cc @mauricefisher64 to confirm.
let mut validation_log = StatusTracker::default(); | ||
|
||
let settings = Settings::default(); | ||
// ^^ TO REVIEW: Is there a reason we'd need non-default settings here? |
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 don't think this will be a problem, see here:
#1444 (comment)
// TO DO (https://github.com/contentauth/c2pa-rs/issues/1454): | ||
// Add a Settings argument here? |
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.
TODO: internal
Settings are now snapshotted at public API surfaces and passed through all layers below.
Note related work from @ok-nick in #1447 and further work likely in #1454.