-
Notifications
You must be signed in to change notification settings - Fork 212
features: Distinguish between optional dependencies and features #1180
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
features: Distinguish between optional dependencies and features #1180
Conversation
"Add mark for features that are derived from optional dependencies", | ||
// upgrade query | ||
" | ||
ALTER TYPE feature ADD ATTRIBUTE optional_dependency BOOL; |
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.
Where can I learn more about postgres data types? Will optional_dependency
be added as NULL? It should be.
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.
Yes, which is an issue when loading the features page for existing crates:
thread '<unnamed>' panicked at 'error retrieving column 0: error deserializing column 0: a Postgres value was `NULL`'
Probably the type needs to be changed to optional_dependency: Option<bool>
.
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.
Yes, I have realized that later. IMO it would make sense to make is false as default.
EDIT: Nevermind it seems like we cannot set default in ALTER TYPE. At least I was not able to find it in documentation.
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 we shouldn't say something we don't know for sure. We should show an optional dependency/feature tag if the info is there, but just show nothing if we don't know.
51766fb
to
b65fec0
Compare
Store in database if feature comes from optional dependency. At the same time resolve rename as optional dependency might use same package multiple times under different name.
b65fec0
to
2039231
Compare
Thanks for working on this! |
Hi,
as discussed in #1175, features that are taken from optional dependencies are marked in database and
stored with rename, if provided.