crowdin-cli icon indicating copy to clipboard operation
crowdin-cli copied to clipboard

Add option to "status" command to return error code if not fully translated/approved

Open awmottaz opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I want to use the Crowdin CLI in my CI pipeline. I want the CI step to fail if the current branch is not fully translated yet, so that only fully translated texts can be merged back to main.

Describe the solution you'd like

I would like a new option added to the status command that will cause it to exit with an error code if the translated or approved status is not 100%. For example:

$ crowdin status -b my-branch --fail-if-incomplete
✔️  Fetching project info     
Translated:
        - pt-BR: 66%
Approved:
        - pt-BR: 66%
❌ Not 100% translated
❌ Not 100% approved

Describe alternatives you've considered

I have considered parsing the command output to determine this manually.

Additional context

It would be helpful if the Using CLI in CI guide could be expanded with examples for how to verify the status of translations and prevent merging until either the Translated or Approved status is 100% complete.

awmottaz avatar May 03 '22 19:05 awmottaz

Hi @awmottaz, thanks a lot for the suggestion!

I would suggest adding this option to the subcommands also:

# fails if translation or proofreading progress is not 100%
crowdin status --fail-if-incomplete

# fails if translation progress is not 100%
crowdin status translation --fail-if-incomplete

# fails if proofreading progress is not 100%
crowdin status proofreading --fail-if-incomplete

In my opinion, It would be enough to finish the command with the correct exit code (1) and output the typical CLI message in this case - error.execution_contains_errors

andrii-bodnar avatar May 04 '22 06:05 andrii-bodnar