- Issue created by @nicolasgraph
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Thank you for applying!
Please read Review process for security advisory coverage: What to expect โ for more details and Security advisory coverage application checklist โ to understand what reviewers look for. Tips for ensuring a smooth review โ gives some hints for a smoother review.
The important notes are the following.
- If you have not done it yet, enable GitLab CI for the project, and fix what reported from the phpcs job. This help to fix most of what reviewers would report.
- For the time this application is open, only your commits are allowed. No other people, including other maintainers/co-maintainers can make commits.
- The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application.
- Nobody else will get the permission to opt projects into security advisory policy. If there are other maintainers/co-maintainers who will to get that permission, they need to apply with a different module.
- We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.
To the reviewers
Please read How to review security advisory coverage applications โ , Application workflow โ , What to cover in an application review โ , and Tools to use for reviews โ .
The important notes are the following.
- It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
- Reviewers should show the output of a CLI tool โ only once per application. The configuration used for these tools needs to be the same configuration used by GitLab CI, stored in the GitLab Templates repository.
- It may be best to have the applicant fix things before further review.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues โ .
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
There a little bit more commits from solene_ggd, but I will accept this application.
- ๐ฎ๐ณIndia vishal.kadam Mumbai
1. FILE: guest_suite.info.yml
package: Custom
2. FILE: guest_suite.module
/** * @file * Guest suite module file. */
The usual description for a .module file is โHook implementations for the [module name] moduleโ, where [module name] is the module name given in the .info.yml file.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Is there anything else that needs to be changed. A comment and a project package to change are not sufficient for a review.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- The following points are just a start and don't necessarily encompass all of the changes that may be necessary
- A specific point may just be an example and may apply in other places
- A review is about code that does not follow the coding standards, contains possible security issue, or does not correctly use the Drupal API
- The single review points are not ordered, not even by importance
src/Form/ManualImportForm.php
/** * The module config. * * @var \Drupal\Core\Config\Config */ protected $config; /** * The messenger. * * @var \Drupal\Core\Messenger\MessengerInterface */ protected $messenger;
The
$messenger
property is already defined from the parent class. The$config
property is not necessary, since the parent class has the$configFactory
property. Check with methods the parent classes have, and which traits they use.src/Form/SettingsForm.php
$message = Markup::create( $this->t('An error occurred while requesting the API.') . '<br>' . $this->t('Please check <a href="@url" title="Guest Suite settings">your logs</a>.', ['@url' => $url] ));
This is minor, but the log link cannot have Guest Suite settings as title, since that is not the link for the module settings form.
$this->configFactory->getEditable(static::SETTINGS) ->set('access_token', $form_state->getValue('access_token')) ->set('cron_import', $form_state->getValue('cron_import')) ->save();
Since the parent class is
ConfigFormBase
, it is sufficient to call$this->config()
.src/Entity/ReviewInterface.php
/** * Sets the guest suite review title. * * @param string $title * The guest suite review title. * * @return \Drupal\guest_suite\Entity\ReviewInterface * The called guest suite review entity. */ public function setTitle($title): self;
In those cases, the return type hinting is
$this
.src/Cron.php
CronInterface
is the interface implemented by the class which invokes the cron tasks, not by cron tasks. That is the interface a class that replaces the cron service needs to implement; it is not otherwise used.src/ReviewViewBuilder.php
EntityViewBuilder
is not a base class and it cannot be used as parent class.src/ReviewWarningUrl.php
Similarly,
FieldItemList
is not a base class and it is not part of the public API. - ๐ซ๐ทFrance nicolasgraph Strasbourg
Thanks for your replies!
src/ReviewViewBuilder.php
EntityViewBuilder
is not a base class and it cannot be used as parent class.Could you give me a bit more explanation about this?
BlockViewBuilder
do extends this class for example.
CommerceLogViewBuilder
also uses it as parent.src/ReviewWarningUrl.php
Similarly, FieldItemList is not a base class and it is not part of the public API.PathFieldItemList do extend
FieldItemList
, and I can't see any@internal
annotation.
This documentation โ also gives an example of a computed field extending this class. - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Only Drupal core classes are allowed to extend a class that is not part of the public API. That is explained on Drupal core backend backwards compatibility and internal API policy โ .
- ๐ซ๐ทFrance nicolasgraph Strasbourg
Thanks for your prompt reply @avpaderno!
So I guess ReviewListBuilder.php should not extendEntityListBuilder
.
I'm a bit confused about the load of duplicate code needed to remove these parents classes.
Popular modules like Webform โ , Commerce โ or Paragraphs โ do extends the mentioned classes.
And most computed fields examples I find extends a core field class. - ๐ซ๐ทFrance nicolasgraph Strasbourg
I added a commit for comment #6 ๐ [1.x] Guest Suite Needs review and another for comment #10 ๐ [1.x] Guest Suite Needs review .
I intentionally did not "fix" the inheritance of classesEntityViewBuilder
,EntityListBuilder
andFieldItemList
. I'd be happy to see any documentation about how to do in a better way, if there is one. In the meanwhile, I sticks to usual practices used by many experienced maintainers. - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Thank you for your contribution and for your patience with the review process!
I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.
These are some recommended readings to help you with maintainership:
- Dries โ ' post on Responsible maintainers
- Maintainership โ
- Git version control system โ
- Issue procedures and etiquette โ
- Maintaining and responding to issues for a project โ
- Release naming conventions โ .
You can find more contributors chatting on Slack โ or IRC โ in #drupal-contribute. So, come hang out and stay involved โ !
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review โ . I encourage you to learn more about that process and join the group of reviewers.I thank the dedicated reviewers as well.