Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww created an issue. See original summary.

jyotimishra-developer’s picture

Assigned: Unassigned » jyotimishra-developer
jyotimishra-developer’s picture

Assigned: jyotimishra-developer » Unassigned
jyotimishra-developer’s picture

Hi @dww, Hoping you are safe in the coronavirus pandemic!!
could you please elaborate, what exactly needs to be done here?
Thanks!!

dww’s picture

Hi @jyotimishra123, thanks for the well-wishing! Indeed, I'm safe and well, blessed be. Hope you're safe, too (both from the pandemic and
Cyclone Amphan (if you're anywhere near that)).

What needs to happen is to run phpcs on core/lib/Drupal/Core/Database/Install/Tasks.php:

phpcs --standard=Drupal core/lib/Drupal/Core/Database/Install/Tasks.php

FILE: ...MAMP-common/htdocs/drupal-9_1/core/lib/Drupal/Core/Database/Install/Tasks.php
-----------------------------------------------------------------------------------
FOUND 6 ERRORS AND 4 WARNINGS AFFECTING 9 LINES
-----------------------------------------------------------------------------------
 119 | ERROR   | Return type missing for @return tag in function comment
 186 | WARNING | Line exceeds 80 characters; contains 85 characters
 191 | WARNING | Only string literals should be passed to t() where possible
 194 | WARNING | Only string literals should be passed to t() where possible
 194 | ERROR   | If the line declaring an array spans longer than 80 characters,
     |         | each element should be broken into its own line
 227 | ERROR   | Missing parameter type
 230 | ERROR   | Return type missing for @return tag in function comment
 322 | ERROR   | Missing parameter type
 325 | ERROR   | Return type missing for @return tag in function comment
 345 | WARNING | Only string literals should be passed to t() where possible
-----------------------------------------------------------------------------------

and add good PHPDocs for all of these referring to comments. This patch will probably be able to be backported all the way to 8.8.x. Remember that "array" is almost never a good type for the docs, and you'll want something more specific like "string[]" (as appropriate).

The t() stuff would have to be a separate issue, since that'd be a string change and only 9.1.x at this point. Not sure if that should be a single issue, or if there's a wider effort to solve that across core that would be a more appropriate scope. You could search for something like that, and open a follow-up if not.

Not sure if "array spans longer than 80 characters..." is in scope here or not. Better to leave it out for now and focus on comment-only-changes.

Thanks!
-Derek

Ramya Balasubramanian’s picture

Assigned: Unassigned » Ramya Balasubramanian
Ramya Balasubramanian’s picture

Assigned: Ramya Balasubramanian » Unassigned
Manisha111’s picture

nitesh624’s picture

Assigned: Unassigned » nitesh624
nitesh624’s picture

nitesh624’s picture

Assigned: nitesh624 » Unassigned
Status: Active » Needs review
dww’s picture

Cool, thanks. That's a good start!

I pulled in some of the other changes from the interdiff at #3135629-42: Minimum MySQL version requirement is not confirmed when upgrading existing sites from Drupal 8 to Drupal 9 that weren't addressed.

Also did a pass through the whole file and did some other cleanups:

- Using an active verb for each phpdoc summary (e.g. "Checks" not "Check").
- Tried to keep the summaries under 80 chars.
- Added yet more missing docs (not sure why phpcs didn't flag all of these).
...

Also, thanks to #3109534: Raise the minimum MySQL version to 5.7.8 and MariaDB version to 10.2.7 in Drupal 9, this issue now needs separate patches for 9.y.x branches vs. 8.9.x branch.

nitesh624’s picture

hi @dww thanks for quick review. what will be the next step should i take in this issue. please guide me

dww’s picture

Hi @nitesh624,

At this point, neither of us are really qualified to RTBC the issue, since we've both contributed to the patch.

Your next steps could include:

A) Carefully review my changes from #12 and make sure they're all set (no typos, code standards are right, new docs are accurate, clear, concise, etc.) If you find any problems, either fix them yourself or comment here to discuss and we can decide who will fix them. You could also review the issue summary to make sure it's complete and accurate. These are things core committers appreciate before being asked to review something.

B) If #12 and the issue overall seem totally done to you, you could try to find someone else to review/RTBC this:
- Co-workers?
- Other folks you have a connection to (local user group, friends, random contributors you've worked with on other issues and have a bond, etc).
- Offer to do a "review trade" where you'll review someone else's patch and they'll review this. The #contribute and #patch-review channels on Slack can be good places to make such an offer.

That's about all you can do at this point.

Thanks!
-Derek

jyotimishra-developer’s picture

Assigned: Unassigned » jyotimishra-developer

Assigning my self to test

jyotimishra-developer’s picture

Hi @dww,
I have reviewed the patch in #12, it applied successfully in both versions of Drupal instance.
But when i ran PHPCS, there were still some warning present, therefore i updated the patch.
Thnks!!

jyotimishra-developer’s picture

can anyone tell me, how to run test cases of this 3136388-16.9_y_x.patch against drupal 9 version?

nitesh624’s picture

Thanks @jyotimishra123 to run test against D9 dev release
Click on "Add test / retest" link below the patch and select "custom parameters" and select appropriate parameters from dropdown

and for #16 can you please provide inderdiff file(s).

The last submitted patch, 16: 3136388-16.8_9_x.patch, failed testing. View results

jyotimishra-developer’s picture

Hi @nitesh624, please find interdiff files.

jyotimishra-developer’s picture

Assigned: jyotimishra-developer » Unassigned
dww’s picture

@jyotimishra123: Thanks for trying to move this forward. However, as I wrote at #5:

The t() stuff would have to be a separate issue, since that'd be a string change and only 9.1.x at this point. Not sure if that should be a single issue, or if there's a wider effort to solve that across core that would be a more appropriate scope. You could search for something like that, and open a follow-up if not.

So let's not worry about trying to do anything along the lines of #16. This issue isn't about trying to fix all the PHPCS errors on this file, it's about the documentation only.

Hiding the new files. Reviews / RTBC should be based on #12 for now. Re-uploading so the testbot isn't confused.

Thanks,
-Derek

jyotimishra-developer’s picture

Hi @dww, Apologies!!!
Really missed out #5 comment about t() stuff.
Now I got it... as i said in #16 that the patches in #12 are working fine and looks good to me..
Thanks!!

quietone’s picture

Version: 8.9.x-dev » 9.4.x-dev
Category: Task » Bug report
Status: Needs review » Reviewed & tested by the community

This came up while working on coding standards issues.

The patch still applies to 9.4.x, changing version.

I applied the patch and read the documentation. The content looks correct to me and is an improvement. It is correcting faulty documentation so changing to a bug.

I also think this is ready.

dww’s picture

Issue tags: +Bug Smash Initiative

If it’s a bug, let’s smash it. 😉

alexpott’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed b5156d7b04f to 10.0.x and d2a903bbc31 to 9.4.x and 950da2e97f8 to 9.3.x. Thanks!

  • alexpott committed b5156d7 on 10.0.x
    Issue #3136388 by dww, jyotimishra-developer, nitesh624: Fix phpdocs in...

  • alexpott committed 950da2e on 9.3.x
    Issue #3136388 by dww, jyotimishra-developer, nitesh624: Fix phpdocs in...

  • alexpott committed d2a903b on 9.4.x
    Issue #3136388 by dww, jyotimishra-developer, nitesh624: Fix phpdocs in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.