Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a ConfigUpdater service #347

Closed

Conversation

mglaman
Copy link
Contributor

@mglaman mglaman commented Mar 3, 2016

Because hook_update_N + config == hard.

@mglaman mglaman force-pushed the config-update-servicer branch 9 times, most recently from 2a03c19 to 231656e Compare March 4, 2016 17:56
@mglaman
Copy link
Contributor Author

mglaman commented Mar 4, 2016

@bojanz ready for review :) and proper commit name suggestion

@@ -0,0 +1,53 @@
<?php
/**
* Created by PhpStorm.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docblock needs to go :)

@bojanz bojanz changed the title WIP ConfigUpdater service Add a ConfigUpdater service Mar 6, 2016
@@ -34,6 +34,10 @@ services:
tags:
- { name: service_collector, tag: commerce.availability_checker, call: addChecker }

commerce.config_update:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the name of the class is ConfigUpdater, then the service name should match, commerce.config_updater

public function delete(array $config_names);

/**
* Gets the current active value of configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Gets/Loads, so that the verb matches the method name.

@bojanz
Copy link
Contributor

bojanz commented Mar 6, 2016

Looks almost ready. Great job!

@mglaman mglaman force-pushed the config-update-servicer branch 4 times, most recently from 74fb1c8 to 0304edc Compare March 7, 2016 14:57
@mglaman
Copy link
Contributor Author

mglaman commented Mar 7, 2016

@bojanz all items addressed

@mglaman mglaman force-pushed the config-update-servicer branch 3 times, most recently from e18c9cd to 4af7656 Compare March 7, 2016 18:19
Because hook_update_N + config == hard.
$type = $this->getConfigType($config_name);
if ($type == 'system.simple') {
$config = $this->configFactory->getEditable($config_name);
if (!$config) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getEditable() always returns a config object, so the if (!$config) will never work. Furthermore, we already checked active storage above.

@bojanz
Copy link
Contributor

bojanz commented Mar 8, 2016

Addressed most of the feedback above, committed in af4e4bb.

Followup:

  • Convert the ConfigUpdaterTest to a kernel test.
  • Cover all possible failures in the tests.

@bojanz bojanz closed this Mar 8, 2016
@mglaman mglaman deleted the config-update-servicer branch March 21, 2016 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants