Code Monkey home page Code Monkey logo

scaffold-tooling's Introduction

GovCMS Scaffolding

A collection of standard config, scripts and packages to support GovCMS scaffold.

GitlabCI

scaffold-tooling's People

Contributors

ahmedjabar avatar alexskrypnyk avatar barbun avatar drupal-spider avatar fleetadmiralbutter avatar govhosting avatar joshua-graham-adelphi avatar kepol avatar larowlan avatar pandaskii avatar ruwanl avatar simesy avatar sonnykt avatar srowlands avatar steveworley avatar stooit avatar suhyeonh avatar yusufhm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scaffold-tooling's Issues

Redis can't be enabled locally (Lagoon not tested)

When starting a project using the govcms8-scaffold-paas template and enabling Redis (Setting ENABLE_REDIS='true' in docker-compose.yml &default-environment and uncommenting the service), there is a PHP error reported:

[govcms8-paas]cli-drupal:/app$ printenv | grep REDIS
ENABLE_REDIS=true
[govcms8-paas]cli-drupal:/app$ drush st
Error: Call to a member function addPsr4() on null in /app/vendor/govcms/scaffold-tooling/drupal/settings/lagoon.settings.php on line 89 #0 /app/web/sites/default/settings.php(54): include()
#1 /app/web/core/lib/Drupal/Core/Site/Settings.php(125): require('/app/web/sites/...')
#2 /app/web/core/lib/Drupal/Core/DrupalKernel.php(1073): Drupal\Core\Site\Settings::initialize('/app/web', 'sites/default', NULL)
#3 /app/web/core/lib/Drupal/Core/DrupalKernel.php(275): Drupal\Core\DrupalKernel->initializeSettings(Object(Symfony\Component\HttpFoundation\Request))
#4 /app/vendor/drush/drush/src/Boot/DrupalBoot8.php(220): Drupal\Core\DrupalKernel::createFromRequest(Object(Symfony\Component\HttpFoundation\Request), Object(Composer\Autoload\ClassLoader), 'prod', true)
#5 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(293): Drush\Boot\DrupalBoot8->bootstrapDrupalConfiguration(Object(Drush\Boot\BootstrapManager), NULL)
#6 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(493): Drush\Boot\BootstrapManager->doBootstrap(3, 6, NULL)
#7 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(427): Drush\Boot\BootstrapManager->bootstrapMax(6)
#8 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(396): Drush\Boot\BootstrapManager->bootstrapToPhaseIndex(-2, Object(Consolidation\AnnotatedCommand\AnnotationData))
#9 /app/vendor/drush/drush/src/Boot/BootstrapHook.php(28): Drush\Boot\BootstrapManager->bootstrapToPhase('max', Object(Consolidation\AnnotatedCommand\AnnotationData))
#10 /app/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(34): Drush\Boot\BootstrapHook->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#11 /app/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(27): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook(Object(Drush\Boot\BootstrapHook), Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#12 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(145): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#13 /app/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(289): Consolidation\AnnotatedCommand\CommandProcessor->initializeHook(Object(Drush\Symfony\DrushArgvInput), Array, Object(Consolidation\AnnotatedCommand\AnnotationData))
#14 /app/vendor/symfony/console/Command/Command.php(221): Consolidation\AnnotatedCommand\AnnotatedCommand->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /app/vendor/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /app/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /app/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /app/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /app/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /app/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#21 /app/vendor/drush/drush/includes/preflight.inc(18): require('/app/vendor/dru...')
#22 phar:///usr/local/bin/drush/bin/drush.php(141): drush_main()
#23 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#24 {main}
Error: Call to a member function addPsr4() on null in include() (line 89 of /app/vendor/govcms/scaffold-tooling/drupal/settings/lagoon.settings.php).
 [warning] Drush command terminated abnormally.

This points to the line adding the Redis classloader - https://github.com/govCMS/scaffold-tooling/blob/2.0.5/drupal/settings/lagoon.settings.php#L89

I've not dug too deep on this, but note that we've recently changed the setup for our drupal-example Redis failover that may provide a cleaner solution - amazeeio/drupal-example#70

Incorrect temporary path

