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] Add service and alias deprecation message to debug:container <name> output#46814

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
fabpot merged 1 commit intosymfony:6.2from94noni:debug-container-deprecated
Jul 21, 2022

Conversation

@94noni
Copy link
Contributor

@94noni94noni commentedJun 30, 2022
edited
Loading

QA
Branch?6.2
Bug fix?no
New feature?yes
Deprecations?no
Tickets.
LicenseMIT
Doc PR.

Hi, thedebug:container is great to understand container's services in the app

Having thisdeprecated warning can be valuable in such debug context, that is why I propose to add this on the output


For ex with such definition:

        ->set('url_helper', UrlHelper::class)            ->args([service('request_stack'),service('router.request_context')->ignoreOnInvalid(),            ])            ->deprecate('symfony/framework-bundle','6.2','The service "%service_id% is deprecated. Use "FooBarService" instead.')        ->alias(UrlHelper::class,'url_helper')            ->deprecate('symfony/framework-bundle','6.2','The alias "%alias_id% is deprecated. Use "FooBarAlias" instead.')

Capture d’écran 2022-07-05 à 10 39 03

Capture d’écran 2022-07-05 à 10 39 16

@94noni

This comment was marked as outdated.

@ogizanagi
Copy link
Contributor

What about showing the deprecation message as well?
Regarding the txt output, this could even be shown in a warning block.

94noni, GromNaN, and yceruto reacted with thumbs up emoji

@94noni
Copy link
ContributorAuthor

@ogizanagi it could indeed be a nice idea!

But as there are lot of test files to update, I would prefer asking first a consensus before doing the proposed change if you dont mind :)

Copy link
Member

@GromNaNGromNaN left a comment

Choose a reason for hiding this comment

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

That's a very useful information. I like the idea of colored warning in case of depreciation.

@94noni
Copy link
ContributorAuthor

@GromNaN@ogizanagi oki, I will try adding the deprecated message, and a colored output for when applicable

ogizanagi reacted with rocket emoji

@94noni94noniforce-pushed thedebug-container-deprecated branch 4 times, most recently fromf4ac1a4 to32562a8CompareJuly 4, 2022 08:18
@94noni
Copy link
ContributorAuthor

With new code changes, I can get such results (with faking a service deprecation)

Capture d’écran 2022-07-04 à 10 19 35

@ogizanagi
Copy link
Contributor

ogizanagi commentedJul 4, 2022
edited
Loading

@94noni : Sorry to make you change this again, I should have been clearer:
what about removing the info from the table output to show the deprecation message if the service is deprecated, using$io->warning() at the end of the command output?

HeahDude reacted with thumbs up emoji

@94noni
Copy link
ContributorAuthor

@ogizanagi hey, do you mean like in my screenshot and written above the ! [Note] but as warning?

if yes I can rework as requested :)

@ogizanagi
Copy link
Contributor

@94noni : exactly what I meant :)

94noni reacted with thumbs up emoji

@94noni94noniforce-pushed thedebug-container-deprecated branch 2 times, most recently from8e2d3cd to6a30629CompareJuly 5, 2022 08:43
@94noni
Copy link
ContributorAuthor

@ogizanagi@GromNaN PR reworked and description updated based on addressed comments :)

@chalasr
Copy link
Member

Looks good to me. Can you please go ahead with the missing test(s)?

@94noni
Copy link
ContributorAuthor

@chalasr The only failed test I can see in the above checks is about1) Symfony\Component\VarDumper\Tests\Server\ConnectionTest::testDump seem unrelated isn't it?

@chalasr
Copy link
Member

What I mean is that this feature should be covered by a test if possible

deprecated:
class:Symfony\Bundle\FrameworkBundle\Tests\Fixtures\DeprecatedClass
deprecated:The "%service_id%" service is deprecated since foo/bar 1.9 and will be removed in 2.0. Use "public" service instead.
deprecated_alias:
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

cfdoc

private_alias:
alias:public
public:false
deprecated:
Copy link
ContributorAuthor

@94noni94noniJul 6, 2022
edited
Loading

Choose a reason for hiding this comment

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

cfdoc +PR

@94noni94noniforce-pushed thedebug-container-deprecated branch fromcf6e55d toe9a5d5cCompareJuly 6, 2022 15:21
@94noni94noniforce-pushed thedebug-container-deprecated branch 6 times, most recently from4bb7984 to0f69408CompareJuly 8, 2022 08:00
@94noni
Copy link
ContributorAuthor

status: needs review

javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestJul 8, 2022
This PR was submitted for the 6.0 branch but it was merged into the 5.4 branch instead.Discussion----------Fix doc service deprecationHi,Based on [this PR](symfony/symfony#46814), I've followed [the doc](https://symfony.com/doc/current/service_container/alias_private.html#deprecating-services)But when tests executed, I got [this error](symfony/symfony#46814 (comment))So I propose to fix the doc accordingly hereThank youCommits-------ffdb7e6 Fix documentation on declaration of service deprecation in YAML format
@94noni
Copy link
ContributorAuthor

With#38903 being recently merged there are lot of conflicts
May I ask from reviewers another round of reviews on the core code, before taking time to fix all tests conflicts?
thanks :)

@fabpot
Copy link
Member

@94noni Can you rebase this PR to get rid of the merge commit (that prevents me from merging this PR)?

@94noni
Copy link
ContributorAuthor

@fabpot I'll handle this very soon and ping back

@94noni94noniforce-pushed thedebug-container-deprecated branch 2 times, most recently fromeb6b62e to5a93272CompareJuly 21, 2022 06:58
@94noni94noni changed the title[FrameworkBundle] Add service deprecation on debug:container command output[FrameworkBundle] Add service and alias deprecation message to debug:container <name> outputJul 21, 2022
@94noni94noniforce-pushed thedebug-container-deprecated branch from5a93272 to82054bcCompareJuly 21, 2022 07:34
@fabpot
Copy link
Member

Thank you@94noni.

94noni reacted with thumbs up emoji

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

Reviewers

@GromNaNGromNaNGromNaN left review comments

@chalasrchalasrchalasr left review comments

@stofstofstof requested changes

@fabpotfabpotfabpot approved these changes

+1 more reviewer

@ogizanagiogizanagiogizanagi left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

7 participants

@94noni@ogizanagi@chalasr@fabpot@GromNaN@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp