Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2005 env joi validation #2014

Merged
merged 16 commits into from
Oct 28, 2024
Merged

2005 env joi validation #2014

merged 16 commits into from
Oct 28, 2024

Conversation

galethil
Copy link
Collaborator

@galethil galethil commented Oct 7, 2024

Checklist

  • I have followed (at least) the PR section of the contributing guide.
  • I fixed all necessary PR warnings
  • The commit history is clean
  • The E2E tests are passing
  • If possible, the issue has been divided into more subtasks
  • I did a self review before requesting a review from another team member

Description

How to test

  1. Validate new generated docs for env vars
  2. Incorrectly set variables and try to start TruBudget - it should fail
  3. When setting env vars incorrectly the proper error message should be displayed in descriptive way
  4. Try copy of env_example file to .env. App should start directly or only the essential variables should be missing.

Closes #2005

Copy link

github-actions bot commented Oct 7, 2024

Warnings
⚠️ No CHANGELOG added.

Generated by 🚫 dangerJS against 11c017e

@galethil galethil changed the title WIP 2005 env joi validation 2005 env joi validation Oct 21, 2024
@openkfwCI
Copy link

openkfwCI commented Oct 21, 2024

NotesTime
Note for Reviewer: E2E tests on pipeline 60666 on remote server succeededThu, 24 Oct 2024 16:12:16 +0000

Generated by E2E-Test

@galethil galethil marked this pull request as ready for review October 21, 2024 08:20
@SamuelPull SamuelPull self-requested a review October 21, 2024 08:36
@SamuelPull
Copy link
Collaborator

SamuelPull commented Oct 21, 2024

If you don't have images built or pulled locally beforehand, it's not possible to start TruBudget.

Prerequisite: Delete images and containers

  • sh scripts/development/start-dev.sh --slim fails with INFO: Validating environment variables for alpha-node service ... ERROR: Unexpected error occurred while validating environment variables for alpha-node service. Unable to find image 'trubudget-dev-alpha-node:latest' locally docker: Error response from daemon: pull access denied for trubudget-dev-alpha-node, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'.

Apparently it's trying to pull trubudget-dev-alpha-node:latest, but it shouldn't try to pull anything, dev script should build all images locally.

  • sh scripts/operation/start-trubudget.sh pulls the images and fails with INFO: Validating environment variables for alpha-node service ... ERROR: Unexpected error occurred while validating environment variables for alpha-node service. invalid argument "lpha-node" for "-a, --attach" flag: valid streams are STDIN, STDOUT and STDERR See 'docker run --help'.

Something is not parsed correctly, see "lpha-node".

https://www.shellcheck.net/ might be a good tool to help here.

@galethil galethil merged commit e037bf1 into main Oct 28, 2024
30 checks passed
@SamuelPull SamuelPull deleted the 2005-env-joi-validation branch October 29, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Joi validation of environment variables for all services
3 participants