Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

chore: improve local DX #9

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Tchoupinax
Copy link
Contributor

@Tchoupinax Tchoupinax commented Jan 6, 2024

Hey!

This work improves the developer experience to start the project locally:

  • Apps are launched into containers (all is done with docker-compose up)
  • Database migrations are done externally, not at the start of the app, because I guess it's a better practice (feel free to challenge it)
  • Backend's build is fixed

I have an issue about loading the config in the container but maybe you could help me on this:

backend-1       | error: failed to parse value from --config argument `/app/exemples/config.yaml` as a dotted key expression
backend-1       | 
backend-1       | Caused by:
backend-1       |   TOML parse error at line 1, column 1
backend-1       |     |
backend-1       |   1 | /app/exemples/config.yaml
backend-1       |     | ^
backend-1       |   invalid key

Edit: tested on Linux AMD64 environment, maybe on MacOS the docker compose's behaviour would be different
Thanks and have a nice day!

backend/src/main.rs Outdated Show resolved Hide resolved
@evoxmusic
Copy link
Contributor

Thanks for the PR. I really appreciate it.

For the database initialization. I'd stick to letting the app manage properly to rollout database migrations (like this). It can be improved, and it's quite basic today. Still, I'd like to avoid asking users to do manual actions to start using Torii and ultimately upgrading it. The upgrades can be adequately handled by sequentially applying database changes. (cf my shared article with Flyway). WDYT?

@Tchoupinax
Copy link
Contributor Author

Tchoupinax commented Jan 8, 2024

Hey @evoxmusic,
Doing migrations in the app itself has its cons and pros, from the deployment POV it has cons (pod replica count, pod readyness delay) but your argue about having a plug-and-play product is correct. Let's prefer this for the moment.

Edit: I will fix the MR and resubmit again

@evoxmusic
Copy link
Contributor

Thx @Tchoupinax 🙏🏽 - let's propose maybe two ways at some point. An automatic way and a much more safer/manual way if it makes sense.

Copy link

gitguardian bot commented Jul 24, 2024

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
10273821 Triggered Generic Password 34deeb8 docker-compose-dev.yaml View secret
10273821 Triggered Generic Password 27689af docker-compose.dev.yaml View secret
10273821 Triggered Generic Password 8fbeda1 docker-compose.dev.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@Tchoupinax
Copy link
Contributor Author

Hello @evoxmusic,
I come back since the last time and now I started doing a feature I know well what to expect.

This merge request brings a edited docker compose to wake development environment with reloading on file changes (frontend is instant with vite, backend is just triggering a new compilation, that's said, you don't have to think about it! :) )

Another bonus is the usage of Tilt, that I love.

I hope it meets expectations!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants