-
Notifications
You must be signed in to change notification settings - Fork 220
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
[devbox add] --allow-insecure should handle multiple, user-specified packages #1749
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
576836a
to
9425255
Compare
f3276ee
to
20c09d8
Compare
20c09d8
to
a0cc402
Compare
Currently reviewing, but a quick comment about the json change. cc: @Lagoja Instead of the current json change, thoughts on: "python": {
"version": "2.7",
"allow_insecure" true,
}, "python": {
"version": "2.7",
"dependencies": {
"openssl": {
"allow_insecure": true,
}
}
}, Motivation:
The only downside is that this format doesn't make a distinction between direct dependencies and sub-depedencies, but I think that's way too complicated. |
@mikeland73 🤔 I'm a little concerned that it'll be introducing quite some complexity in this PR's implementation: especially around needing to distinguish the top-level package from dependency packages, and their properties. Can we cross that bridge when we need to later? |
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'm liking the comprehensive tests.
{{- if .AllowInsecure }} | ||
"{{ .StoreName }}" | ||
{{- if .HasAllowInsecure }} | ||
{{- range .AllowInsecure }} | ||
"{{ . }}" | ||
{{- end }} |
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 you can remove the if check here.
{{- if .AllowInsecure }} | |
"{{ .StoreName }}" | |
{{- if .HasAllowInsecure }} | |
{{- range .AllowInsecure }} | |
"{{ . }}" | |
{{- end }} | |
{{- range .AllowInsecure }} | |
"{{ . }}" | |
{{- end }} |
@mikeland73 landed the code to close the week out, but happy to discuss more and make any followup fixes |
@savil I would run it by @Lagoja . JSON changes are semi-1 way doors. This is OK but just wanted to make sure you are aware of:
|
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Summary
Changes
devbox add
's--allow-insecure
flag to take a[]string
instead ofbool
.allow_insecure
field in the package in thedevbox.json
configNIXPKGS_ALLOW_INSECURE=1
in thenix build
duringdevbox add
allow_insecure
in the generated flake'spermittedInsecurePackages
.TODO:
allow_insecure: true
in theirdevbox.lock
([add] migrate allow_insecure from lockfile to config #1754)Downside:
If a user erroneously specifies the wrong package name or names in
--allow-insecure=<packages>
, then adevbox add <pkg> --allow-insecure=<packages>
outside thedevbox shell
environment will quietly work. However, the user will experience an error when runningdevbox shell
(or similar) next time, and need to fix the erroneous--allow-insecure
value.--allow-insecure=<packages>
Fixes #1337
How was it tested?
devbox add python@2.7
gives the following error now:Doing
devbox add python@2.7 --allow-insecure=python-2.7.18.1
works with the devbox.json now having:Also for the package reported in #1337: