Skip to content
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

Remove version_authors and clean up old data #3549

Merged
merged 4 commits into from
May 12, 2021

Conversation

Rustin170506
Copy link
Member

@rust-highfive
Copy link

r? @carols10cents

(rust-highfive has picked a reviewer for you, use r? to override)

@Rustin170506 Rustin170506 marked this pull request as ready for review April 24, 2021 15:22
@Rustin170506 Rustin170506 changed the title Remove version_authors Remove version_authors and clean up useless data Apr 24, 2021
@Rustin170506 Rustin170506 changed the title Remove version_authors and clean up useless data Remove version_authors and clean up old data Apr 26, 2021
@Rustin170506
Copy link
Member Author

r? @pietroalbini

Can you help with the patch file issue? I'm actually tempted to delete the patch file as it doesn't seem to be helping us?

Because since we don't update it every time, it must be expired? Or do I still have a misunderstanding of how patch file works?

@pietroalbini
Copy link
Member

Pushed a commit on your branch fixing the patch!

Because since we don't update it every time, it must be expired? Or do I still have a misunderstanding of how patch file works?

The patching tool is quite smart, and in most cases it will adapt to other schema.rs changes without the need to tweak the patch. Let's take for example the chunk of the patch that was giving you errors:

@@ -1016,6 +1031,7 @@
 joinable!(publish_limit_buckets -> users (user_id));
 joinable!(publish_rate_overrides -> users (user_id));
 joinable!(readme_renderings -> versions (version_id));
+joinable!(recent_crate_downloads -> crates (crate_id));
 joinable!(version_authors -> versions (version_id));
 joinable!(version_downloads -> versions (version_id));
 joinable!(version_owner_actions -> api_tokens (api_token_id));

The patching tool will apply this patch (adding the highlighted line) relative to the three lines above and below it. As long as those three lines above and below are not changed the tool will be able to apply the patch even if the rest of the file completely changes.

The problem here is that one of the lines below did change, as you removed the version_authors table. By doing so you removed the hit the patching tool needed to figure out where to apply the change.

To fix this issue, in my commit I had to remove the version_authors line from the patch. That was not enough though, as now there were only two lines below instead of three. After adding the following line in schema.rs the problem was fixed:

@@ -1016,6 +1031,7 @@
 joinable!(publish_limit_buckets -> users (user_id));
 joinable!(publish_rate_overrides -> users (user_id));
 joinable!(readme_renderings -> versions (version_id));
+joinable!(recent_crate_downloads -> crates (crate_id));
 joinable!(version_downloads -> versions (version_id));
 joinable!(version_owner_actions -> api_tokens (api_token_id));
 joinable!(version_owner_actions -> users (user_id));

If you have more questions around this just ask!

Copy link
Member

@pietroalbini pietroalbini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving the rest of the review back to Carol. r? @carols10cents

@Rustin170506
Copy link
Member Author

@pietroalbini It's working well. Thanks!

@pietroalbini
Copy link
Member

r? @pietroalbini

Thank you so much!
@bors r+

@bors
Copy link
Contributor

bors commented May 12, 2021

📌 Commit 70c8e2a has been approved by pietroalbini

@bors
Copy link
Contributor

bors commented May 12, 2021

⌛ Testing commit 70c8e2a with merge cd37d9d...

@bors
Copy link
Contributor

bors commented May 12, 2021

☀️ Test successful - checks-actions
Approved by: pietroalbini
Pushing cd37d9d to master...

@bors bors merged commit cd37d9d into rust-lang:master May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking Issue for RFC 3052: make the authors field optional
5 participants