The scaffold incorrectly sets the temporary path for Drupal in
https://github.com/govCMS/scaffold-tooling/blob/develop/drupal/settings/all.settings.php#L37

$settings['file_temporary_path'] = 'sites/default/files/private/tmp';

According to D8.8 changelog, the correct settings is file_temp_path, so the above line must be:

$settings['file_temp_path'] = 'sites/default/files/private/tmp';

Without setting the correct path, the temporary path fallbacks to /tmp it causes issues with exporting webform submissions.

Database dump error after recent update

> mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

Appears when using Drush10, resolved with --extra-dump=--no-tablespaces. Should be noted even with the error the dump appears to be created and valid.

Better output for 'ahoy ship-shape'

Running ahoy ship-shape results in a very long output that can be seen below

Executing /app/vendor/bin/govcms-validate-modules...
GovCMS Validate :: Verify enabled modules

GovCMS Prepare XML report
Successfully generated govcms-validate-modules.xml

[success]: All modules are in expected states
Executing /app/vendor/bin/govcms-validate-active-permissions...
GovCMS Validate :: Disallowed permissions on active site

GovCMS Prepare XML report
Successfully generated govcms-validate-active-permissions.xml

[success]: No elevated permissions detected in configuration.
Executing /app/vendor/bin/govcms-validate-tfa...
GovCMS Validate :: Validate TFA config
[info]: TFA is enabled
[info]: TFA is required for authenticated users

GovCMS Prepare XML report
Successfully generated govcms-validate-tfa.xml

[success]: TFA is enabled and properly configured
Executing /app/vendor/bin/govcms-validate-profile...
GovCMS Validate :: Validate install profile
[info]: config/default/core.extension.yml is using the 'govcms' profile

GovCMS Prepare XML report
Successfully generated govcms-validate-profile.xml

[success]: 'govcms' profile is in use
Executing /app/vendor/bin/govcms-validate-permissions...
GovCMS Validate :: Disallowed permissions
[info]: config/default/user.role.anonymous.yml is valid
[info]: config/default/user.role.authenticated.yml is valid
[info]: config/default/user.role.civictheme_content_approver.yml is valid
[info]: config/default/user.role.civictheme_content_author.yml is valid
[info]: config/default/user.role.civictheme_site_administrator.yml is valid

GovCMS Prepare XML report
Successfully generated govcms-validate-permissions.xml

[success]: No elevated permissions detected in configuration.
Executing /app/vendor/bin/govcms-validate-platform-yml...
GovCMS Validate :: Yaml lint platform files

                            
 [OK] All 1 YAML files contain valid syntax.                                    



 [OK] All 1 YAML files contain valid syntax.                                    



 [OK] All 1 YAML files contain valid syntax.                                    



 [OK] All 1 YAML files contain valid syntax.            
 
---------------------------------------------------
THIS REPEATS FOR 2000 LINES ON THE SITE WITH CONFIG                         
---------------------------------------------------

GovCMS Prepare XML report
Successfully generated govcms-validate-theme-yml.xml

[success]: No YAML issues in theme files.
Executing /app/vendor/bin/govcms-validate-active-tfa...
GovCMS Validate :: Validate TFA config on active site
[info]: TFA is enabled
[info]: TFA is required for authenticated users

GovCMS Prepare XML report
Successfully generated govcms-validate-active-tfa.xml

[success]: TFA is actively enabled and properly configured
Executing /app/vendor/bin/govcms-validate-active-profile...
GovCMS Validate :: Validate profile on active site
[success]: 'govcms' profile is in use
Executing /app/vendor/bin/govcms-validate-theme-modules...
GovCMS Validate :: Scan themes for modules
[info]: web/themes/contrib/adminimal_theme/adminimal_theme.info.yml is valid
[info]: web/themes/custom/custom/mytheme/mytheme.info.yml is valid
[info]: web/themes/custom/custom/myothertheme/myothertheme.info.yml is valid

GovCMS Prepare XML report
Successfully generated govcms-validate-prevent-theme-modules.xml

[success]: No modules detected.
Executing /app/vendor/bin/govcms-validate-illegal-files...
GovCMS Validate :: Illegal files

