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

Appearance settings

[TwigBundle] Add missing dev dependency to console #21246

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

Closed
wants to merge 1 commit into from

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Jan 12, 2017

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

Make Travis green again (related to #19440).

@dunglas dunglas changed the base branch from master to 2.7 January 12, 2017 14:09
@dunglas dunglas changed the base branch from 2.7 to 3.0 January 12, 2017 14:12
@dunglas dunglas force-pushed the fix_twigbundle_tests branch from e72544e to 33f30b7 Compare January 12, 2017 14:13
@dunglas dunglas changed the base branch from 3.0 to 3.1 January 12, 2017 14:15
@dunglas dunglas force-pushed the fix_twigbundle_tests branch from 33f30b7 to 66d5b57 Compare January 12, 2017 14:16
@@ -24,6 +24,7 @@
"twig/twig": "~1.28|~2.0"
},
"require-dev": {
"symfony/console": "~3.3",
Copy link
Member

Choose a reason for hiding this comment

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

TwigBundle 3.1 requiring Console 3.3 ? this looks wrong to me

Copy link
Member Author

@dunglas dunglas Jan 12, 2017

Choose a reason for hiding this comment

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

Only to run tests with the last version of FrameworkBundle (https://travis-ci.org/symfony/symfony/jobs/191309256). Another option is to make FrameworkBundle requiring console. (There is probably a better solution).

Copy link
Member

Choose a reason for hiding this comment

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

well, either FraneworkBundle should require it, or it should not be broken when the component is not installed. Otherwise it is a BC break in FrameworkBundle, and TwigBundle is the wrong place to fix it (all projects depending on FrameworkBundle would have to do the same, which is wrong)

Copy link
Member Author

@dunglas dunglas Jan 12, 2017

Choose a reason for hiding this comment

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

It was already the case for the templating component in 3.3. AFAIK we allow this kind of change (requiring to install a new dependency) and it's valid according to semver.

I'm not against adding Console as a hard dependency of FrameworkBundle, but I guess a goal of 3.3/Flex is to have less components installed by default when requiring framework-bundle. This change will go in the opposite direction.

Copy link
Member

Choose a reason for hiding this comment

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

the issue is that FrameworkBundle always registers the compiler pass coming from the component. So it means that the component is required. There is no point making the dependency optional in composer when it is only optional if you never use the bundle

Copy link
Member Author

@dunglas dunglas Jan 12, 2017

Choose a reason for hiding this comment

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

We can also duplicate the code of this helper in the component and in the bundle, but I'm not sure it's worth it.

Copy link
Member

Choose a reason for hiding this comment

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

The discussion in the PR talked about skipping the compiler pass when the component compiler pass class does not exist.
Registering the compiler pass for console commands is useless if you don't have the console component anyway. The only case needing to take care is people using console without the pass in it, but this is solved easily by making FrameworkBundle conflict with symfony/console < 3.3.

As long as you don't skip the registration, it is a mandatory requirement

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, your proposal is way better. See #21248. Closing this one.

@dunglas dunglas closed this Jan 12, 2017
fabpot added a commit that referenced this pull request Jan 12, 2017
…ent isn't installed (dunglas)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Prevent an error when the console component isn't installed

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21246
| License       | MIT
| Doc PR        |n/a

Finish #19443. Alternative to #21246.

Commits
-------

ab133ca [FrameworkBundle] Prevent an error when the console component isn't installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.