1. 07 Mar, 2014 1 commit
    • Petr Pudlak's avatar
      Add patching QA configuration files on buildbots · b7630577
      Petr Pudlak authored
      In order to work, it is necessary:
      * Write a JSON Patch to file "qa/qa-patch.json" in a source repository.
        (And be careful not to commit it!) The file must conform to RFC6902
        and describes what changes should be done to the QA JSON
        configuration. This is simple as
         [
           { "op": "add",
             "path": "default",
             "value": false },
           { "op": "add",
             "path": "/tests/instance-add-file",
             "value": true }
         ]
      
      * Install "jsonpatch" and "jsonpointer" modules on the machines QA is
        running on. Either using "easy_install" or as Debian packages using
        "pypi-install".
      
      QA only loads the modules if the patch file is present and non-empty.
      Therefore no changes to buildbots are needed, if the feature is not
      used.
      
      It's advisable to add a git pre-commit hook for the main repository to
      prevent changes to "qa/patch.json", keeping it to "[]". Suggestion for
      such a hook:
      
        # Exit code 1 if the patch file isn't just "[]":
        python -c 'import json, sys; \
          exit(0 if json.load(open("qa/qa-patch.json", "r")) == [] else 1)'
      
      Locally it's possible to tell git not to track changes to the file at
      all (see https://help.github.com/articles/ignoring-files):
      
        git update-index --assume-unchanged qa/qa-patch.json
      
      Cherry-pick of e5398c3a from stable-2.11.
      Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
      Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
      Reviewed-by: default avatarJose A. Lopes <jabolopes@google.com>
      b7630577
  2. 22 Nov, 2013 1 commit
    • Petr Pudlak's avatar
      Add patching QA configuration files on buildbots · e5398c3a
      Petr Pudlak authored
      In order to work, it is necessary:
      * Write a JSON Patch to file "qa/qa-patch.json" in a source repository.
        (And be careful not to commit it!) The file must conform to RFC6902
        and describes what changes should be done to the QA JSON
        configuration. This is simple as
         [
           { "op": "add",
             "path": "default",
             "value": false },
           { "op": "add",
             "path": "/tests/instance-add-file",
             "value": true }
         ]
      
      * Install "jsonpatch" and "jsonpointer" modules on the machines QA is
        running on. Either using "easy_install" or as Debian packages using
        "pypi-install".
      
      QA only loads the modules if the patch file is present and non-empty.
      Therefore no changes to buildbots are needed, if the feature is not
      used.
      
      It's advisable to add a git pre-commit hook for the main repository to
      prevent changes to "qa/patch.json", keeping it to "[]". Suggestion for
      such a hook:
      
        # Exit code 1 if the patch file isn't just "[]":
        python -c 'import json, sys; \
          exit(0 if json.load(open("qa/qa-patch.json", "r")) == [] else 1)'
      
      Locally it's possible to tell git not to track changes to the file at
      all (see https://help.github.com/articles/ignoring-files):
      
        git update-index --assume-unchanged qa/qa-patch.json
      Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
      Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
      e5398c3a