Problem/Motivation

Another simple case where we can remove 186 entries from the baseline.

Steps to reproduce

Proposed resolution

Add return types to BasicAuthResourceTestTrait and any child implementations.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3581427

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Lets do it! Pretty simple review

Think it would be nice to get these trait return types in before we bump phpstan btw, just to reduce size.

amateescu’s picture

Status: Reviewed & tested by the community » Needs work

sivaji_ganesh_jojodae made their first commit to this issue’s fork.

sivaji_ganesh_jojodae’s picture

Status: Needs work » Needs review

Done rebasing from UI.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems @longwave may have done the rebase that resolved the conflict if you’re saying the rebase worked through the UI.

godotislate’s picture

Status: Reviewed & tested by the community » Needs review

One question: The IS says, "Another simple case where we can remove 186 entries from the baseline," but there are no baseline changes here?

I'd expect to see something like this removed:

$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\Tests\\\\block\\\\Functional\\\\Rest\\\\BlockJsonBasicAuthTest\\:\\:assertAuthenticationEdgeCases\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/block/tests/src/Functional/Rest/BlockJsonBasicAuthTest.php',
];
amateescu’s picture

It was definitely there at some point, see https://git.drupalcode.org/project/drupal/-/merge_requests/15204/diffs?c..., but I think it was lost in of the rebases..

smustgrave’s picture

Wouldn't phpstan be failing now?

godotislate’s picture

Yes, the PHPStan job should fail. It's strange.

godotislate’s picture

Status: Needs review » Needs work

Back to NW to look into the PHPStan thing.

oily’s picture

Re: #9 to #13, There seem to be 2x MR's authored by @longwave with the same ID but containing different commit ID's?

Looking at this:
https://git.drupalcode.org/project/drupal/-/merge_requests/15204/diffs?c...

It seems that the 1 change which is in fact 186 individual deletions from the phpstan baseline file in commit c3dd89662e88cac08f070df0e487ec14a4701837 resulted from the regeneration of the phpstan baseline file after the 2x commits a7652b7de19013534f601161fe3f87bb032e3e34 and 56105c88131259bace36bbfe142a77ab811479f4 were made in other files.

Normally the 'Changes' tab would reveal the 'changes' made to all 3x files, not just 2x files.

This is confusing to me, but could it be that this is how the Gitlab pipelines are configured (recently?) to handle commits that affect the phpstan baseline? Something like, MR commits add return types, the newly added return types trigger a phpstan baseline regeneration done by the pipeline and the pipeline creates a commit for the new phpstan-baseline.php? So manual deletions from the .phpstan-baseline.php file are no longer necessary? And it is no longer necessary to commit the .phpstan-baseline.php file?

Please pardon the groping around in ignorance, hoping to shed a sliver of light on something.

godotislate’s picture

Rebased again and PHPStan did not fail either. This really is strange.

oily’s picture

Re: #14

There seem to be 2x MR's authored by @longwave with the same ID but containing different commit ID's?

I take that back. There is only 1 MR.

oily’s picture

Re: #15, Not sure if this helps explain that, but commit c3dd89662e88cac08f070df0e487ec14a4701837 seems to be committed in the MR so the 186 removals from the .phpstan-baseline.php file are in the MR. I opened the Web IDE for the MR and searched for one of the 186 deletions. Not found. So is commit c3dd89662e88cac08f070df0e487ec14a4701837 present but hidden in the MR?

oily’s picture

If you go here:

https://git.drupalcode.org/project/drupal/-/merge_requests/15204/diffs?c...

Then click on 'Show latest version' button. You then seem to be in the same MR but with only the 2 commits. You lose commit c3dd89662e88cac08f070df0e487ec14a4701837.

mstrelan’s picture

Actually this is expected. The methods extend from ResourceTestBase where they have @return void since #3575324: Add return type documentation to ResourceTestBase

Probably we don't need to proceed with this issue, or we can commit as is.

oily’s picture

Status: Needs work » Needs review
godotislate’s picture

Status: Needs review » Reviewed & tested by the community

#19: Ah good catch, didn't realize that those lines in the baseline had already been removed.

  • godotislate committed 94344965 on main
    chore: #3581427 Add return types to BasicAuthResourceTestTrait
    
    By:...
godotislate’s picture

Status: Reviewed & tested by the community » Fixed

Since #3575324: Add return type documentation to ResourceTestBase only went into main, this will only go into main.
Committed 9434496 and pushed to main. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.