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

Incorrect Priority of CROWDIN_PROJECT_ID Environment Variable Over project_id in crowdin.yml #839

Closed
censoredp opened this issue Sep 9, 2024 · 0 comments · Fixed by #843

Comments

@censoredp
Copy link

Describe the bug
When both the project_id key is specified in crowdin.yml and the environment variable CROWDIN_PROJECT_ID is set, the environment variable takes precedence, even if the project_id_env key is not defined in the configuration. This results in a misleading error when the environment variable contains an invalid value.

To Reproduce
Steps to reproduce the behavior:

  1. Set a valid project_id in crowdin.yml.
  2. Set an environment variable with a non-numeric value, e.g., CROWDIN_PROJECT_ID=abcd.
  3. Run CLI command: crowdin lint
  4. Observe the error: "❌ Configuration file is invalid ... - Option 'project_id' must be a numeric value"

Expected behavior
The CROWDIN_PROJECT_ID environment variable should not be used unless the project_id_env key is explicitly set in crowdin.yml. The CLI should prioritize the project_id key from the configuration file in this case.

Environment:

  • OS: MacOS 14.16.1
  • Version 4.1.2 (installed via Homebrew)

Additional context
Our team has been using Crowdin since the early CLI versions. Some users still have alphanumeric project IDs set as environment variables, which causes confusion due to the misleading error.

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

Successfully merging a pull request may close this issue.

2 participants