-
Notifications
You must be signed in to change notification settings - Fork 644
Preparation to drop email
in User in Rust codes
#1911
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
Conversation
r? @smarnach (rust_highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #1901) made this pull request unmergeable. Please resolve the merge conflicts. |
email
from user structemail
from Rust codes
email
from Rust codesemail
in User in Rust codes
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.
Very close!! There's just one comment I think isn't needed anymore; mind removing that?
Thank you so much!!!
src/controllers/krate/metadata.rs
Outdated
@@ -220,18 +222,21 @@ pub fn reverse_dependencies(req: &mut dyn Request) -> CargoResult<Response> { | |||
|
|||
let version_ids: Vec<i32> = rev_deps.iter().map(|dep| dep.version_id).collect(); | |||
|
|||
// FIXME :: Another one of these silly transformation that is necessary to test | |||
// whether or not this function uses the column email from the user | |||
// table. Here, we simply set it to None. |
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.
Does this comment still apply, since the transformation it's talking about was removed in ea51376?
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.
You are right, I don't think this applies anymore. Do you want me to merge these commits into one?
☔ The latest upstream changes (presumably #1909) made this pull request unmergeable. Please resolve the merge conflicts. |
Every queries out of `User`'stable should now be converted into an intermediate type called `UserNoEmailType` (could be renamed, I guess). Conversion from this type to `User` is simply a copy except that `email` returned will always be `None`. I think its possible to remove `email` from User directly because its not actually the mirror of `User`'s table (the mirror struct is actually `NewUser`
Thank you so much! I introduced some conflicts by merging some other PRs, so I resolved those and squashed for you while I was in there. Great work!! @bors r+ |
📌 Commit 3af1934 has been approved by |
…cents Preparation to drop `email` in User in Rust codes Related: #1888 This commit(s) prepares the migration to dropping `email` column from the `User` table. Here, I introduce a new intermediate type called `UserNoEmailType`. Copied from my latest commit: Every queries out of `User`'stable should now be converted into an intermediate type called `UserNoEmailType`. This is done by selecting only the appropriate columns which is defined in `user::ALL_COLUMNS` (notice that it excludes `email`) This could be renamed, I guess. Conversion from this type to `User` is simply a copy except that `email` returned will always be `None`. I think its possible to remove `email` from User directly because its not actually the mirror of `User`'s table. The mirror struct is actually `NewUser`.
☀️ Test successful - checks-travis |
Revert "Auto merge of #1911 - hbina:remove_email_from_user_struct, r=… …carols10cents" This reverts commit 92edac3, reversing changes made to 4df7001. I missed a spot when reviewing #1911. This reverts that merge so that master is deployable again; I'm going to self-r+ this and then open a new PR with #1911 and a fix on it and have someone else review that.
Thank you! |
Missed a conversion from UserNoEmailType to User When reviewing #1911, I missed a spot. I reverted the PR merge on master, so this PR reverts the revert and adds the fix. I tried to write a test that would have caught this, but I utterly failed at making a real-enough app/request that would have `.user()` but would let me set the `session()` :( Also a lot of this code is temporary and will be undone once I've rebased #1891, but this needs to be deployed separately from #1891 to ensure there aren't any uses of the email column. r? @jtgeibel
Related: #1888
This commit(s) prepares the migration to dropping
email
column from theUser
table.Here, I introduce a new intermediate type called
UserNoEmailType
.Copied from my latest commit:
Every queries out of
User
'stable should now be converted into an intermediate type calledUserNoEmailType
.This is done by selecting only the appropriate columns which is defined in
user::ALL_COLUMNS
(notice that it excludesemail
)This could be renamed, I guess.
Conversion from this type to
User
is simply a copy except thatemail
returned will always beNone
.I think its possible to remove
email
from User directly because its not actually the mirror ofUser
's table.The mirror struct is actually
NewUser
.