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

migrate crate-details, match_version, db:: and test-fakes to sqlx #2325

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

syphar
Copy link
Member

@syphar syphar commented Nov 19, 2023

Finding a working smaller piece to migrate became harder and harder, this is bigger than I hoped, but works.

This migrates some major parts to sqlx & async, also including parts used in our main web::rustdoc endpoints.

Namely:

  • CrateDetails and match_version, and the remaining release-details / list endpoints
  • db::add_package methods, db::file
  • test::fakes is async internally with sync wrapper methods for old tests

For things I didn't want to migrate (yet) I had to sprinkle plenty of runtime.block_on around to make it work.

I think there is a nicer way to design the whole TestEnvironment / FakeRelease story, perhaps with having async versions of both classes, similar to AsyncStorage / Storage. I would leave fixing

Also includes the changes from #2324

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Nov 19, 2023
@syphar
Copy link
Member Author

syphar commented Dec 6, 2023

@rust-lang/docs-rs-reviewers any chance for a review?

I know it's much code, but I would love to push this forward. After these async refactors I could then invest some time into making our web handlers much more readable / understandable.

@GuillaumeGomez
Copy link
Member

I can try but my review won't be up to much as I don't much this part of the code.

Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Choose a reason for hiding this comment

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

Apart from the strange JSON files, this is just a crate change so nothing to note in particular from me.

@syphar
Copy link
Member Author

syphar commented Dec 6, 2023

Apart from the strange JSON files, this is just a crate change so nothing to note in particular from me.

It's a little more than a crate change, since many methods get converted from sync to async.

But generally yes ;)

@GuillaumeGomez
Copy link
Member

Yes absolutely, but it didn't seems strange or anything. So please just add a readme file in the json folder so people like me will know what's going on in there and why it even exists in the first place. :)

@syphar syphar merged commit 66d9b95 into rust-lang:master Dec 8, 2023
23 checks passed
@syphar syphar deleted the sqlx-merged branch December 8, 2023 06:25
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Dec 8, 2023
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Dec 8, 2023
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.

2 participants