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

[Console] Completion version should not use application's version #44733

Closed
wouterj opened this issue Dec 20, 2021 · 4 comments · Fixed by #46901
Closed

[Console] Completion version should not use application's version #44733

wouterj opened this issue Dec 20, 2021 · 4 comments · Fixed by #46901
Labels

Comments

@wouterj
Copy link
Member

wouterj commented Dec 20, 2021

Symfony version(s) affected

5.4

Description

From #44729

However, this issue made me realize that we probably forgot about the standalone app usage when implementing --symfony.

This option is used to determine if the installed shell completion script is still compatible with the complete command in Symfony (e.g. if we add a feature in 6.1 that requires a modification of the bash script). However, we currently set it using $application->getVersion(). This means that we're no longer checking Symfony versions when it's used by e.g. PHPstan. I have no idea how we can set this to the real symfony/console version here.
Maybe we should use a custom version scheme for completion? (e.g. one that we increase manually, independently from Symfony releases, whenever we break/change something?)

Possible fixes:

From @GromNaN:

+1 for adding a completion version that is incremented only when there is a breaking change. Like composer does for plugins.

From @stof:

yeah. either that or we should use \Composer\InstalledVersions::getVersion('symfony/console') to get the version (but then, that will be a pain when using a dev version of symfony/console).

Let's investigate how hard dev versions are here. That seems the most simple solution here.

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@carsonbot
Copy link

Friendly reminder that this issue exists. If I don't hear anything I'll close this.

@stof
Copy link
Member

stof commented Jul 5, 2022

This one is still valid.

@wouterj do you plan to work on this ?

@wouterj
Copy link
Member Author

wouterj commented Jul 11, 2022

Proposed a fix: #46901

@fabpot fabpot closed this as completed Jul 15, 2022
fabpot added a commit that referenced this issue Jul 15, 2022
… (wouterj)

This PR was merged into the 6.2 branch.

Discussion
----------

[Console] Be explicit about the completion API version

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | yes
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #44733
| License       | MIT
| Doc PR        | n/a

Using the application version is wrong, especially for standalone apps like PHPStan. The completion API is not bound to change on a PHPStan version upgrade, but instead only when something in symfony/console changes.

I suggest having an explicit completion API version, that we can increase once we change something in the API (and thus require an update of the shell scripts).

Commits
-------

b19eb38 [Console] Be explicit about the completion API version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants