From 29cc275d1183351fc8b6b9314127b0f2f54ae344 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sat, 13 Dec 2025 18:53:42 -0700 Subject: [PATCH 1/8] fix: instruction for contributing --- README.md | 4 ++-- docs/CONTRIBUTING.md | 43 ++++++++++++++++++++++++++-------- package.json | 4 ++-- script/import-database-dump.sh | 1 - 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3dbecc1102a..d6087ad32fc 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ If you have a Code of Conduct concern, please contact the moderators using the l Licensed under either of these: -- Apache License, Version 2.0, ([LICENSE-APACHE](./LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) -- MIT license ([LICENSE-MIT](./LICENSE-MIT) or https://opensource.org/licenses/MIT) +- Apache License, Version 2.0, ([LICENSE-APACHE](./LICENSE-APACHE) or ) +- MIT license ([LICENSE-MIT](./LICENSE-MIT) or ) [crates.io]: https://crates.io/ [Rust]: https://www.rust-lang.org/ diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index d606169d028..33a6c38b68c 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,14 +1,14 @@ # Contributing to crates.io -* [Attending the weekly team meetings](#attending-the-weekly-team-meetings) -* [Finding an issue to work on](#finding-an-issue-to-work-on) -* [Submitting a Pull Request](#submitting-a-pull-request) -* [Reviewing Pull Requests](#) -* [Checking Release State](#) -* [Setting up a development environment](#setting-up-a-development-environment) - * [Working on the Frontend](#working-on-the-frontend) - * [Working on the Backend](#working-on-the-backend) - * [Running crates.io with Docker](#running-cratesio-with-docker) +- [Attending the weekly team meetings](#attending-the-weekly-team-meetings) +- [Finding an issue to work on](#finding-an-issue-to-work-on) +- [Submitting a Pull Request](#submitting-a-pull-request) +- [Reviewing Pull Requests](#reviewing-pull-requests) +- [Checking Release State](#checking-release-state) +- [Setting up a development environment](#setting-up-a-development-environment) + - [Working on the Frontend](#working-on-the-frontend) + - [Working on the Backend](#working-on-the-backend) + - [Running crates.io with Docker](#running-cratesio-with-docker) ## Attending the weekly team meetings @@ -79,7 +79,7 @@ There you will find the commits involved in the current release. If you are only interested on the commit hash, you can also hit the site metadata endpoint available on `/api/v1/site_metadata`. -# Setting up a development environment +## Setting up a development environment First, you'll need git to clone the repo. [GitHub has help pages about setting 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 > we'll help fix the problem and will add the solution to these > instructions! +Another options is to use a standalone Docker container for Postgres. + +```sh +# example using postgres 15.15-trixie +docker run -e POSTGRES_PASSWORD=admin -p 5432:5432 postgres:15.15-trixie +# database URL will be +# DATABASE_URL=postgres://postgres:admin@localhost:5432/cargo_registry +``` + #### OpenSSL - macOS: you can also install with homebrew by using `brew install openssl` @@ -361,6 +370,12 @@ Set up the git repo for the crate index by running: ./script/init-local-index.sh ``` +You can then import the database with + +```console +./script/import-database-dump.sh +``` + #### Starting the server and the frontend Build and start the server by running this command (you'll need to stop this @@ -376,6 +391,14 @@ Then start the background worker (which will process uploaded READMEs): cargo run --bin background-worker ``` +Since these programs use the logging framework, you can enable debug logging by +setting the `RUST_LOG` environment variable to `debug` before running them, for +example: + +```console +RUST_LOG=debug cargo run --bin background-worker +``` + Then start a frontend that uses this backend by running this command in another terminal session (the frontend picks up frontend changes using live reload without a restart needed, and you can leave the frontend running while you diff --git a/package.json b/package.json index 29a56e654b1..d84fb3cf85e 100644 --- a/package.json +++ b/package.json @@ -186,8 +186,8 @@ "last 1 years" ], "engines": { - "node": "24.11.1", - "pnpm": "10.23.0" + "node": "^24.11.1", + "pnpm": "^10.23.0" }, "ember": { "edition": "octane" diff --git a/script/import-database-dump.sh b/script/import-database-dump.sh index e158ed2a0f0..f6e5177e4bc 100755 --- a/script/import-database-dump.sh +++ b/script/import-database-dump.sh @@ -6,7 +6,6 @@ set -o errexit set -o nounset -set -o pipefail readonly TARBALL_PATH="tmp/db-dump.tar.gz" readonly DUMP_PATH="tmp/db-dump" From a8ab580a7bbf21b888483c4780c99e802e4de4de Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sat, 13 Dec 2025 19:00:04 -0700 Subject: [PATCH 2/8] fix typo during merge --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 501cf4cd46d..0d6a4d86243 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,7 @@ "last 1 years" ], "engines": { - "node": "^24.12.1", + "node": "^24.12.0", "pnpm": "^10.25.0" }, "ember": { From 939cc08c34dca7721fbd49663c4d2a2d1eb402d9 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sat, 13 Dec 2025 19:07:31 -0700 Subject: [PATCH 3/8] consistency with docker-compose --- docs/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 33a6c38b68c..1bcee54d5c5 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -272,9 +272,9 @@ Another options is to use a standalone Docker container for Postgres. ```sh # example using postgres 15.15-trixie -docker run -e POSTGRES_PASSWORD=admin -p 5432:5432 postgres:15.15-trixie +docker run -e POSTGRES_PASSWORD=password -p 5432:5432 postgres:15.15-trixie # database URL will be -# DATABASE_URL=postgres://postgres:admin@localhost:5432/cargo_registry +# DATABASE_URL=postgres://postgres:password@localhost:5432/cargo_registry ``` #### OpenSSL From 028928ef17afd97208ea89f0b32c102a35fe1145 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Mon, 15 Dec 2025 18:14:23 -0700 Subject: [PATCH 4/8] fix versions --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0d6a4d86243..02dd8a181b4 100644 --- a/package.json +++ b/package.json @@ -186,8 +186,8 @@ "last 1 years" ], "engines": { - "node": "^24.12.0", - "pnpm": "^10.25.0" + "node": "24.12.0", + "pnpm": "10.25.0" }, "ember": { "edition": "octane" From 0ff36b9e6093e2fe55ec21bbd8b73c290eb9e351 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Tue, 16 Dec 2025 02:14:38 +0100 Subject: [PATCH 5/8] Update docs/CONTRIBUTING.md Co-authored-by: Tobias Bieniek --- docs/CONTRIBUTING.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 1bcee54d5c5..3b41d46e965 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -391,14 +391,12 @@ Then start the background worker (which will process uploaded READMEs): cargo run --bin background-worker ``` -Since these programs use the logging framework, you can enable debug logging by +Since crates.io is using the `tracing` crate, you can enable debug logging by setting the `RUST_LOG` environment variable to `debug` before running them, for example: ```console RUST_LOG=debug cargo run --bin background-worker -``` - Then start a frontend that uses this backend by running this command in another terminal session (the frontend picks up frontend changes using live reload without a restart needed, and you can leave the frontend running while you From 542719e636f3696adf7ca3081db3bd011228b518 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Mon, 15 Dec 2025 18:16:03 -0700 Subject: [PATCH 6/8] fix --- docs/CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 3b41d46e965..ac6589f2dda 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -271,8 +271,8 @@ postgres`). Generally, the problem is that by default the postgres server is Another options is to use a standalone Docker container for Postgres. ```sh -# example using postgres 15.15-trixie -docker run -e POSTGRES_PASSWORD=password -p 5432:5432 postgres:15.15-trixie +# example using postgres 16 +docker run -e POSTGRES_PASSWORD=password -p 5432:5432 postgres:16 # database URL will be # DATABASE_URL=postgres://postgres:password@localhost:5432/cargo_registry ``` @@ -370,6 +370,8 @@ Set up the git repo for the crate index by running: ./script/init-local-index.sh ``` +#### Importing a database dump + You can then import the database with ```console From b5f846fae6a62fd5a88b72c299e382ab0c8ef412 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Mon, 15 Dec 2025 18:17:08 -0700 Subject: [PATCH 7/8] revert and split --- script/import-database-dump.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/import-database-dump.sh b/script/import-database-dump.sh index f6e5177e4bc..e158ed2a0f0 100755 --- a/script/import-database-dump.sh +++ b/script/import-database-dump.sh @@ -6,6 +6,7 @@ set -o errexit set -o nounset +set -o pipefail readonly TARBALL_PATH="tmp/db-dump.tar.gz" readonly DUMP_PATH="tmp/db-dump" From 51ed57d7d31c76aa2323dd1e86562abbec972e8f Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Tue, 16 Dec 2025 09:38:10 +0100 Subject: [PATCH 8/8] Apply suggestions from code review --- docs/CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index ac6589f2dda..abac398389e 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -268,7 +268,7 @@ postgres`). Generally, the problem is that by default the postgres server is > we'll help fix the problem and will add the solution to these > instructions! -Another options is to use a standalone Docker container for Postgres. +Another option is to use a standalone Docker container for Postgres: ```sh # example using postgres 16 @@ -399,6 +399,7 @@ example: ```console RUST_LOG=debug cargo run --bin background-worker +``` Then start a frontend that uses this backend by running this command in another terminal session (the frontend picks up frontend changes using live reload without a restart needed, and you can leave the frontend running while you