Skip to content

Commit

Permalink
fixup! fixup! Apply suggestions from code review
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Perruzza <ethan.perruzza@gmail.com>
  • Loading branch information
EthanPERRUZZA committed Oct 2, 2024
1 parent 8f8152b commit 67029a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions content/docs/guides/contribute/code-review.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ We propose you a few tips and recommendations that we think are relevant to a hu

{{< figure src="/images/docs/contribute/code_review_pyramid.svg" link="https://www.morling.dev/blog/the-code-review-pyramid/">}}

## Script for Reviewing PRs
## Script for testing a PR

When reviewing a PR, it is usefull to test the changes by starting an instance of the OSRD app based on the PR branch.

To streamline this process, we’ve created a script that automatically spins up a dedicated app instance using the PR number. The script retrieves the Docker images built by the CI and launches the app, running every container on ports different from the development environment. This allows you to run both instances simultaneously without conflicts (ideal for comparing changes, for example). The key advantage is that reviews become faster since you don’t need to recompile code; you only need to download the pre-built images.
A script is available to spin up a separate and dedicated app instance using the PR number. The script uses the Docker images already built by the CI and launches the app, rin an isolated manner. This allows you to run both instances simultaneously without conflicts (ideal for comparing changes, for example). The key advantage is that reviews become faster since you don’t need to recompile code; you only need to download the pre-built images.

Additionally, you can specify an infrastructure backup, which the script will load directly into the app.
Additionally, you can specify a database backup, which the script will load directly into the app.

### Available Commands:

* `./scripts/pr-infra-compose.sh 8914 up`: Downloads the CI-generated images for PR #8914 and launches the application.
* `./scripts/pr-infra-compose.sh 8914 up-and-load-backup ./path_to_backup`: Downloads the images for PR #8914, restores data from the provided backup, and starts the application.
* `./scripts/pr-infra-compose.sh 8914 down`: Shuts down the test application instance for PR #8914.
* `./scripts/pr-infra-compose.sh 8914 down-and-clean`: Shuts down the test instance and cleans up the database.
* `./scripts/pr-infra-compose.sh 8914 down-and-clean`: Shuts down the test instance and cleans all data from the instance's docker volumes (PG data, Redis cache, RabbitMQ) to prevent all side-effects.

### Accessing Services:

Apart from the `frontend` endpoint, all localhost services are available, with a minor adjustment: you’ll need to add 1 to each port number (to avoid conflicts with the dev environment). For a list of common ports for the dev instance, refer to [this guide](https://osrd.fr/en/docs/guides/deploy/docker-compose/#accessing-services).
Apart from the `frontend` server, all localhost services are available on localhost, with a minor adjustment: you’ll need to add 1 to each port number (to avoid conflicts with the dev environment) : for a list of common ports, have a lok at the [dedicated docker compose file](https://github.com/OpenRailAssociation/osrd/blob/dev/docker/docker-compose.pr-test.yml).
2 changes: 1 addition & 1 deletion content/docs/guides/contribute/code-review.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ De plus, vous pouvez fournir une sauvegarde de la base de données, que le scrip

### Accès aux Services :

À l'exception du serveur frontend, tous les services sont disponibles sur localhost, avec un léger ajustement de port (pour éviter les conflits avec l'environnement de développement) : pour la liste des ports, reportez-vous au [fichier docker-compose dédié](https://github.com/OpenRailAssociation/osrd/blob/dev/docker/docker-compose.pr-test.yml).
À l'exception du serveur frontend, tous les services sont disponibles sur localhost, avec un léger ajustement de port (pour éviter les conflits avec l'environnement de développement) : pour la liste des ports, reportez-vous au [fichier docker compose dédié](https://github.com/OpenRailAssociation/osrd/blob/dev/docker/docker-compose.pr-test.yml).

0 comments on commit 67029a0

Please sign in to comment.