GovCMS Prepare XML report
Successfully generated govcms-illegal-files.xml

[success]: No illegal files.
Executing /app/vendor/bin/govcms-validate-active-modules...
GovCMS Validate :: Active modules validation

GovCMS Prepare XML report
Successfully generated govcms-validate-active-permissions.xml

[success]: All modules are in expected states
Executing /app/vendor/bin/govcms-validate-php-functions...
GovCMS Validate :: Banned PHP function list


 [OK] No errors                                                                 

Successfully generated govcms-validate-php-functions.xml
[success]: No banned function detected in code.
XML files have been generated at ./.ship-shape:
  .ship-shape//govcms-validate-platform.xml
  .ship-shape//govcms-validate-active-permissions.xml
  .ship-shape//govcms-validate-php-functions.xml
  .ship-shape//govcms-validate-modules.xml
  .ship-shape//govcms-validate-active-tfa.xml
  .ship-shape//govcms-illegal-files.xml
  .ship-shape//govcms-validate-profile.xml
  .ship-shape//govcms-validate-tfa.xml
  .ship-shape//govcms-validate-prevent-theme-modules.xml
  .ship-shape//govcms-validate-theme-yml.xml
  .ship-shape//govcms-validate-permissions.xml

During forklifts, this needs to be run over and over again, until the DB and config are in the good "shape".

Is it possible to:

  1. Batch the checking of config yamls and just print success/error at the end
  2. Add visual separation between completed and the next task - a new line or a separator.
  3. Have an overall status SUCCESS/FAILURE add at the end.

CLAMAV_MODE can never be set to 0

In settings.php:

$clam_mode = getenv('CLAMAV_MODE') ?: 1;

If CLAMAV_MODE has a value of 0 (MODE_DAEMON) - the $clam_mode will always be 1.

Allow to provide custom phpcs.xml file

When using SaaS, sometimes we need to use a base theme (placed into themes/THEMENAME) which does not follow Drupal coding standards OR there may be custom sources that should not be scanned by PHPCS at all.

Currently, there is no way to configure PHPCS and developers cannot properly use CI to check for coding standards since they fail for the base theme.

Is it possible to allow to provide a custom phpcs.xml file in the repo (through an env variable)?

Redis settings cleanup

The redis settings are substantial and a good candidate to move into a standalone file.

They also assume the env LAGOON is set, and that's not really necessary nor over-rideable if not in this context (testing or hosting elsewhere). include a redis.settings.php from all.settings.php if ENABLE_REDIS.

Setup CI

@tobybellwood @simesy
I would like to help to setup CI using CircleCI for this project.

As a minimum, the CI would contain the following:

  • composer.json validation
  • PHP code linting for php files using PHPCS
  • Bash code linting for php files using shellcheck

Once setup, other checks can be added later.

If this is something that you are interested, please setup CI build in CircleCI for this project (no config is required) and I will submit a PR with CI configuration. This is required to allow my fork to run CI in PR.

Config import script doesn't work with drush 11

Problem statement

composer.json lets you install drush 11, but the script for running config import passes an additional 'sync' argument to drush config-import which isn't supported in drush 11.

Proposed resolution

Determine if this is still needed or if sync is the default in versions of drush < 11

Support Drupal 9

I'm working on a paas project and was looking to retain the govcms/scaffold-tooling entry in our composer.json

But its not Drupal 9 compatible because of the following:

DEV_MODE might turn off google analytics in prod

Adding tests for drupal settings, I notice that DEV_MODE may cause undesireable development settings to load in a production environment. This would turn off google analytics. Probably minor but I wanted capture it while i noticed it.

Add test: build govcms8-scaffold-paas for new changes.

  1. Clone the scaffold
  2. Add a local reference to scaffold-tooling
  3. (Maybe remove packagist.org: false to allow scaffold-tooling dependencies to resolve)
  4. composer update
  5. Build with docker
  6. Check version of scaffold
  7. Basic connectivity tests with drush.

Evaluate use of dev packages in `require`

Are packages like drupal/console, phar-io/manifest, phar-io/version, webflo/drupal-finder and webmozart/path-util needed in the production auto-loader?

Could they be moved to require-dev?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.