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

[DependencyInjection] Added optionignore_errors: not_found for imported config files#31310

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

@pulzarraider
Copy link
Contributor

@pulzarraiderpulzarraider commentedApr 28, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PRsymfony/symfony-docs#11647

If someone want to add optional config file. The only available choice was to addignore_errors: true option

e.g.

imports:    - { resource: parameters.yml, ignore_errors: true }

But this will hide all errors in imported file. We ran in many situations that broke our Symfony applications because we had a typo in this imported files.

This PR introduce new possible valuenot_found forignore_errors option. It can be used for optional config files like theignore_errors: true, but it will ignore only the file non-existence, not the possible syntax errors inside.

Usage:

imports:    - { resource: parameters.yml, ignore_errors: not_found}

ro0NL, Taluu, Koc, sstok, jvasseur, apfelbox, and auipga reacted with thumbs up emoji
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the PR, it looks like a good idea to me.
About the implementation, I made my review into a patch, seepulzarraider#1

@pulzarraiderpulzarraider changed the title[Config] [DependencyInjection] [Routing] Added optionignore_not_found for imported config filesWIP [Config] [DependencyInjection] [Routing] Added optionignore_not_found for imported config filesApr 30, 2019
@pulzarraiderpulzarraider changed the titleWIP [Config] [DependencyInjection] [Routing] Added optionignore_not_found for imported config files[WIP] [Config] [DependencyInjection] [Routing] Added optionignore_not_found for imported config filesApr 30, 2019
@pulzarraiderpulzarraiderforce-pushed theconfig_ignore_not_found branch 6 times, most recently fromc7916cf to9c7fc7bCompareMay 4, 2019 06:18
@pulzarraiderpulzarraiderforce-pushed theconfig_ignore_not_found branch 3 times, most recently from6632ba8 to8ecb133CompareJune 3, 2019 02:01
@pulzarraiderpulzarraider changed the base branch frommaster to4.4June 3, 2019 02:06
@pulzarraiderpulzarraider changed the base branch from4.4 tomasterJune 3, 2019 02:06
@pulzarraiderpulzarraiderforce-pushed theconfig_ignore_not_found branch from8ecb133 toecc0e7eCompareJune 3, 2019 02:21
@pulzarraiderpulzarraider changed the title[WIP] [Config] [DependencyInjection] [Routing] Added optionignore_not_found for imported config files[Config] [DependencyInjection] [Routing] Added optionignore_not_found for imported config filesJun 3, 2019
@pulzarraider
Copy link
ContributorAuthor

Thank you@nicolas-grekas, I've merged your MR and did some more small improvements.

@OskarStark
Copy link
Contributor

@pulzarraider If I am correct, this must now go into4.4 branch, could you please switch the target branch for this PR?

I already did this for the corresponding Docs-PRsymfony/symfony-docs#11647

@pulzarraiderpulzarraider changed the base branch frommaster to4.4September 27, 2019 21:02
@pulzarraiderpulzarraiderforce-pushed theconfig_ignore_not_found branch 5 times, most recently fromdee7d76 tocddf68cCompareSeptember 28, 2019 20:13
@pulzarraider
Copy link
ContributorAuthor

I think this feature is finished.@nicolas-grekas@stof@sstok please review it again.
I hope it will be added in sf 4.4.

@nicolas-grekasnicolas-grekas modified the milestones:next,4.4Oct 27, 2019
@nicolas-grekasnicolas-grekas changed the title[Config] [DependencyInjection] [Routing] Added optionignore_not_found for imported config files[DependencyInjection] Added optionignore_errors: not_found for imported config filesNov 7, 2019
@nicolas-grekasnicolas-grekasforce-pushed theconfig_ignore_not_found branch 3 times, most recently from18c039e to419a9b5CompareNovember 7, 2019 10:58
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment
edited
Loading

Choose a reason for hiding this comment

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

I've rebased the PR and changed the logic to make it local to the DI component only.

(fabbot failure is unrelated - patch to be applied globally starting from 3.4)

@pulzarraider
Copy link
ContributorAuthor

Thank you@nicolas-grekas for your changes.

@nicolas-grekas
Copy link
Member

Thank you@pulzarraider.

nicolas-grekas added a commit that referenced this pull requestNov 8, 2019
…_found` for imported config files (pulzarraider)This PR was merged into the 4.4 branch.Discussion----------[DependencyInjection] Added option `ignore_errors: not_found` for imported config files| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        |symfony/symfony-docs#11647If someone want to add optional config file. The only available choice was to add `ignore_errors: true` optione.g.```imports:    - { resource: parameters.yml, ignore_errors: true }```But this will hide all errors in imported file. We ran in many situations that broke our Symfony applications because we had a typo in this imported files.This PR introduce new possible value `not_found` for `ignore_errors` option. It can be used for optional config files like the `ignore_errors: true`, but it will ignore only the file non-existence, not the possible syntax errors inside.Usage:```imports:    - { resource: parameters.yml, ignore_errors: not_found}```Commits-------e0ee01c [DependencyInjection] Added option `ignore_errors: not_found` while importing config files
@nicolas-grekasnicolas-grekas merged commite0ee01c intosymfony:4.4Nov 8, 2019
@pulzarraiderpulzarraider deleted the config_ignore_not_found branchNovember 8, 2019 10:59
This was referencedNov 12, 2019
wouterj added a commit to symfony/symfony-docs that referenced this pull requestOct 4, 2020
…_found` for imported config files (pulzarraider)This PR was merged into the 4.4 branch.Discussion----------[DependencyInjection] Added option `ignore_errors: not_found` for imported config files<!--If your pull request fixes a BUG, use the oldest maintained branch that containsthe bug (seehttps://symfony.com/roadmap for the list of maintained branches).If your pull request documents a NEW FEATURE, use the same Symfony branch wherethe feature was introduced (and `master` for features of unreleased versions).-->Related merge request:symfony/symfony#31310Commits-------0a6873d [Configuration] Add documentation about `ignore_errors: not_found` option.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@stofstofAwaiting requested review from stof

+1 more reviewer

@sstoksstoksstok requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

7 participants

@pulzarraider@OskarStark@sstok@javiereguiluz@nicolas-grekas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp