Skip to content

Commit c0d36c2

Browse files
Improve contributing instructions (#12492)
1 parent e38ee79 commit c0d36c2

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ If you have a Code of Conduct concern, please contact the moderators using the l
6060

6161
Licensed under either of these:
6262

63-
- Apache License, Version 2.0, ([LICENSE-APACHE](./LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
64-
- MIT license ([LICENSE-MIT](./LICENSE-MIT) or https://opensource.org/licenses/MIT)
63+
- Apache License, Version 2.0, ([LICENSE-APACHE](./LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
64+
- MIT license ([LICENSE-MIT](./LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
6565

6666
[crates.io]: https://crates.io/
6767
[Rust]: https://www.rust-lang.org/

docs/CONTRIBUTING.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Contributing to crates.io
22

3-
* [Attending the weekly team meetings](#attending-the-weekly-team-meetings)
4-
* [Finding an issue to work on](#finding-an-issue-to-work-on)
5-
* [Submitting a Pull Request](#submitting-a-pull-request)
6-
* [Reviewing Pull Requests](#)
7-
* [Checking Release State](#)
8-
* [Setting up a development environment](#setting-up-a-development-environment)
9-
* [Working on the Frontend](#working-on-the-frontend)
10-
* [Working on the Backend](#working-on-the-backend)
11-
* [Running crates.io with Docker](#running-cratesio-with-docker)
3+
- [Attending the weekly team meetings](#attending-the-weekly-team-meetings)
4+
- [Finding an issue to work on](#finding-an-issue-to-work-on)
5+
- [Submitting a Pull Request](#submitting-a-pull-request)
6+
- [Reviewing Pull Requests](#reviewing-pull-requests)
7+
- [Checking Release State](#checking-release-state)
8+
- [Setting up a development environment](#setting-up-a-development-environment)
9+
- [Working on the Frontend](#working-on-the-frontend)
10+
- [Working on the Backend](#working-on-the-backend)
11+
- [Running crates.io with Docker](#running-cratesio-with-docker)
1212

1313
## Attending the weekly team meetings
1414

@@ -79,7 +79,7 @@ There you will find the commits involved in the current release.
7979
If you are only interested on the commit hash, you can also hit the site
8080
metadata endpoint available on `/api/v1/site_metadata`.
8181

82-
# Setting up a development environment
82+
## Setting up a development environment
8383

8484
First, you'll need git to clone the repo. [GitHub has help pages about setting
8585
up git](https://help.github.com/articles/set-up-git/), and once you've done
@@ -268,6 +268,15 @@ postgres`). Generally, the problem is that by default the postgres server is
268268
> we'll help fix the problem and will add the solution to these
269269
> instructions!
270270
271+
Another option is to use a standalone Docker container for Postgres:
272+
273+
```sh
274+
# example using postgres 16
275+
docker run -e POSTGRES_PASSWORD=password -p 5432:5432 postgres:16
276+
# database URL will be
277+
# DATABASE_URL=postgres://postgres:password@localhost:5432/cargo_registry
278+
```
279+
271280
#### OpenSSL
272281

273282
- macOS: you can also install with homebrew by using `brew install openssl`
@@ -361,6 +370,14 @@ Set up the git repo for the crate index by running:
361370
./script/init-local-index.sh
362371
```
363372

373+
#### Importing a database dump
374+
375+
You can then import the database with
376+
377+
```console
378+
./script/import-database-dump.sh
379+
```
380+
364381
#### Starting the server and the frontend
365382

366383
Build and start the server by running this command (you'll need to stop this
@@ -376,6 +393,13 @@ Then start the background worker (which will process uploaded READMEs):
376393
cargo run --bin background-worker
377394
```
378395

396+
Since crates.io is using the `tracing` crate, you can enable debug logging by
397+
setting the `RUST_LOG` environment variable to `debug` before running them, for
398+
example:
399+
400+
```console
401+
RUST_LOG=debug cargo run --bin background-worker
402+
```
379403
Then start a frontend that uses this backend by running this command in another
380404
terminal session (the frontend picks up frontend changes using live reload
381405
without a restart needed, and you can leave the frontend running while you

0 commit comments

Comments
 (0)