Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FrameworkBundle][TranslationDebug] Return non-zero exit code on failure#29139

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

DAcodedBEAT
Copy link
Contributor

@DAcodedBEATDAcodedBEAT commentedNov 8, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRTBD

This PR introduces non-zero exit codes upon failure for thedebug:translations command. The addition can be useful for projects which wish to determine results easily in CI.

The exit code returned can be interpreted as a bit array and to determine what failed, one could Bitwise AND the returned exit code to determine what failed.

Exit Codes:

Failure Reasonbit arrayinteger
General Failure (i.e no translations at all)100000064
Missing Translations100000165
Unused Translations100001066
Fallback Translations100010068

Example: Given there are missing and unused translations, the expected status code would beTranslationDebugCommand::EXIT_CODE_MISSING | TranslationDebugCommand::EXIT_CODE_UNUSED, which would be evaluated to67.

@DAcodedBEAT
Copy link
ContributorAuthor

DAcodedBEAT commentedNov 13, 2018
edited
Loading

Hi everyone! First time symfony contributor here. It’d be super swell to get this merged in. What do I need to do to get some code review for this?

@DAcodedBEAT
Copy link
ContributorAuthor

DAcodedBEAT commentedNov 20, 2018
edited
Loading

@nicolas-grekas@fabpot what should I do to expedite the process of merging this in?

zbtnot reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

We're in feature freeze finalizing version 4.2. we'll start merging new features again in two to three weeks (after/during SymfonyCon Lisbon I'd say.)
Thanks for your patience.

DAcodedBEAT and zbtnot reacted with thumbs up emoji

@@ -81,6 +84,7 @@ protected function configure()
new InputOption('only-missing', null, InputOption::VALUE_NONE, 'Displays only missing messages'),
new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Displays only unused messages'),
new InputOption('all', null, InputOption::VALUE_NONE, 'Load messages from all registered bundles'),
new InputOption('strict', null, InputOption::VALUE_OPTIONAL, 'Returns a non-zero exit code upon failure', false),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

at first, the description made me think this was a boolean option.
what about--fail-on-missing etc (would be more flexible also)?

@fabpot
Copy link
Member

Not a big fan of adding a new flag for that. I think not returning a non-zero exit code was a mistake and should be done without a flag.

@DAcodedBEATDAcodedBEATforce-pushed thedebug_translation_add_strict_option branch from0e4e925 toed56b0dCompareMarch 6, 2019 13:18
@DAcodedBEAT
Copy link
ContributorAuthor

Hello@fabpot and@nicolas-grekas! Apologies for the delay. Originally I thought it was silly to not return a non-zero exit code by default as well, but then I realized that this command could be used for fallback messages. Because of this, knowing when to return a non-zero status code could be difficult (e.g. should the command return a non-zero exit code due to missing a localized translation or should it return a successful zero exit code because a fallback could be used instead).

When initially writing the this PR, I pulled inspiration from composer's outdated command and the ability to increase verbosity levels in numerous commands (-v vs-vvv), but I could definitely be convinced to pivot to an alternative. 🙂

@DAcodedBEATDAcodedBEATforce-pushed thedebug_translation_add_strict_option branch 2 times, most recently frome1b45e9 to990dbc0CompareMay 28, 2019 16:55
@fabpot
Copy link
Member

I still think that this should not be configurable via an option. The return code could be different based on the kind of errors though.

DAcodedBEAT reacted with thumbs up emoji

@DAcodedBEATDAcodedBEATforce-pushed thedebug_translation_add_strict_option branch from990dbc0 to3a9f7c3CompareJuly 11, 2019 11:18
@DAcodedBEATDAcodedBEAT changed the title[FrameworkBundle][TranslationDebug] add strict option[FrameworkBundle][TranslationDebug] Return non-zero exit code on failureJul 11, 2019
@DAcodedBEAT
Copy link
ContributorAuthor

@fabpot I have changed this PR to return a non-zero exit code on failure. Can you please re-review this?
@nicolas-grekas Given these turn of events, would you still want these--fail-on-* options added to this PR?

Thank you both for your feedback 🙂

@fabpot
Copy link
Member

@DAcodedBEAT Still interested in finishing this PR?

@DAcodedBEATDAcodedBEATforce-pushed thedebug_translation_add_strict_option branch from3a9f7c3 to3dfcc8eCompareJanuary 30, 2020 04:45
@DAcodedBEAT
Copy link
ContributorAuthor

Hello@fabpot! Sorry for the delay. Yes, I am still interested in finishing this Pull Request! I have pushed up the changes requested. Thank you for the reminder! 🙂

@DAcodedBEATDAcodedBEATforce-pushed thedebug_translation_add_strict_option branch from3dfcc8e toe50ecfbCompareJanuary 31, 2020 01:59
@fabpot
Copy link
Member

Thank you@DAcodedBEAT.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@fabpotfabpotfabpot approved these changes

@Conan-KudoConan-KudoConan-Kudo approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

5 participants
@DAcodedBEAT@nicolas-grekas@fabpot@Conan-Kudo@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp