This module provides a centralized way to define, manage, and expose global site configuration in Drupal, with first-class support for decoupled or headless architectures.

This module allows developers to define structured configuration groups via plugins, automatically generates an administration UI, and exposes the stored values through services and optional API endpoints (REST and JSON:API).

Project link

https://www.drupal.org/project/site_config

Comments

carlosmp created an issue. See original summary.

carlosmp’s picture

Issue summary: View changes
vishal.kadam’s picture

Title: [1.0.x] Site Configuration » [1.0.x] Site Configuration
Issue summary: View changes
avpaderno’s picture

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.

  • New releases are not necessary for these applications, which could require changes that are not backward-compatible. Not creating new releases avoids any possible issue.
  • Please do not change the branch to review once reviews started, except in the case the used branch needs to be deleted.
  • 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.

vishal.kadam’s picture

Status: Needs review » Needs work

1. master is a wrong name for a branch and should be removed. Release branch names always end with the literal .x as described in Release branches.

2. FILE: site_config.info.yml, modules/site_config_jsonapi/site_config_jsonapi.info.yml, modules/site_config_rest/site_config_rest.info.yml

package: Custom

This line is used by custom modules created for specific sites. It is not a package name used for projects hosted on drupal.org.

3. FILE: site_config.info.yml

core_version_requirement: ^9 || ^10 || ^11

FILE: modules/site_config_jsonapi/site_config_jsonapi.info.yml, modules/site_config_rest/site_config_rest.info.yml

core_version_requirement: ^9 || ^10

A new project should not declare itself compatible with a Drupal release that is no longer supported. No site should be using Drupal 8 nor Drupal 9, and people should not be encouraged to use those Drupal releases.

4. FILE: src/SiteConfigPluginBase.php, src/Service/SiteConfigService.php, modules/site_config_jsonapi/src/Resource/SiteConfigBaseResource.php

\Drupal::logger('site_config')->error($e->getMessage());

The $message parameter passed to the LoggerInterface methods must be a literal string that uses placeholders. It's not a translatable string returned from t()/$this->t(), a string concatenation, a value returned from a function/method, nor a variable containing an exception object.

5. Fix the warnings/errors reported by PHP_CodeSniffer.

Note: I would suggest enabling GitLab CI for the project, follow the Drupal Association .gitlab-ci.yml template and fix the PHP_CodeSniffer errors/warnings it reports.

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml site_config/

FILE: site_config/README.md
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 7 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------------
  3 | WARNING | [ ] Line exceeds 80 characters; contains 274 characters
  8 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
 10 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
 24 | WARNING | [ ] Line exceeds 80 characters; contains 115 characters
 28 | WARNING | [ ] Line exceeds 80 characters; contains 151 characters
 32 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
 45 | ERROR   | [ ] Missing short description in doc comment
 75 | WARNING | [ ] Line exceeds 80 characters; contains 169 characters
 75 | ERROR   | [x] Perl-style comments are not allowed; use "// Comment" instead
 77 | ERROR   | [x] Perl-style comments are not allowed; use "// Comment" instead
 79 | ERROR   | [x] Perl-style comments are not allowed; use "// Comment" instead
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/src/Form/SettingsForm.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------
  18 | ERROR | [ ] Missing short description in doc comment
  23 | ERROR | [ ] Missing short description in doc comment
  28 | ERROR | [ ] Missing short description in doc comment
  29 | ERROR | [x] Do not append variable name "$blockManager" to the type declaration in a member variable comment
  34 | ERROR | [ ] Missing short description in doc comment
  47 | ERROR | [x] Missing function doc comment
 108 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/src/SiteConfigPluginBase.php
--------------------------------------------------------------------------------
FOUND 20 ERRORS AND 5 WARNINGS AFFECTING 22 LINES
--------------------------------------------------------------------------------
  23 | ERROR   | [ ] Missing short description in doc comment
  28 | ERROR   | [ ] Missing short description in doc comment
  33 | ERROR   | [ ] Missing short description in doc comment
  38 | ERROR   | [ ] Missing short description in doc comment
  43 | ERROR   | [ ] Missing short description in doc comment
  48 | ERROR   | [ ] Missing short description in doc comment
  68 | ERROR   | [x] Missing function doc comment
  82 | ERROR   | [ ] Missing short description in doc comment
  83 | ERROR   | [ ] Description for the @return value is missing
  92 | ERROR   | [ ] Description for the @return value is missing
 128 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
 129 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 137 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 155 | WARNING | [ ] Line exceeds 80 characters; contains 94 characters
 156 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 181 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 198 | ERROR   | [x] Expected 1 space before "|"; 0 found
 198 | ERROR   | [x] Expected 1 space after "|"; 0 found
 210 | ERROR   | [x] Space after closing parenthesis of function call prohibited
 210 | ERROR   | [x] Space found before semicolon; expected ");" but found ") ;"
 218 | ERROR   | [x] Expected 1 space before "|"; 0 found
 218 | ERROR   | [x] Expected 1 space after "|"; 0 found
 228 | ERROR   | [x] Expected 1 blank line after function; 2 found
 240 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 275 | ERROR   | [x] Visibility must be declared on method "getOptions"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/src/SiteConfigInterface.php
--------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
 24 | ERROR | [x] Expected 1 blank line after function; 2 found
 51 | ERROR | [ ] Missing parameter comment
 53 | ERROR | [ ] Description for the @return value is missing
 55 | ERROR | [x] Expected 1 blank line after function; 2 found
 61 | ERROR | [ ] Missing parameter comment
 61 | ERROR | [ ] Missing parameter type
 63 | ERROR | [ ] Description for the @return value is missing
 65 | ERROR | [x] Visibility must be declared on method "getOptions"
 65 | ERROR | [x] Expected 1 blank line after function; 0 found
 66 | ERROR | [x] The closing brace for the interface must have an empty line before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/src/Service/SiteConfigService.php
--------------------------------------------------------------------------------
FOUND 21 ERRORS AND 4 WARNINGS AFFECTING 19 LINES
--------------------------------------------------------------------------------
   8 | ERROR   | [x] Missing class doc comment
  10 | ERROR   | [ ] Missing short description in doc comment
  15 | ERROR   | [ ] Missing short description in doc comment
  16 | ERROR   | [ ] Missing parameter comment
  25 | ERROR   | [ ] Description for the @return value is missing
  37 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  47 | ERROR   | [ ] Missing parameter comment
  49 | ERROR   | [ ] Description for the @return value is missing
  62 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  70 | ERROR   | [ ] Missing parameter comment
  70 | ERROR   | [ ] Missing parameter type
  71 | ERROR   | [ ] Missing parameter comment
  71 | ERROR   | [ ] Missing parameter type
  72 | ERROR   | [ ] Missing parameter comment
  72 | ERROR   | [ ] Missing parameter type
  74 | ERROR   | [ ] Description for the @return value is missing
  86 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  94 | ERROR   | [ ] Missing parameter comment
  94 | ERROR   | [ ] Missing parameter type
  95 | ERROR   | [ ] Missing parameter comment
  95 | ERROR   | [ ] Missing parameter type
  96 | ERROR   | [ ] Missing parameter comment
  96 | ERROR   | [ ] Missing parameter type
  98 | ERROR   | [ ] Description for the @return value is missing
 110 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/modules/site_config_rest/site_config_rest.install
--------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------------------------------------------------------------------
 1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
 2 | ERROR   | [x] You must use "/**" style comments for a file comment
 3 | ERROR   | [x] No space found before comment text; expected "// /**" but found "///**"
 6 | ERROR   | [x] No space found before comment text; expected "// function site_config_rest_uninstall() {" but found "//function site_config_rest_uninstall() {"
 8 | WARNING | [ ] There must be no blank line following an inline comment
 8 | ERROR   | [x] No space found before comment text; expected "// }" but found "//}"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/modules/site_config_rest/src/Plugin/rest/resource/SiteConfigItemResource.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 16 | ERROR | [x] Additional blank lines found at end of doc comment
 19 | ERROR | [x] Missing function doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/modules/site_config_rest/src/Plugin/rest/resource/SiteConfigListResource.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 16 | ERROR | [x] Additional blank lines found at end of doc comment
 19 | ERROR | [x] Missing function doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/modules/site_config_rest/src/Plugin/rest/resource/SiteConfigResourceBase.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------
 18 | ERROR | [x] Additional blank lines found at end of doc comment
 21 | ERROR | [ ] Missing short description in doc comment
 22 | ERROR | [x] Data types in @var tags need to be fully namespaced
 26 | ERROR | [ ] Parameter $siteConfigService is not described in comment
 80 | ERROR | [x] The abstract declaration must precede the visibility declaration
 80 | ERROR | [x] Missing function doc comment
 85 | ERROR | [ ] Missing parameter comment
 85 | ERROR | [ ] Missing parameter type
 87 | ERROR | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/modules/site_config_jsonapi/src/Resource/SiteConfigBaseResource.php
