Hello,

Since we mostly use cli in production and staging server, it would be nice to have drush command that list all tracked components and its status. Also it would be nice to have drush command to list all non tracked component.

I suggest to have
cgt - configuration-get-tracked-components
cgnt - configuration-get-non-tracked-components

I will put patch shortly

Comments

neoxavier’s picture

StatusFileSize
new4.2 KB

Here is the patch

dagmar’s picture

Status: Active » Needs review
gdrupal’s picture

Status: Needs review » Needs work

@neoxavier First thanks for this great job you are doing... now the review:

There is a few indent issues about coding standard.

The callbacks works great when you have components to list.. but what happens if you do not have tracked or non tracked components?
We need to contemplate that use case.. some fallback message or something.

I will be posting a non related issue with menu-link components i have found reviewing you patch... really good job pretty close to close it ;)

neoxavier’s picture

Status: Needs work » Needs review
StatusFileSize
new4.37 KB

ah ya, sorry about that

thank you for the input. here is the simple fallback message

Status: Needs review » Needs work

The last submitted patch, configuration-cgtandcgnt-1808450-4.patch, failed testing.

neoxavier’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, configuration-cgtandcgnt-1808450-4.patch, failed testing.

neoxavier’s picture

Status: Needs work » Needs review
StatusFileSize
new36.16 KB

there was merge conflict, hope this patch will resolve it

Status: Needs review » Needs work

The last submitted patch, configuration-cgtandcgnt-1808450-7.patch, failed testing.

neoxavier’s picture

StatusFileSize
new4.38 KB

removing white spaces,
hope this one works

neoxavier’s picture

Status: Needs work » Needs review

put it to needs review

gdrupal’s picture

Status: Needs review » Needs work

@neoxavier the patch seems to we working fine for the cgt command but I getting a error when using cgnt and we are tracking all components, you are missing the fallback message there. Finally, we still have a lot of coding standard warnings, just as example there is much more than this:

  • Line 230: indent secondary line of comment one space
  • Line 231: indent secondary line of comment one space
  • Line 232: indent secondary line of comment one space
  • Line 236: Use an indent of 2 spaces, with no tabs
  • Line 296: indent secondary line of comment one space

I think you forgot to apply the auto-format to the code ;)

neoxavier’s picture

StatusFileSize
new4.39 KB

what this is weird, coder does not pickup anything.
which tools do you use? I think I need that.

here is the fix for cgnt and some fix on coding standard. But I am not really sure about the coding standard

gdrupal’s picture

@neoxavier Now cgnt is working right ;) ... as for the coding standard, pretty close! i'm using coder.. just set it to "minor" in warnings options. Check this last 3 and we are good to go!

  • Line 249: Use an indent of 2 spaces, with no tabs
  • Line 273: Use an indent of 2 spaces, with no tabs
  • Line 274: Use an indent of 2 spaces, with no tabs
neoxavier’s picture

Status: Needs work » Needs review
StatusFileSize
new4.39 KB

ah ok,

hope this is the last one :)

gdrupal’s picture

Status: Needs review » Reviewed & tested by the community

Now i think RTBC ;)

dagmar’s picture

+++ b/configuration.drush.inc
@@ -204,7 +226,96 @@ function _configuration_list() {
+    $staging_hash = db_select('configuration_staging', 'cs')
+                      ->fields('cs', array('hash'))
+                      ->condition('component', $component)
+                      ->condition('identifier', $identifier)
+                      ->execute()
+                      ->fetchField();

Sorry, but we have an API to do this, lets try to no re-write the code, because is harder to change later.

+++ b/configuration.drush.inc
@@ -204,7 +226,96 @@ function _configuration_list() {
+    if (empty($staging_hash)) {
+      return $human_name ? t('ActiveStore only') : CONFIGURATION_ACTIVESTORE_ONLY;
+    }
+    else {
+      if ($hash == $staging_hash) {
+        return $human_name ? t('In Sync') : CONFIGURATION_IN_SYNC;
+      }
+      else {
+        return $human_name ? t('Overriden') : CONFIGURATION_ACTIVESTORE_OVERRIDEN;
+      }

Same for this.

dagmar’s picture

Status: Reviewed & tested by the community » Needs work
dagmar’s picture

Also It will need a re-roll, I committed 4 new patches to this module.

neoxavier’s picture

Hello,

is getStatus($human_name = TRUE) the API you refer to?

gdrupal’s picture

@neoxavier I think it is... check the configuration_ui_config_info() in configuration_ui as an example on how to use it.

neoxavier’s picture

Status: Needs work » Needs review
StatusFileSize
new3.56 KB

here is the updated patch, I also re-base my branch so it commits to the latest HEAD.

gdrupal’s picture

Status: Needs review » Reviewed & tested by the community

I Think it's RTBC. ;)

gdrupal’s picture

gdrupal’s picture

Status: Reviewed & tested by the community » Fixed
neoxavier’s picture

thanks :)

Status: Fixed » Closed (fixed)

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