-
Notifications
You must be signed in to change notification settings - Fork 86
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
fix(ic-asset): .ic-assets.json allow_raw_access
overrides
#3434
Conversation
Co-authored-by: Eric Swanson <[email protected]>
}, | ||
"allow_raw_access": true |
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.
incorrectly introduced in #3369
enum Maybe<T> { | ||
Null, | ||
#[default] |
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.
lint
if let Some(allow_raw_access) = self.allow_raw_access { | ||
s.push_str(&format!( | ||
" - enable raw access: {}\n", | ||
if allow_raw_access { | ||
"enabled" | ||
} else { | ||
"disabled" | ||
} | ||
)); | ||
} |
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.
makes life easier during debugging
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.
Would you please write something in the PR description about how this PR fixes the issue? I see changes to use the derivative
crate, but that looks like a refactor, not something that changes functionality.
Also please describe the problem that this solves in a little more detail in the PR description, since access to JIRA is not public.
To be perfectly honest, I don't know why it fixes it, but it fixes it, took me a long time to find it simply because I stumbled upon it by means of trial and error. I tried using |
I pasted the content of jira ticket into pr description |
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.
Not to be merged until we understand how/why this PR fixes the issue.
@@ -47,6 +47,8 @@ Updated Motoko to [0.10.2](https://github.com/dfinity/motoko/releases/tag/0.10.2 | |||
|
|||
### Frontend canister | |||
|
|||
Fixed an issue where the `allow_raw_access` configuration value was being affected by the order of declarations in the configuration file in `.ic-assets.json`. |
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.
In the changelog, please describe the issue in enough detail that someone with a project, the behavior of which will change after this fix, will be able to recognize that fact.
I appreciate the effort, but unfortunately it's not sufficient in this case. The JIRA ticket describes a problem. Its purpose is to describe that problem in enough detail that the assignee can understand what's being asked for, and hopefully reproduce the problem. It doesn't describe the cause of the problem because it can't: the cause isn't known at the time of writing of the JIRA ticket. The PR description should describe the change and the reasoning behind it. The PR author should understand their change well enough to describe what they did and why. The PR description should give reviewers an idea of what they are looking at. A succinct yet complete PR description will also demonstrate to reviewers that the PR author understands their own change. |
#[serde(default = "super::default_raw_access")] | ||
#[derivative(Default(value = "Some(true)"))] |
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.
An idea as to the underlying cause: this removes the serde default, replacing it with an "impl Default" default. So before, whereas deserializing a rule that didn't specify allow_raw_access would have Some(true) here, after this change it will have None.
What would you think about removing the #[derivative(Default(value = "Some(true)"))]
as well? At this level, we're interested in knowing what's in the config file rule, and None seems more accurate.
Dear @smallstepman, In order to potentially merge your code in this open-source repository and therefore proceed with your contribution, we need to have your approval on DFINITY's CLA. If you decide to agree with it, please visit this issue and read the instructions there. Once you have signed it, re-trigger the workflow on this PR to see if your code can be merged. — The DFINITY Foundation |
Replaced by #3635 |
Description
.ic-assets.json: "allow_raw_access" default overrides previous config entries even if not present in a match entry. This fixes the issue.
Jira ticket description
Fixes https://dfinity.atlassian.net/browse/SDK-1238
How Has This Been Tested?
unit test
Checklist:
I have made corresponding changes to the documentation.