--------------------------------------------------------------------------------
FOUND 20 ERRORS AND 5 WARNINGS AFFECTING 23 LINES
--------------------------------------------------------------------------------
   5 | WARNING | [x] Unused use statement
  11 | WARNING | [x] Unused use statement
  12 | WARNING | [x] Unused use statement
  13 | WARNING | [x] Unused use statement
  30 | ERROR   | [ ] Missing short description in doc comment
  31 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  35 | ERROR   | [ ] Missing short description in doc comment
  40 | ERROR   | [ ] Missing short description in doc comment
  45 | ERROR   | [ ] Parameter $entityTypeManager is not described in comment
  48 | ERROR   | [ ] Missing parameter comment
  49 | ERROR   | [ ] Missing parameter comment
  82 | ERROR   | [x] The abstract declaration must precede the visibility declaration
  95 | ERROR   | [ ] Missing parameter comment
  97 | ERROR   | [ ] Description for the @return value is missing
 109 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 114 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 124 | ERROR   | [x] Expected newline after closing brace
 124 | ERROR   | [x] Use "elseif" in place of "else if"
 139 | ERROR   | [x] Expected 1 space after FUNCTION keyword; 0 found
 146 | ERROR   | [ ] Parameter $entity is not described in comment
 149 | ERROR   | [ ] Missing parameter comment
 149 | ERROR   | [ ] Doc comment for parameter $values does not match actual variable name $entity
 151 | ERROR   | [ ] Description for the @return value is missing
 166 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 173 | ERROR   | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/modules/site_config_jsonapi/src/Resource/SiteConfigItemResource.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 30 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 67 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/modules/site_config_jsonapi/src/Resource/SiteConfigListResource.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 65 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: site_config/modules/site_config_jsonapi/site_config_jsonapi.routing.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  6 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
 12 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
--------------------------------------------------------------------------------
carlosmp’s picture

I have applied all the requested changes.

vishal.kadam’s picture

Remember to change status, when the project is ready to be reviewed. In this queue, projects are only reviewed when the status is Needs review.

carlosmp’s picture

Status: Needs work » Needs review
carlosmp’s picture

Thanks! I have just changed the status.

vishal.kadam’s picture

Rest seems fine to me.

Please wait for other reviewers and Project Moderator to take a look and if everything goes fine, you will get the role.

carlosmp’s picture

Any news?

bbu23’s picture

Status: Needs review » Needs work

Hi,

I don't have time to do a proper review now, but I did notice a few things:

- There's no composer.json file defined. See Add a composer.json file for more info.

- You are providing a plugin using PHP Annotation, which is not recommended anymore. You should implement plugins as PHP Attributes instead of PHP Annotations as described in Attribute-based plugins.

- New modules, which are compatible with Drupal 10 and higher versions are expected to include type declarations in property definitions, and use property promotion. This should be applied to all class constructors.

- Use dependency injection for:

\Drupal::logger('site_config')
        ->error('The "storage" value must be one of the followings: status, config.');

- Comments like "Get value." as function description for "getValue()" are not relevant.

The minimum core version will have to be increased after applying these changes.

carlosmp’s picture

Status: Needs work » Needs review

I have applied all corrections:
- Add composer.json.
- Update README.md.
- Implement the plugin as PHP attributes.
- Use property promotion.
- Fix the dependency injection issue.
- Increase the minimum core version.

carlosmp’s picture

Any other issues?

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

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:

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 also all the reviewers for helping with these applications.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

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.

Status: Fixed » Closed (fixed)

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