On contributing to crates.io a WIP log

So I am doing some yak shaving, and need to start by contributing to crates.io. I want to log my experience setting up the environment. I hope it will act as some supplementary documentation on how to get involved. I also think logging this in public will help keep me moving. I want to log this as I go so I don’t forget what I get stuck on. So hear gose.

  1. I have a linux mint 18.1 VM running in hyper v. I think I will copy that to use as a development vm. Copying vm’s in hyper v is surprisingly hard, but eventually I got it done. Next install git, npm and postgis on the new vm. As a windows based lifeform, Installing things on linux is surprisingly easy.

More to come, as I actually do things.

2 Likes
  1. Continue through the readme. Install npm, I mean nodejs, oops nodejs-legacy. Things go smoothly for a while. Running psql takes some doing, but an idiot’s guide to setting up postgresql got me started out. cargo test apparently I need CMake. After instaling that all the test run! 1 passed; 79 failed;

Next time try to figure why that is not working.

This is awesome! Please let me know if you can't figure anything out, and if the README is missing some information that everyone should know about crates.io, I'd love PRs or issues <3

Right now, it looks like postgres is configured to use a password:

thread 'main' panicked at 'called Result::unwrap() on an Err value: ConnectParams(StringError("a password was requested but not provided"))'

I usually have postgres running locally without a password. If you want to have a password, you'll need to add it to the postgres URL for your test database in your .env:

export TEST_DATABASE_URL=postgres://username:password@localhost/cargo_registry_test

Password was the issue, Thanks! I’d love to have set it up not to have one, but my “idiot’s guide” did not cover that and it’s working now!

I can’t speak to “everyone should know.” If I have an issue I’ll be sure to mention it.

Next work on a bug fix pr, so as to learn the ropes. I am thinking of duplicated crate listings, but I am open to other suggestions.

Then figure out how the different downloads data relate in the database.

I think the duplicated crate listings bug is a great choice! Please do let me know either here or on the issue if you have any questions about it :slight_smile:

So I think I don’t understand router…

This line: router.get("/api/v1/*path", R(api_router.clone())); Makes all valid lookups also work with /api/v1/ inserted into them. The test prefer using the longer and more stable urls. So I want to test /categories/:category_id. That is a link that works and displays the bug in production. So I try /api/v1/categories/:category_id. But I just get an error message.

Ok, I figured something out, plane urls work with web browsers, api urls work with curl.

Yep, the API URLs will only respond if they get the header Accept: application/json.

Ok, that makes sense. I’ll have to keep my eyes peeled for where in the code that branching happens.

I got a pr in before life whisked me away. When that gets revue, I’ll do a few more open issues then make a proposal for my download history project.

So far the guides in the readme have done a magnificent job getting me set up.

2 Likes

I have several PRs in, some got merged! I made a proposal for the new interface. Looking forward to some feedback. :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.