diff --git a/CHANGELOG.md b/CHANGELOG.md index fbe0b6229..c05464765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,31 +5,35 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog][keepachangelog], and this project adheres to [Semantic Versioning][semver]. - ## [Unreleased] - ### Added +- `Update` handler pipeline, showcase mapping dict fields to class types with `attrs` + `cattrs`. ([206]) +- Schema for update handler. ([206]) +- Add `type` tests for `attrs` structuring. ([206]) ### Changed + - perf: re-implementing slow git cmds with pygit2 ([207]) +- Specify a list of repositories which shouldn't contain additional commits instead of just specifying a flag ([203]) ### Fixed + - Update handler fix: return an empty list of targets if the targets folder does not exist ([208]) + - pytest works when taf installed via wheel ([200]) [208]: https://github.com/openlawlibrary/taf/pull/208 [207]: https://github.com/openlawlibrary/taf/pull/207 +[206]: https://github.com/openlawlibrary/taf/pull/206 [200]: https://github.com/openlawlibrary/taf/pull/200 ## [0.14.0] - 01/25/2022 - ### Added - ### Changed - Specify a list of repositories which shouldn't contain additional commits instead of just specifying a flag ([203]) @@ -39,51 +43,37 @@ and this project adheres to [Semantic Versioning][semver]. - Raise an error if a repository which should not contain additional commits does so ([203]) - Do not merge target commits if update as a whole will later fail ([203]) - [203]: https://github.com/openlawlibrary/taf/pull/203 - ## [0.13.4] - 01/20/2022 - ### Added - ### Changed - Trim text read from the last_validated_commit file ([201]) - ### Fixed - [201]: https://github.com/openlawlibrary/taf/pull/201 ## [0.13.3] - 11/18/2021 - ### Added - ### Changed - Update create local branch git command - remove checkout ([197]) - Iterate throuh all urls when checking if a local repo is synced with remote ([197]) - ### Fixed - [197]: https://github.com/openlawlibrary/taf/pull/197 - - ## [0.13.2] - 11/11/2021 - ### Added - ### Changed - Remove commit checkout and checkout the latest branch for each target repository ([195]) @@ -91,66 +81,50 @@ and this project adheres to [Semantic Versioning][semver]. ### Fixed - [195]: https://github.com/openlawlibrary/taf/pull/195 - ## [0.13.1] - 10/22/2021 - ### Added - ### Changed - ### Fixed - Pass default branch to sorted_commits_and_branches_per_repositories ([185]) - [185]: https://github.com/openlawlibrary/taf/pull/185 - ## [0.13.0] - 10/20/2021 ### Added - ### Changed - Pin cryptography and pyOpenSSL versions to keep compatibility with yubikey-manager 3.0.0 ([184]) - ### Fixed - [184]: https://github.com/openlawlibrary/taf/pull/184 - ## [0.12.0] - 10/18/2021 ### Added - ### Changed - Updated cryptography version ([183]) - ### Fixed - Fix validate local repo command ([183]) - [183]: https://github.com/openlawlibrary/taf/pull/183 - ## [0.11.2] - 09/29/2021 ### Added - ### Changed - Exclude test date from wheels ([182]) @@ -159,12 +133,10 @@ and this project adheres to [Semantic Versioning][semver]. [182]: https://github.com/openlawlibrary/taf/pull/182 - ## [0.11.1] - 09/29/2021 ### Added - ### Changed - Removed generate schema docs due to their long names causing issues on Windows when installing taf ([181]) @@ -173,10 +145,8 @@ and this project adheres to [Semantic Versioning][semver]. [181]: https://github.com/openlawlibrary/taf/pull/181 - ## [0.11.0] - 09/28/2021 - ### Added - Added support for skipping automatic checkout ([179]) @@ -185,7 +155,6 @@ and this project adheres to [Semantic Versioning][semver]. - Compare current head commit according to the auth repo and top commit of target repo and raise an error if they are different ([179]) - ### Fixed - Automatically remove current and previous directories if they exist before instantiating tuf repo ([179]) @@ -193,36 +162,30 @@ and this project adheres to [Semantic Versioning][semver]. - Fixed update of repos which can contain unauhtenticated commits - combine fetched and existing commits ([179]) - Fixed handling of additional commits on a branch ([179]) - [179]: https://github.com/openlawlibrary/taf/pull/179 ## [0.10.1] - 08/16/2021 ### Added - ### Changed - Do not raise an error if the hosts file is missing ([177]) ### Fixed - [177]: https://github.com/openlawlibrary/taf/pull/177 - ## [0.10.0] - 07/20/2021 ### Added - ### Changed - Update click to 7.1 ([176]) ### Fixed - ## [0.9.0] - 06/30/2021 ### Added @@ -232,7 +195,6 @@ and this project adheres to [Semantic Versioning][semver]. - Provided a way of specifying hosts of repositories though a special target file called `hosts.json` ([164]) - Verification of the initial commit of a repository given `out-of-band-authentication` commit either directly passed into the udater or stored in `dependencies.json` of the parent auth repo. ([164]) - ### Changed - Renamed `repo_name` and `repo_urls` attributes to `name` and `urls` and `additional_info` to `custom` ([164]) @@ -241,12 +203,10 @@ and this project adheres to [Semantic Versioning][semver]. ### Fixed - [176]: https://github.com/openlawlibrary/taf/pull/176 [173]: https://github.com/openlawlibrary/taf/pull/173 [164]: https://github.com/openlawlibrary/taf/pull/164 - ## [0.8.1] - 04/14/2021 ### Added @@ -266,12 +226,10 @@ and this project adheres to [Semantic Versioning][semver]. - Minor validation command fix ([161]) - [166]: https://github.com/openlawlibrary/taf/pull/166 [165]: https://github.com/openlawlibrary/taf/pull/165 [161]: https://github.com/openlawlibrary/taf/pull/161 - ## [0.8.0] - 02/09/2021 ### Added @@ -282,10 +240,8 @@ and this project adheres to [Semantic Versioning][semver]. ### Fixed - [162]: https://github.com/openlawlibrary/taf/pull/162 - ## [0.7.2] - 11/11/2020 ### Added @@ -296,10 +252,8 @@ and this project adheres to [Semantic Versioning][semver]. ### Fixed - [158]: https://github.com/openlawlibrary/taf/pull/158 - ## [0.7.1] - 10/28/2020 ### Added @@ -310,10 +264,8 @@ and this project adheres to [Semantic Versioning][semver]. ### Fixed - [156]: https://github.com/openlawlibrary/taf/pull/156 - ## [0.7.0] - 10/16/2020 ### Added @@ -330,12 +282,10 @@ and this project adheres to [Semantic Versioning][semver]. - Minor YubiKey mock fix ([153]) - Updated some git methods so that it is checked if the returned value is not `None` before calling strip ([153]) - [154]: https://github.com/openlawlibrary/taf/pull/154 [153]: https://github.com/openlawlibrary/taf/pull/153 [147]: https://github.com/openlawlibrary/taf/pull/147 - ## [0.6.1] - 09/09/2020 ### Added @@ -364,7 +314,6 @@ and this project adheres to [Semantic Versioning][semver]. [145]: https://github.com/openlawlibrary/taf/pull/145 [144]: https://github.com/openlawlibrary/taf/pull/144 - ## [0.5.2] - 07/21/2020 ### Added @@ -379,7 +328,6 @@ and this project adheres to [Semantic Versioning][semver]. [142]: https://github.com/openlawlibrary/taf/pull/142 - ## [0.5.1] - 06/25/2020 ### Added @@ -428,7 +376,6 @@ and this project adheres to [Semantic Versioning][semver]. ### Fixed - [131]: https://github.com/openlawlibrary/taf/pull/131 ## [0.4.0] - 05/01/2020 @@ -463,7 +410,6 @@ and this project adheres to [Semantic Versioning][semver]. - Load signing keys minor fixes ([120] [117]) - Normalize target files when creating a new repository ([117]) - [129]: https://github.com/openlawlibrary/taf/pull/129 [128]: https://github.com/openlawlibrary/taf/pull/128 [126]: https://github.com/openlawlibrary/taf/pull/126 diff --git a/setup.py b/setup.py index bc5a9a7fc..b420b5a31 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,11 @@ def finalize_options(self): dev_require = ["bandit>=1.6.0", "black>=19.3b0", "pre-commit>=1.18.3"] -tests_require = ["pytest==4.5.0", "freezegun==0.3.15", "jsonschema==3.2.0"] +tests_require = [ + "pytest==4.5.0", + "freezegun==0.3.15", + "jsonschema==3.2.0", +] yubikey_require = ["yubikey-manager==3.0.0"] @@ -66,6 +70,7 @@ def finalize_options(self): "cryptography==3.2.1", "pyOpenSSL==20.0.1", "pygit2==0.28.2", + "cattrs==1.0.0", ], "extras_require": { "ci": ci_require, diff --git a/taf/auth_repo.py b/taf/auth_repo.py index 8ba61ed46..67d24f33a 100644 --- a/taf/auth_repo.py +++ b/taf/auth_repo.py @@ -22,6 +22,7 @@ class AuthenticationRepository(GitRepository, TAFRepository): AUTH_REPOS_HOSTS_KEY = "auth_repos" _conf_dir = None + _dependencies = {} def __init__( self, @@ -79,6 +80,7 @@ def to_json_dict(self): "conf_directory_root": str(self.conf_directory_root), "out_of_band_authentication": self.out_of_band_authentication, "hosts": self.hosts, + "dependencies": self.dependencies, } ) return data @@ -105,6 +107,14 @@ def certs_dir(self): certs_dir.mkdir(parents=True, exist_ok=True) return str(certs_dir) + @property + def dependencies(self): + return self._dependencies + + @dependencies.setter + def dependencies(self, value): + self._dependencies = value + @property def is_test_repo(self): return Path(self.path, self.targets_path, self.TEST_REPO_FLAG_FILE).is_file() diff --git a/taf/repositoriesdb.py b/taf/repositoriesdb.py index ecf159356..ad7545dbe 100644 --- a/taf/repositoriesdb.py +++ b/taf/repositoriesdb.py @@ -120,7 +120,11 @@ def load_dependencies( # TODO check if repo class is subclass of AuthenticationRepository # or will that get caught by except contained_auth_repo = auth_class( - library_dir, name, urls, out_of_band_authentication, custom + library_dir=library_dir, + name=name, + urls=urls, + out_of_band_authentication=out_of_band_authentication, + custom=custom, ) except Exception as e: taf_logger.error( @@ -138,6 +142,14 @@ def load_dependencies( ", ".join(dependencies_dict.keys()), ) + # we don't need to set auth_repo dependencies for each commit, + # just the latest version + latest_commit = commits[-1] + dependencies = _load_dependencies_json(auth_repo, latest_commit) + auth_repo.dependencies = ( + dependencies["dependencies"] if dependencies is not None else {} + ) + def load_repositories( auth_repo, @@ -358,14 +370,14 @@ def _compare(name): def get_deduplicated_auth_repositories(auth_repo, commits): - return _get_deduplicated_target_or_auth_repositotries(auth_repo, commits, True) + return _get_deduplicated_target_or_auth_repositories(auth_repo, commits, True) def get_deduplicated_repositories(auth_repo, commits): - return _get_deduplicated_target_or_auth_repositotries(auth_repo, commits) + return _get_deduplicated_target_or_auth_repositories(auth_repo, commits) -def _get_deduplicated_target_or_auth_repositotries(auth_repo, commits, load_auth=False): +def _get_deduplicated_target_or_auth_repositories(auth_repo, commits, load_auth=False): loaded_repositories_dict = _dependencies_dict if load_auth else _repositories_dict auth_msg = "included authentication " if load_auth else "" repositories_msg = ( @@ -524,15 +536,13 @@ def get_repo_urls(auth_repo, repo_name, commit=None): return _get_urls(mirrors, repo_name) -def _load_dependencies_json(auth_repo, commit): +def _load_dependencies_json(auth_repo, commit=None): try: return _get_json_file(auth_repo, DEPENDENCIES_JSON_PATH, commit) except InvalidOrMissingMetadataError as e: if f"{DEPENDENCIES_JSON_PATH} not available at revision" in str(e): taf_logger.debug("Skipping commit {} due to: {}", commit, str(e)) - return None - else: - raise + return None def _load_hosts_json(auth_repo, commit=None): diff --git a/taf/tests/conftest.py b/taf/tests/conftest.py index 5dbb1d96b..81b04f0ce 100644 --- a/taf/tests/conftest.py +++ b/taf/tests/conftest.py @@ -32,10 +32,16 @@ DELEGATED_ROLES_KEYSTORE_PATH = KEYSTORES_PATH / "delegated_roles_keystore" CLIENT_DIR_PATH = TEST_DATA_REPOS_PATH / "client" HANDLERS_DATA_INPUT_DIR = TEST_DATA_PATH / "handler_inputs" +TYPES_DIR = TEST_DATA_PATH / "types" +UPDATE_TYPES_DIR = TYPES_DIR / "update" +UPDATE_TYPES_VALID_INPUT_DIR = UPDATE_TYPES_DIR / "valid" +UPDATE_TYPES_INVALID_INPUT_DIR = UPDATE_TYPES_DIR / "invalid" REPO_HANDLERS_DATA_VALID_INPUT_IDR = HANDLERS_DATA_INPUT_DIR / "valid" / "repo" HOST_HANDLERS_DATA_VALID_INPUT_IDR = HANDLERS_DATA_INPUT_DIR / "valid" / "host" +UPDATE_HANDLERS_DATA_VALID_INPUT_IDR = HANDLERS_DATA_INPUT_DIR / "valid" / "update" REPO_HANDLERS_DATA_INVALID_INPUT_IDR = HANDLERS_DATA_INPUT_DIR / "invalid" / "repo" HOST_HANDLERS_DATA_INVALID_INPUT_IDR = HANDLERS_DATA_INPUT_DIR / "invalid" / "host" +UPDATE_HANDLERS_DATA_INVALID_INPUT_IDR = HANDLERS_DATA_INPUT_DIR / "invalid" / "update" def pytest_configure(config): @@ -165,6 +171,18 @@ def wrong_keystore(): return str(WRONG_KEYSTORE_PATH) +@fixture +def types_update_valid_inputs(): + """Paths to the type update's input json files""" + return [input_path for input_path in UPDATE_TYPES_VALID_INPUT_DIR.glob("*.json")] + + +@fixture +def types_update_invalid_inputs(): + """Paths to the type update's input json files""" + return [input_path for input_path in UPDATE_TYPES_INVALID_INPUT_DIR.glob("*.json")] + + @fixture def repo_handlers_valid_inputs(): """Paths to the repo handler's input json files""" @@ -181,6 +199,14 @@ def host_handlers_valid_inputs(): ] +@fixture +def update_handlers_valid_inputs(): + """Paths to the update handler's input json files""" + return [ + input_path for input_path in UPDATE_HANDLERS_DATA_VALID_INPUT_IDR.glob("*.json") + ] + + @fixture def repo_handlers_invalid_inputs(): """Paths to the repo handler's input json files""" @@ -197,6 +223,15 @@ def host_handlers_invalid_inputs(): ] +@fixture +def update_handlers_invalid_inputs(): + """Paths to the update handler's input json files""" + return [ + input_path + for input_path in UPDATE_HANDLERS_DATA_INVALID_INPUT_IDR.glob("*.json") + ] + + @fixture def delegated_roles_keystore(): """Path of the keystore with keys of delegated roles""" diff --git a/taf/tests/data/handler_inputs/invalid/host/missing_required.json b/taf/tests/data/handler_inputs/invalid/host/missing_required.json index a4ac8a40c..925b9287f 100644 --- a/taf/tests/data/handler_inputs/invalid/host/missing_required.json +++ b/taf/tests/data/handler_inputs/invalid/host/missing_required.json @@ -2,7 +2,7 @@ "update": { "changed": false, "event": "event/succeeded", - "host_name": "san-ildefonso.nsn.us.open.law.vagrant", + "host_name": "portland.oregon.law", "error_msg": "", "auth_repos": [ { @@ -13,39 +13,17 @@ "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law" + "http://github.com/portland/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\sanipueblo", + "conf_directory_root": "E:\\oll\\library\\test-update\\portland", "out_of_band_authentication": null, "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": { - "custom": { - "reader": false, - "subdomains": { - "development": { - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-development" - } - }, - "preview": { - "sanipueb/law-xml-codified": { - "repo-name": "sanipueblo/law-xml-codified-preview" - }, - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-preview", - "pull": "authenticated" - }, - "sanipueblo/law-docs": { - "repo-name": "sanipueblo/law-docs-preview", - "pull": "latest" - } - } - } - } + "portland.oregon.law": { + "custom": {} } } }, @@ -56,12 +34,12 @@ } }, "target_repos": { - "sanipueblo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-docs", + "name": "portland/law-docs", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-docs" + "http://github.com/portland/portland-law-docs" ], "default_branch": "master", "custom": { @@ -89,12 +67,12 @@ } } }, - "sanipueblo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml" + "http://github.com/portland/portland-law-xml" ], "default_branch": "master", "custom": { @@ -123,16 +101,16 @@ } } }, - "sanipueblo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-html" + "http://github.com/portland/portland-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/sanipueblo-law-html-preview.git", + "preview": "https://github.com/portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -159,16 +137,16 @@ } } }, - "sanipueblo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + "http://github.com/portland/portland-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "preview": "https://github.com/portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -195,12 +173,12 @@ } } }, - "sanipueblo/law-static-assets": { + "portland/law-static-assets": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-static-assets", + "name": "portland/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-static-assets" + "http://github.com/portland/portland-law-static-assets" ], "default_branch": "master", "custom": { @@ -234,42 +212,11 @@ } } ], - "custom": { - "reader": false, - "subdomains": { - "development": { - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-development" - } - }, - "preview": { - "sanipueb/law-xml-codified": { - "repo-name": "sanipueblo/law-xml-codified-preview" - }, - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-preview", - "pull": "authenticated" - }, - "sanipueblo/law-docs": { - "repo-name": "sanipueblo/law-docs-preview", - "pull": "latest" - } - } - } - } + "custom": {} }, "state": { - "transient": { - "sanipueblo/law": {}, - "script1": { - "cityofsanamteo/law": "this is transient" - } - }, - "persistent": { - "script1": { - "cityofsanamteo/law": "this is persistent" - } - } + "transient": {}, + "persistent": {} }, "config": {} } \ No newline at end of file diff --git a/taf/tests/data/handler_inputs/invalid/host/wrong_type.json b/taf/tests/data/handler_inputs/invalid/host/wrong_type.json index 19cd31098..5872bb17f 100644 --- a/taf/tests/data/handler_inputs/invalid/host/wrong_type.json +++ b/taf/tests/data/handler_inputs/invalid/host/wrong_type.json @@ -2,7 +2,7 @@ "update": { "changed": false, "event": "event/succeeded", - "host_name": "san-ildefonso.nsn.us.open.law.vagrant", + "host_name": "portland.oregon.law", "error_msg": "", "auth_repos": [ { @@ -14,39 +14,17 @@ "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law" + "http://github.com/portland/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\sanipueblo", + "conf_directory_root": "E:\\oll\\library\\test-update\\portland", "out_of_band_authentication": null, "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": { - "custom": { - "reader": false, - "subdomains": { - "development": { - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-development" - } - }, - "preview": { - "sanipueb/law-xml-codified": { - "repo-name": "sanipueblo/law-xml-codified-preview" - }, - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-preview", - "pull": "authenticated" - }, - "sanipueblo/law-docs": { - "repo-name": "sanipueblo/law-docs-preview", - "pull": "latest" - } - } - } - } + "portland.oregon.law": { + "custom": {} } } }, @@ -57,12 +35,12 @@ } }, "target_repos": { - "sanipueblo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-docs", + "name": "portland/law-docs", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-docs" + "http://github.com/portland/portland-law-docs" ], "default_branch": "master", "custom": { @@ -90,12 +68,12 @@ } } }, - "sanipueblo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml" + "http://github.com/portland/portland-law-xml" ], "default_branch": "master", "custom": { @@ -124,16 +102,16 @@ } } }, - "sanipueblo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-html" + "http://github.com/portland/portland-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/sanipueblo-law-html-preview.git", + "preview": "https://github.com/portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -160,16 +138,16 @@ } } }, - "sanipueblo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + "http://github.com/portland/portland-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "preview": "https://github.com/portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -196,12 +174,12 @@ } } }, - "sanipueblo/law-static-assets": { + "portland/law-static-assets": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-static-assets", + "name": "portland/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-static-assets" + "http://github.com/portland/portland-law-static-assets" ], "default_branch": "master", "custom": { @@ -235,42 +213,11 @@ } } ], - "custom": { - "reader": false, - "subdomains": { - "development": { - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-development" - } - }, - "preview": { - "sanipueb/law-xml-codified": { - "repo-name": "sanipueblo/law-xml-codified-preview" - }, - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-preview", - "pull": "authenticated" - }, - "sanipueblo/law-docs": { - "repo-name": "sanipueblo/law-docs-preview", - "pull": "latest" - } - } - } - } + "custom": {} }, "state": { - "transient": { - "sanipueblo/law": {}, - "script1": { - "cityofsanamteo/law": "this is transient" - } - }, - "persistent": { - "script1": { - "cityofsanamteo/law": "this is persistent" - } - } + "transient": {}, + "persistent": {} }, "config": {} } \ No newline at end of file diff --git a/taf/tests/data/handler_inputs/invalid/repo/additional_property.json b/taf/tests/data/handler_inputs/invalid/repo/additional_property.json index 15450ba3a..9bd30f1bf 100644 --- a/taf/tests/data/handler_inputs/invalid/repo/additional_property.json +++ b/taf/tests/data/handler_inputs/invalid/repo/additional_property.json @@ -2,38 +2,39 @@ "update": { "changed": true, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "houstontexas/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/houston/houstontexas-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\cityofsanmateo", + "conf_directory_root": "E:\\oll\\library\\test-update\\houstontexas", "out_of_band_authentication": null, + "dependencies": {}, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "houston.texas.us.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", "pull": "latest" } } @@ -52,12 +53,12 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "houstontexas/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-docs", + "name": "houstontexas/law-docs", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "http://github.com/houston/houstontexas-law-docs" ], "default_branch": "master", "custom": { @@ -85,12 +86,12 @@ } } }, - "cityofsanmateo/law-xml": { + "houstontexas/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml", + "name": "houstontexas/law-xml", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "http://github.com/houston/houstontexas-law-xml" ], "default_branch": "master", "custom": { @@ -126,16 +127,16 @@ } } }, - "cityofsanmateo/law-html": { + "houstontexas/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-html", + "name": "houstontexas/law-html", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "http://github.com/houston/houstontexas-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "https://github.com/houston/houstontexas-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -162,16 +163,16 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "houstontexas/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml-codified", + "name": "houstontexas/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + "http://github.com/houston/houstontexas-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "https://github.com/houston/houstontexas-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -203,7 +204,7 @@ "library_dir": "E:\\oll\\library\\test-update", "name": "openlawlibrary/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + "http://github.com/houston/openlawlibrary-law-static-assets" ], "default_branch": "master", "custom": { diff --git a/taf/tests/data/handler_inputs/invalid/repo/missing_required.json b/taf/tests/data/handler_inputs/invalid/repo/missing_required.json index 516b111de..89f9bfbce 100644 --- a/taf/tests/data/handler_inputs/invalid/repo/missing_required.json +++ b/taf/tests/data/handler_inputs/invalid/repo/missing_required.json @@ -1,38 +1,39 @@ { "update": { "changed": false, - "repo_name": "cityofsanmateo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "houstontexas/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/houston/houstontexas-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\cityofsanmateo", + "conf_directory_root": "E:\\oll\\library\\test-update\\houstontexas", "out_of_band_authentication": null, + "dependencies": {}, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "houston.texas.us.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", "pull": "latest" } } diff --git a/taf/tests/data/handler_inputs/invalid/repo/missing_required_inner.json b/taf/tests/data/handler_inputs/invalid/repo/missing_required_inner.json index a3604b898..a45511c1f 100644 --- a/taf/tests/data/handler_inputs/invalid/repo/missing_required_inner.json +++ b/taf/tests/data/handler_inputs/invalid/repo/missing_required_inner.json @@ -2,38 +2,39 @@ "update": { "changed": true, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "houstontexas/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/houston/houstontexas-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\cityofsanmateo", + "conf_directory_root": "E:\\oll\\library\\test-update\\houstontexas", "out_of_band_authentication": null, + "dependencies": {}, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "houston.texas.us.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", "pull": "latest" } } @@ -50,12 +51,12 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "houstontexas/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-docs", + "name": "houstontexas/law-docs", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "http://github.com/houston/houstontexas-law-docs" ], "default_branch": "master", "custom": { @@ -83,12 +84,12 @@ } } }, - "cityofsanmateo/law-xml": { + "houstontexas/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml", + "name": "houstontexas/law-xml", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "http://github.com/houston/houstontexas-law-xml" ], "default_branch": "master", "custom": { @@ -124,16 +125,16 @@ } } }, - "cityofsanmateo/law-html": { + "houstontexas/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-html", + "name": "houstontexas/law-html", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "http://github.com/houston/houstontexas-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "https://github.com/houston/houstontexas-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -160,16 +161,16 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "houstontexas/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml-codified", + "name": "houstontexas/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + "http://github.com/houston/houstontexas-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "https://github.com/houston/houstontexas-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -201,7 +202,7 @@ "library_dir": "E:\\oll\\library\\test-update", "name": "openlawlibrary/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + "http://github.com/houston/openlawlibrary-law-static-assets" ], "default_branch": "master", "custom": { diff --git a/taf/tests/data/handler_inputs/invalid/repo/wrong_type.json b/taf/tests/data/handler_inputs/invalid/repo/wrong_type.json index 64e73f2a8..67b64ffa6 100644 --- a/taf/tests/data/handler_inputs/invalid/repo/wrong_type.json +++ b/taf/tests/data/handler_inputs/invalid/repo/wrong_type.json @@ -2,38 +2,39 @@ "update": { "changed": false, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "houstontexas/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/houston/houstontexas-law" ], "default_branch": "master", "custom": {}, "conf_directory_root": false, "out_of_band_authentication": null, + "dependencies": {}, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "houston.texas.us.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", "pull": "latest" } } @@ -49,12 +50,12 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "houstontexas/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-docs", + "name": "houstontexas/law-docs", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "http://github.com/houston/houstontexas-law-docs" ], "default_branch": "master", "custom": { @@ -82,12 +83,12 @@ } } }, - "cityofsanmateo/law-xml": { + "houstontexas/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml", + "name": "houstontexas/law-xml", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "http://github.com/houston/houstontexas-law-xml" ], "default_branch": "master", "custom": { @@ -116,16 +117,16 @@ } } }, - "cityofsanmateo/law-html": { + "houstontexas/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-html", + "name": "houstontexas/law-html", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "http://github.com/houston/houstontexas-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "https://github.com/houston/houstontexas-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -152,16 +153,16 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "houstontexas/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml-codified", + "name": "houstontexas/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + "http://github.com/houston/houstontexas-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "https://github.com/houston/houstontexas-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -193,7 +194,7 @@ "library_dir": "E:\\oll\\library\\test-update", "name": "openlawlibrary/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + "http://github.com/houston/openlawlibrary-law-static-assets" ], "default_branch": "master", "custom": { diff --git a/taf/tests/data/handler_inputs/invalid/update/array_instead_of_object.json b/taf/tests/data/handler_inputs/invalid/update/array_instead_of_object.json new file mode 100644 index 000000000..37f636b1c --- /dev/null +++ b/taf/tests/data/handler_inputs/invalid/update/array_instead_of_object.json @@ -0,0 +1,866 @@ +{ + "update": { + "changed": false, + "event": "event/succeeded", + "error_msg": "", + "hosts": [ + { + "houston.texas.us.open.law.vagrant": { + "host_name": "houston.texas.us.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "portland/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "portland/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law", + "urls": [ + "http://github.com/houston/portland-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\portland", + "out_of_band_authentication": null, + "hosts": { + "houston.texas.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "portland/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml", + "urls": [ + "http://github.com/houston/portland-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "portland/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-html", + "urls": [ + "http://github.com/houston/portland-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/portland-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "portland/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml-codified", + "urls": [ + "http://github.com/houston/portland-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/portland-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + }, + "custom": {} + } + } + }, + "custom": null + } + }, + { + "portland.oregon.open.law.vagrant": { + "host_name": "portland.oregon.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "houstontexas/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "houstontexas/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law", + "urls": [ + "http://github.com/houston/houstontexas-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", + "out_of_band_authentication": null, + "hosts": { + "portland.oregon.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" + } + }, + "preview": { + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" + }, + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", + "pull": "authenticated" + }, + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "houstontexas/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-docs", + "urls": [ + "git@github.com:houston/houstontexas-law-docs.git", + "http://github.com/houston/houstontexas-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "houstontexas/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml", + "urls": [ + "git@github.com:houston/houstontexas-law-xml.git", + "http://github.com/houston/houstontexas-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "houstontexas/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-html", + "urls": [ + "git@github.com:houston/houstontexas-law-html.git", + "http://github.com/houston/houstontexas-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/houstontexas-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "houstontexas/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml-codified", + "urls": [ + "git@github.com:houston/houstontexas-law-xml-codified.git", + "http://github.com/houston/houstontexas-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/houstontexas-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:houston/openlawlibrary-law-static-assets.git", + "http://github.com/houston/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + }, + "custom": {} + } + } + }, + "custom": { + "subdomains": { + "development": { + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" + } + }, + "preview": { + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" + }, + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", + "pull": "authenticated" + }, + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", + "pull": "latest" + } + } + } + } + } + } + ], + "auth_repos": { + "houstontexas/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "houstontexas/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law", + "urls": [ + "http://github.com/houston/houstontexas-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", + "out_of_band_authentication": null, + "hosts": { + "portland.oregon.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" + } + }, + "preview": { + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" + }, + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", + "pull": "authenticated" + }, + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "houstontexas/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-docs", + "urls": [ + "git@github.com:houston/houstontexas-law-docs.git", + "http://github.com/houston/houstontexas-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "houstontexas/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml", + "urls": [ + "git@github.com:houston/houstontexas-law-xml.git", + "http://github.com/houston/houstontexas-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "houstontexas/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-html", + "urls": [ + "git@github.com:houston/houstontexas-law-html.git", + "http://github.com/houston/houstontexas-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/houstontexas-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "houstontexas/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml-codified", + "urls": [ + "git@github.com:houston/houstontexas-law-xml-codified.git", + "http://github.com/houston/houstontexas-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/houstontexas-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:houston/openlawlibrary-law-static-assets.git", + "http://github.com/houston/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + } + }, + "portland/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "portland/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law", + "urls": [ + "http://github.com/houston/portland-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\portland", + "out_of_band_authentication": null, + "hosts": { + "houston.texas.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "portland/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml", + "urls": [ + "http://github.com/houston/portland-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "portland/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-html", + "urls": [ + "http://github.com/houston/portland-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/portland-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "portland/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml-codified", + "urls": [ + "http://github.com/houston/portland-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/portland-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + } + }, + "openlawlibrary/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "openlawlibrary/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law", + "urls": [ + "https://github.com/houston/openlawlibrary-law.git" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\openlawlibrary", + "out_of_band_authentication": null, + "hosts": {}, + "dependencies": { + "houstontexas/law": { + "out-of-band-authentication": "bfcbc7db7adc3f43291a64b0572b6b114e63e98a" + }, + "portland/law": { + "out-of-band-authentiction": "d7a6b796cffe53ad89b4504084402570b7d17f6b" + } + } + }, + "commits": { + "before_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef", + "new": [], + "after_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef" + } + }, + "target_repos": {} + } + }, + "auth_repo_name": "openlawlibrary/law" + }, + "state": { + "transient": {}, + "persistent": {} + }, + "config": {} +} \ No newline at end of file diff --git a/taf/tests/data/handler_inputs/invalid/update/required_field_missing.json b/taf/tests/data/handler_inputs/invalid/update/required_field_missing.json new file mode 100644 index 000000000..0dc0c8108 --- /dev/null +++ b/taf/tests/data/handler_inputs/invalid/update/required_field_missing.json @@ -0,0 +1,441 @@ +{ + "update": { + "changed": false, + "event": "event/succeeded", + "error_msg": "", + "hosts": { + "portland.oregon.open.law.vagrant": { + "host_name": "portland.oregon.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "portland/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "portland/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law", + "urls": [ + "http://github.com/houston/portland-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\portland", + "out_of_band_authentication": null, + "hosts": { + "portland.oregon.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "portland/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml", + "urls": [ + "http://github.com/houston/portland-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "portland/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-html", + "urls": [ + "http://github.com/houston/portland-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/portland-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "portland/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml-codified", + "urls": [ + "http://github.com/houston/portland-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/portland-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + }, + "custom": {} + } + } + }, + "custom": null + }, + "houston.texas.open.law.vagrant": { + "host_name": "houston.texas.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "houstontexas/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "houstontexas/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law", + "urls": [ + "http://github.com/houston/houstontexas-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", + "out_of_band_authentication": null, + "hosts": { + "houston.texas.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" + } + }, + "preview": { + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" + }, + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", + "pull": "authenticated" + }, + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "houstontexas/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-docs", + "urls": [ + "git@github.com:houston/houstontexas-law-docs.git", + "http://github.com/houston/houstontexas-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "houstontexas/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml", + "urls": [ + "git@github.com:houston/houstontexas-law-xml.git", + "http://github.com/houston/houstontexas-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "houstontexas/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-html", + "urls": [ + "git@github.com:houston/houstontexas-law-html.git", + "http://github.com/houston/houstontexas-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/houstontexas-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "houstontexas/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml-codified", + "urls": [ + "git@github.com:houston/houstontexas-law-xml-codified.git", + "http://github.com/houston/houstontexas-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:houston/houstontexas-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:houston/openlawlibrary-law-static-assets.git", + "http://github.com/houston/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + }, + "custom": {} + } + } + }, + "custom": { + "subdomains": { + "development": { + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-development" + } + }, + "preview": { + "houstontexas/law-xml-codified": { + "repo-name": "houstontexas/law-html-preview" + }, + "houstontexas/law-html": { + "repo-name": "houstontexas/law-html-preview", + "pull": "authenticated" + }, + "houstontexas/law-docs": { + "repo-name": "houstontexas/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "auth_repo_name": "openlawlibrary/law" + }, + "state": { + "transient": {}, + "persistent": {} + }, + "config": {} +} \ No newline at end of file diff --git a/taf/tests/data/handler_inputs/valid/host/host.json b/taf/tests/data/handler_inputs/valid/host/host.json index e49544e9b..1fbacf1cf 100644 --- a/taf/tests/data/handler_inputs/valid/host/host.json +++ b/taf/tests/data/handler_inputs/valid/host/host.json @@ -2,51 +2,29 @@ "update": { "changed": false, "event": "event/succeeded", - "host_name": "san-ildefonso.nsn.us.open.law.vagrant", + "host_name": "portland.oregon.open.law.vagrant", "error_msg": "", "auth_repos": [ { "update": { "changed": false, "event": "event/succeeded", - "repo_name": "sanipueblo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law" + "http://github.com/portland/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\sanipueblo", + "conf_directory_root": "E:\\oll\\library\\test-update\\portland", "out_of_band_authentication": null, "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": { - "custom": { - "reader": false, - "subdomains": { - "development": { - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-development" - } - }, - "preview": { - "sanipueb/law-xml-codified": { - "repo-name": "sanipueblo/law-xml-codified-preview" - }, - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-preview", - "pull": "authenticated" - }, - "sanipueblo/law-docs": { - "repo-name": "sanipueblo/law-docs-preview", - "pull": "latest" - } - } - } - } + "portland.oregon.open.law.vagrant": { + "custom": {} } } }, @@ -57,12 +35,12 @@ } }, "target_repos": { - "sanipueblo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-docs", + "name": "portland/law-docs", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-docs" + "http://github.com/portland/portland-law-docs" ], "default_branch": "master", "custom": { @@ -90,12 +68,12 @@ } } }, - "sanipueblo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml" + "http://github.com/portland/portland-law-xml" ], "default_branch": "master", "custom": { @@ -124,16 +102,16 @@ } } }, - "sanipueblo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-html" + "http://github.com/portland/portland-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/sanipueblo-law-html-preview.git", + "preview": "https://github.com/portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -160,16 +138,16 @@ } } }, - "sanipueblo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + "http://github.com/portland/portland-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "preview": "https://github.com/portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -196,12 +174,12 @@ } } }, - "sanipueblo/law-static-assets": { + "portland/law-static-assets": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "sanipueblo/law-static-assets", + "name": "portland/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-static-assets" + "http://github.com/portland/portland-law-static-assets" ], "default_branch": "master", "custom": { @@ -235,42 +213,11 @@ } } ], - "custom": { - "reader": false, - "subdomains": { - "development": { - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-development" - } - }, - "preview": { - "sanipueb/law-xml-codified": { - "repo-name": "sanipueblo/law-xml-codified-preview" - }, - "sanipueb/law-html": { - "repo-name": "sanipueblo/law-html-preview", - "pull": "authenticated" - }, - "sanipueblo/law-docs": { - "repo-name": "sanipueblo/law-docs-preview", - "pull": "latest" - } - } - } - } + "custom": {} }, "state": { - "transient": { - "sanipueblo/law": {}, - "script1": { - "cityofsanamteo/law": "this is transient" - } - }, - "persistent": { - "script1": { - "cityofsanamteo/law": "this is persistent" - } - } + "transient": {}, + "persistent": {} }, "config": {} } \ No newline at end of file diff --git a/taf/tests/data/handler_inputs/valid/repo/failed_repo.json b/taf/tests/data/handler_inputs/valid/repo/failed_repo.json index 44e1fbf35..a2087773f 100644 --- a/taf/tests/data/handler_inputs/valid/repo/failed_repo.json +++ b/taf/tests/data/handler_inputs/valid/repo/failed_repo.json @@ -2,38 +2,38 @@ "update": { "changed": false, "event": "event/failed", - "repo_name": "cityofsanmateo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/portland/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\cityofsanmateo", + "conf_directory_root": "E:\\oll\\library\\test-update\\portland", "out_of_band_authentication": null, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "portland.oregon.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "portland/law-html": { + "repo-name": "portland/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "portland/law-xml-codified": { + "repo-name": "portland/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "portland/law-html": { + "repo-name": "portland/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "portland/law-docs": { + "repo-name": "portland/law-docs-preview", "pull": "latest" } } diff --git a/taf/tests/data/handler_inputs/valid/repo/succeeded_repo.json b/taf/tests/data/handler_inputs/valid/repo/succeeded_repo.json index b5fe04b50..59c5304a4 100644 --- a/taf/tests/data/handler_inputs/valid/repo/succeeded_repo.json +++ b/taf/tests/data/handler_inputs/valid/repo/succeeded_repo.json @@ -2,38 +2,38 @@ "update": { "changed": true, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/portland/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\cityofsanmateo", + "conf_directory_root": "E:\\oll\\library\\test-update\\portland", "out_of_band_authentication": null, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "portland.oregon.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "portland/law-html": { + "repo-name": "portland/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "portland/law-xml-codified": { + "repo-name": "portland/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "portland/law-html": { + "repo-name": "portland/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "portland/law-docs": { + "repo-name": "portland/law-docs-preview", "pull": "latest" } } @@ -51,12 +51,12 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-docs", + "name": "portland/law-docs", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "http://github.com/portland/portland-law-docs" ], "default_branch": "master", "custom": { @@ -84,12 +84,12 @@ } } }, - "cityofsanmateo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "http://github.com/portland/portland-law-xml" ], "default_branch": "master", "custom": { @@ -125,16 +125,16 @@ } } }, - "cityofsanmateo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "http://github.com/portland/portland-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "https://github.com/portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -161,16 +161,16 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + "http://github.com/portland/portland-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "https://github.com/portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -202,7 +202,7 @@ "library_dir": "E:\\oll\\library\\test-update", "name": "openlawlibrary/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + "http://github.com/portland/openlawlibrary-law-static-assets" ], "default_branch": "master", "custom": { diff --git a/taf/tests/data/handler_inputs/valid/repo/succeeded_unauthenticated_commits_repo.json b/taf/tests/data/handler_inputs/valid/repo/succeeded_unauthenticated_commits_repo.json index e061e5b61..c93459f65 100644 --- a/taf/tests/data/handler_inputs/valid/repo/succeeded_unauthenticated_commits_repo.json +++ b/taf/tests/data/handler_inputs/valid/repo/succeeded_unauthenticated_commits_repo.json @@ -2,38 +2,38 @@ "update": { "changed": false, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/portland/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\cityofsanmateo", + "conf_directory_root": "E:\\oll\\library\\test-update\\portland", "out_of_band_authentication": null, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "portland.oregon.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "portland/law-html": { + "repo-name": "portland/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "portland/law-xml-codified": { + "repo-name": "portland/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "portland/law-html": { + "repo-name": "portland/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "portland/law-docs": { + "repo-name": "portland/law-docs-preview", "pull": "latest" } } @@ -49,12 +49,12 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-docs", + "name": "portland/law-docs", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "http://github.com/portland/portland-law-docs" ], "default_branch": "master", "custom": { @@ -82,12 +82,12 @@ } } }, - "cityofsanmateo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "http://github.com/portland/portland-law-xml" ], "default_branch": "master", "custom": { @@ -162,16 +162,16 @@ } } }, - "cityofsanmateo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "http://github.com/portland/portland-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "https://github.com/portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -198,16 +198,16 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + "http://github.com/portland/portland-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "https://github.com/portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -239,7 +239,7 @@ "library_dir": "E:\\oll\\library\\test-update", "name": "openlawlibrary/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + "http://github.com/portland/openlawlibrary-law-static-assets" ], "default_branch": "master", "custom": { diff --git a/taf/tests/data/handler_inputs/valid/repo/succeeded_with_new_commits_repo.json b/taf/tests/data/handler_inputs/valid/repo/succeeded_with_new_commits_repo.json index b5fe04b50..59c5304a4 100644 --- a/taf/tests/data/handler_inputs/valid/repo/succeeded_with_new_commits_repo.json +++ b/taf/tests/data/handler_inputs/valid/repo/succeeded_with_new_commits_repo.json @@ -2,38 +2,38 @@ "update": { "changed": true, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/portland/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\cityofsanmateo", + "conf_directory_root": "E:\\oll\\library\\test-update\\portland", "out_of_band_authentication": null, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "portland.oregon.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "portland/law-html": { + "repo-name": "portland/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "portland/law-xml-codified": { + "repo-name": "portland/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "portland/law-html": { + "repo-name": "portland/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "portland/law-docs": { + "repo-name": "portland/law-docs-preview", "pull": "latest" } } @@ -51,12 +51,12 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-docs", + "name": "portland/law-docs", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "http://github.com/portland/portland-law-docs" ], "default_branch": "master", "custom": { @@ -84,12 +84,12 @@ } } }, - "cityofsanmateo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "http://github.com/portland/portland-law-xml" ], "default_branch": "master", "custom": { @@ -125,16 +125,16 @@ } } }, - "cityofsanmateo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "http://github.com/portland/portland-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "https://github.com/portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -161,16 +161,16 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + "http://github.com/portland/portland-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "https://github.com/portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -202,7 +202,7 @@ "library_dir": "E:\\oll\\library\\test-update", "name": "openlawlibrary/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + "http://github.com/portland/openlawlibrary-law-static-assets" ], "default_branch": "master", "custom": { diff --git a/taf/tests/data/handler_inputs/valid/repo/unchanged_repo.json b/taf/tests/data/handler_inputs/valid/repo/unchanged_repo.json index 797bf8edd..3f45b9e79 100644 --- a/taf/tests/data/handler_inputs/valid/repo/unchanged_repo.json +++ b/taf/tests/data/handler_inputs/valid/repo/unchanged_repo.json @@ -2,38 +2,38 @@ "update": { "changed": false, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law" + "http://github.com/portland/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "E:\\oll\\library\\test-update\\cityofsanmateo", + "conf_directory_root": "E:\\oll\\library\\test-update\\portland", "out_of_band_authentication": null, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "portland.oregon.open.law.vagrant": { "custom": { "subdomains": { "development": { - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-development" + "portland/law-html": { + "repo-name": "portland/law-html-development" } }, "preview": { - "cityofsanmateo/law-xml-codified": { - "repo-name": "cityofsanmateo/law-html-preview" + "portland/law-xml-codified": { + "repo-name": "portland/law-html-preview" }, - "cityofsanmateo/law-html": { - "repo-name": "cityofsanmateo/law-html-preview", + "portland/law-html": { + "repo-name": "portland/law-html-preview", "pull": "authenticated" }, - "cityofsanmateo/law-docs": { - "repo-name": "cityofsanmateo/law-docs-preview", + "portland/law-docs": { + "repo-name": "portland/law-docs-preview", "pull": "latest" } } @@ -49,12 +49,12 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-docs", + "name": "portland/law-docs", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "http://github.com/portland/portland-law-docs" ], "default_branch": "master", "custom": { @@ -82,12 +82,12 @@ } } }, - "cityofsanmateo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "http://github.com/portland/portland-law-xml" ], "default_branch": "master", "custom": { @@ -116,16 +116,16 @@ } } }, - "cityofsanmateo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "http://github.com/portland/portland-law-html" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "https://github.com/portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -152,16 +152,16 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "E:\\oll\\library\\test-update", - "name": "cityofsanmateo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + "http://github.com/portland/portland-law-xml-codified" ], "default_branch": "master", "custom": { - "preview": "https://github.com/oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "https://github.com/portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -193,7 +193,7 @@ "library_dir": "E:\\oll\\library\\test-update", "name": "openlawlibrary/law-static-assets", "urls": [ - "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + "http://github.com/portland/openlawlibrary-law-static-assets" ], "default_branch": "master", "custom": { diff --git a/taf/tests/data/handler_inputs/valid/update/update.json b/taf/tests/data/handler_inputs/valid/update/update.json new file mode 100644 index 000000000..9f39f0e9e --- /dev/null +++ b/taf/tests/data/handler_inputs/valid/update/update.json @@ -0,0 +1,862 @@ +{ + "update": { + "changed": false, + "event": "event/succeeded", + "error_msg": "", + "hosts": { + "houston.texas.us.open.law.vagrant": { + "host_name": "houston.texas.us.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "houstontexas/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "houstontexas/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law", + "urls": [ + "http://github.com/portland/houstontexas-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", + "out_of_band_authentication": null, + "hosts": { + "houston.texas.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "houstontexas/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml", + "urls": [ + "http://github.com/portland/houstontexas-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "houstontexas/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-html", + "urls": [ + "http://github.com/portland/houstontexas-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:portland/houstontexas-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "houstontexas/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml-codified", + "urls": [ + "http://github.com/portland/houstontexas-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:portland/houstontexas-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + }, + "custom": {} + } + } + }, + "custom": null + }, + "portland.oregon.open.law.vagrant": { + "host_name": "portland.oregon.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "portland/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "portland/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law", + "urls": [ + "http://github.com/portland/portland-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\portland", + "out_of_band_authentication": null, + "hosts": { + "portland.oregon.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "portland/law-html": { + "repo-name": "portland/law-html-development" + } + }, + "preview": { + "portland/law-xml-codified": { + "repo-name": "portland/law-html-preview" + }, + "portland/law-html": { + "repo-name": "portland/law-html-preview", + "pull": "authenticated" + }, + "portland/law-docs": { + "repo-name": "portland/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "portland/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-docs", + "urls": [ + "git@github.com:portland/portland-law-docs.git", + "http://github.com/portland/portland-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "portland/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml", + "urls": [ + "git@github.com:portland/portland-law-xml.git", + "http://github.com/portland/portland-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "portland/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-html", + "urls": [ + "git@github.com:portland/portland-law-html.git", + "http://github.com/portland/portland-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:portland/portland-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "portland/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml-codified", + "urls": [ + "git@github.com:portland/portland-law-xml-codified.git", + "http://github.com/portland/portland-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:portland/portland-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:portland/openlawlibrary-law-static-assets.git", + "http://github.com/portland/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + }, + "custom": {} + } + } + }, + "custom": { + "subdomains": { + "development": { + "portland/law-html": { + "repo-name": "portland/law-html-development" + } + }, + "preview": { + "portland/law-xml-codified": { + "repo-name": "portland/law-html-preview" + }, + "portland/law-html": { + "repo-name": "portland/law-html-preview", + "pull": "authenticated" + }, + "portland/law-docs": { + "repo-name": "portland/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "auth_repos": { + "portland/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "portland/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law", + "urls": [ + "http://github.com/portland/portland-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\portland", + "out_of_band_authentication": null, + "hosts": { + "portland.oregon.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "portland/law-html": { + "repo-name": "portland/law-html-development" + } + }, + "preview": { + "portland/law-xml-codified": { + "repo-name": "portland/law-html-preview" + }, + "portland/law-html": { + "repo-name": "portland/law-html-preview", + "pull": "authenticated" + }, + "portland/law-docs": { + "repo-name": "portland/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "portland/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-docs", + "urls": [ + "git@github.com:portland/portland-law-docs.git", + "http://github.com/portland/portland-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "portland/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml", + "urls": [ + "git@github.com:portland/portland-law-xml.git", + "http://github.com/portland/portland-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "portland/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-html", + "urls": [ + "git@github.com:portland/portland-law-html.git", + "http://github.com/portland/portland-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:portland/portland-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "portland/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "portland/law-xml-codified", + "urls": [ + "git@github.com:portland/portland-law-xml-codified.git", + "http://github.com/portland/portland-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:portland/portland-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:portland/openlawlibrary-law-static-assets.git", + "http://github.com/portland/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + } + }, + "houstontexas/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "houstontexas/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law", + "urls": [ + "http://github.com/portland/houstontexas-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", + "out_of_band_authentication": null, + "hosts": { + "houston.texas.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "houstontexas/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml", + "urls": [ + "http://github.com/portland/houstontexas-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "houstontexas/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-html", + "urls": [ + "http://github.com/portland/houstontexas-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:portland/houstontexas-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "houstontexas/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "houstontexas/law-xml-codified", + "urls": [ + "http://github.com/portland/houstontexas-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:portland/houstontexas-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + } + }, + "openlawlibrary/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "openlawlibrary/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law", + "urls": [ + "https://github.com/portland/openlawlibrary-law.git" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\openlawlibrary", + "out_of_band_authentication": null, + "hosts": {}, + "dependencies": { + "portland/law": { + "out-of-band-authentication": "bfcbc7db7adc3f43291a64b0572b6b114e63e98a" + }, + "houstontexas/law": { + "out-of-band-authentiction": "d7a6b796cffe53ad89b4504084402570b7d17f6b" + } + } + }, + "commits": { + "before_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef", + "new": [], + "after_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef" + } + }, + "target_repos": {} + } + }, + "auth_repo_name": "openlawlibrary/law" + }, + "state": { + "transient": {}, + "persistent": {} + }, + "config": {} +} \ No newline at end of file diff --git a/taf/tests/data/types/update/invalid/wrong_nested_field.json b/taf/tests/data/types/update/invalid/wrong_nested_field.json new file mode 100644 index 000000000..1cd2ec173 --- /dev/null +++ b/taf/tests/data/types/update/invalid/wrong_nested_field.json @@ -0,0 +1,857 @@ +{ + "wrong_nested_field": { + "changed": false, + "event": "event/succeeded", + "error_msg": "", + "hosts": { + "san-ildefonso.nsn.us.open.law.vagrant": { + "host_name": "san-ildefonso.nsn.us.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "sanipueblo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "sanipueblo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "out_of_band_authentication": null, + "hosts": { + "san-ildefonso.nsn.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "sanipueblo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-html", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml-codified", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + }, + "custom": {} + } + } + }, + "custom": null + }, + "sanmateo.ca.us.open.law.vagrant": { + "host_name": "sanmateo.ca.us.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "cityofsanmateo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "cityofsanmateo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law", + "urls": [ + "http://github.com/oll-test-repos/cityofsanmateo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\cityofsanmateo", + "out_of_band_authentication": null, + "hosts": { + "sanmateo.ca.us.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-development" + } + }, + "preview": { + "cityofsanmateo/law-xml-codified": { + "repo-name": "cityofsanmateo/law-html-preview" + }, + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-preview", + "pull": "authenticated" + }, + "cityofsanmateo/law-docs": { + "repo-name": "cityofsanmateo/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "cityofsanmateo/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-docs", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "cityofsanmateo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "cityofsanmateo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-html", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "cityofsanmateo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml-codified", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:oll-test-repos/openlawlibrary-law-static-assets.git", + "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + }, + "custom": {} + } + } + }, + "custom": { + "subdomains": { + "development": { + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-development" + } + }, + "preview": { + "cityofsanmateo/law-xml-codified": { + "repo-name": "cityofsanmateo/law-html-preview" + }, + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-preview", + "pull": "authenticated" + }, + "cityofsanmateo/law-docs": { + "repo-name": "cityofsanmateo/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "auth_repos": { + "cityofsanmateo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "cityofsanmateo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law", + "urls": [ + "http://github.com/oll-test-repos/cityofsanmateo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\cityofsanmateo", + "out_of_band_authentication": null, + "hosts": { + "sanmateo.ca.us.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-development" + } + }, + "preview": { + "cityofsanmateo/law-xml-codified": { + "repo-name": "cityofsanmateo/law-html-preview" + }, + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-preview", + "pull": "authenticated" + }, + "cityofsanmateo/law-docs": { + "repo-name": "cityofsanmateo/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "cityofsanmateo/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-docs", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "cityofsanmateo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "cityofsanmateo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-html", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "cityofsanmateo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml-codified", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:oll-test-repos/openlawlibrary-law-static-assets.git", + "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + } + }, + "sanipueblo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "sanipueblo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "out_of_band_authentication": null, + "hosts": { + "san-ildefonso.nsn.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "sanipueblo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-html", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml-codified", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + } + }, + "openlawlibrary/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "openlawlibrary/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law", + "urls": [ + "https://github.com/oll-test-repos/openlawlibrary-law.git" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\openlawlibrary", + "out_of_band_authentication": null, + "hosts": {}, + "dependencies": { + "cityofsanmateo/law": { + "out-of-band-authentication": "bfcbc7db7adc3f43291a64b0572b6b114e63e98a" + }, + "sanipueblo/law": { + "out-of-band-authentiction": "d7a6b796cffe53ad89b4504084402570b7d17f6b" + } + } + }, + "commits": { + "before_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef", + "new": [], + "after_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef" + } + }, + "target_repos": {} + } + }, + "auth_repo": "openlawlibrary/law" + } +} \ No newline at end of file diff --git a/taf/tests/data/types/update/valid/update_all_fields.json b/taf/tests/data/types/update/valid/update_all_fields.json new file mode 100644 index 000000000..41ebf51d5 --- /dev/null +++ b/taf/tests/data/types/update/valid/update_all_fields.json @@ -0,0 +1,855 @@ +{ + "changed": false, + "event": "event/succeeded", + "error_msg": "", + "hosts": { + "san-ildefonso.nsn.us.open.law.vagrant": { + "host_name": "san-ildefonso.nsn.us.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "sanipueblo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "sanipueblo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "out_of_band_authentication": null, + "hosts": { + "san-ildefonso.nsn.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "sanipueblo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-html", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml-codified", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + }, + "custom": {} + } + } + }, + "custom": null + }, + "sanmateo.ca.us.open.law.vagrant": { + "host_name": "sanmateo.ca.us.open.law.vagrant", + "error_msg": "", + "auth_repos": { + "update": { + "cityofsanmateo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "cityofsanmateo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law", + "urls": [ + "http://github.com/oll-test-repos/cityofsanmateo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\cityofsanmateo", + "out_of_band_authentication": null, + "hosts": { + "sanmateo.ca.us.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-development" + } + }, + "preview": { + "cityofsanmateo/law-xml-codified": { + "repo-name": "cityofsanmateo/law-html-preview" + }, + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-preview", + "pull": "authenticated" + }, + "cityofsanmateo/law-docs": { + "repo-name": "cityofsanmateo/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "cityofsanmateo/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-docs", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "cityofsanmateo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "cityofsanmateo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-html", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "cityofsanmateo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml-codified", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:oll-test-repos/openlawlibrary-law-static-assets.git", + "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + }, + "custom": {} + } + } + }, + "custom": { + "subdomains": { + "development": { + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-development" + } + }, + "preview": { + "cityofsanmateo/law-xml-codified": { + "repo-name": "cityofsanmateo/law-html-preview" + }, + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-preview", + "pull": "authenticated" + }, + "cityofsanmateo/law-docs": { + "repo-name": "cityofsanmateo/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "auth_repos": { + "cityofsanmateo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "cityofsanmateo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law", + "urls": [ + "http://github.com/oll-test-repos/cityofsanmateo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\cityofsanmateo", + "out_of_band_authentication": null, + "hosts": { + "sanmateo.ca.us.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-development" + } + }, + "preview": { + "cityofsanmateo/law-xml-codified": { + "repo-name": "cityofsanmateo/law-html-preview" + }, + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-preview", + "pull": "authenticated" + }, + "cityofsanmateo/law-docs": { + "repo-name": "cityofsanmateo/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "cityofsanmateo/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-docs", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "cityofsanmateo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "cityofsanmateo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-html", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "cityofsanmateo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml-codified", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:oll-test-repos/openlawlibrary-law-static-assets.git", + "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + } + }, + "sanipueblo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "sanipueblo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "out_of_band_authentication": null, + "hosts": { + "san-ildefonso.nsn.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "sanipueblo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-html", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml-codified", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + } + }, + "openlawlibrary/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "openlawlibrary/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law", + "urls": [ + "https://github.com/oll-test-repos/openlawlibrary-law.git" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\openlawlibrary", + "out_of_band_authentication": null, + "hosts": {}, + "dependencies": { + "cityofsanmateo/law": { + "out-of-band-authentication": "bfcbc7db7adc3f43291a64b0572b6b114e63e98a" + }, + "sanipueblo/law": { + "out-of-band-authentiction": "d7a6b796cffe53ad89b4504084402570b7d17f6b" + } + } + }, + "commits": { + "before_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef", + "new": [], + "after_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef" + } + }, + "target_repos": {} + } + }, + "auth_repo_name": "openlawlibrary/law" +} \ No newline at end of file diff --git a/taf/tests/data/types/update/valid/update_no_hosts.json b/taf/tests/data/types/update/valid/update_no_hosts.json new file mode 100644 index 000000000..8e00b1b62 --- /dev/null +++ b/taf/tests/data/types/update/valid/update_no_hosts.json @@ -0,0 +1,427 @@ +{ + "changed": false, + "event": "event/succeeded", + "error_msg": "", + "auth_repos": { + "cityofsanmateo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "cityofsanmateo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law", + "urls": [ + "http://github.com/oll-test-repos/cityofsanmateo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\cityofsanmateo", + "out_of_band_authentication": null, + "hosts": { + "sanmateo.ca.us.open.law.vagrant": { + "custom": { + "subdomains": { + "development": { + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-development" + } + }, + "preview": { + "cityofsanmateo/law-xml-codified": { + "repo-name": "cityofsanmateo/law-html-preview" + }, + "cityofsanmateo/law-html": { + "repo-name": "cityofsanmateo/law-html-preview", + "pull": "authenticated" + }, + "cityofsanmateo/law-docs": { + "repo-name": "cityofsanmateo/law-docs-preview", + "pull": "latest" + } + } + } + } + } + }, + "dependencies": {} + }, + "commits": { + "before_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3", + "new": [], + "after_pull": "2c0010a5db2c81ce4e810d3311dd637282d4f1a3" + } + }, + "target_repos": { + "cityofsanmateo/law-docs": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-docs", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + ], + "default_branch": "main", + "custom": { + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~/.*\\.pdf$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "after_pull": { + "commit": "de42cfe7f4ff0d93b854f9397cc95f0817867834", + "custom": { + "build-date": "2021-09-29" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "cityofsanmateo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "after_pull": { + "commit": "1cd086ecb8e23555379611abfff94137eda0f398", + "custom": { + "build-date": "2021-12-02" + } + }, + "new": [], + "unauthenticated": [ + "a5978b4b3bada811c9bf1fd5214b6c45e3f468b4", + "f496b5d247eba85a7028e5774cea65f16e786491", + "1e1ca36f3a58f8d01d4d63cb4b4884fa5e123cac", + "2a5e2fb3dceaa4c68de4edbdcbc12a98fa74c093" + ] + } + } + }, + "cityofsanmateo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-html", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "b5599f557fd8441d065b330d936998e9baeb767b", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "bc0a3af504eebee927b3cc09f95adc09e8c14fbd", + "9d8c4dc73fd6fec74d187d0c97a672f23a3d070e" + ] + } + } + }, + "cityofsanmateo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "cityofsanmateo/law-xml-codified", + "urls": [ + "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified.git", + "http://github.com/oll-test-repos/cityofsanmateo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2021-12-02-02": { + "before_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "after_pull": { + "commit": "0c3464d2e9255041d464221c932f7f8c1d4b3fc8", + "custom": { + "build-date": "2021-12-02", + "codified-date": "2021-12-15" + } + }, + "new": [], + "unauthenticated": [ + "8a5458a257135ec60548f61ae8b5e4f0b2eae247", + "a167f700a0a49e56a5d4787b05f1359d5a9c6905" + ] + } + } + }, + "openlawlibrary/law-static-assets": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law-static-assets", + "urls": [ + "git@github.com:oll-test-repos/openlawlibrary-law-static-assets.git", + "http://github.com/oll-test-repos/openlawlibrary-law-static-assets" + ], + "default_branch": "main", + "custom": { + "type": "static-assets", + "allow-unauthenticated-commits": true, + "serve": "latest", + "location_regex": "~.+(_document|_reader).+$" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "after_pull": { + "commit": "bd10b1a00eb070069239cf57c3cb890f5513dcb2", + "custom": { + "build-date": "2022-01-11" + } + }, + "new": [], + "unauthenticated": [ + "f68ba640be1c497d96e06c7dff031e7bcef8519d", + "a0f4d05e622ff7a3213629359797b4d54eb17082", + "1876150153e955a0eff89de507d4bd80e26d77e3", + "ed8d64c7cc9798e49a69e0223848944a7b0d3b2a", + "d4c47f1e90b0037b9432d0af9c9c641492c9c56f", + "40244afdbf3509c39e1d3af91578cb29aac35986" + ] + } + } + } + } + }, + "sanipueblo/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "sanipueblo/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "out_of_band_authentication": null, + "hosts": { + "san-ildefonso.nsn.us.open.law.vagrant": {} + }, + "dependencies": {} + }, + "commits": { + "before_pull": "3193db9de31df719ffaafd0ceed522ac199479e9", + "new": [], + "after_pull": "3193db9de31df719ffaafd0ceed522ac199479e9" + } + }, + "target_repos": { + "sanipueblo/law-xml": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml" + ], + "default_branch": "main", + "custom": { + "type": "xml", + "allow-unauthenticated-commits": true, + "serve": "latest", + "serve-prefix": "_uncodified_xml" + } + }, + "commits": { + "master": { + "before_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "after_pull": { + "commit": "34cd89e9113c707b5a30aa9026bc17fc7e9f0b4c", + "custom": { + "build-date": "2022-01-07" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-html": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-html", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-html" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "type": "html", + "serve": "historical", + "location_regex": "/" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "992b4cf8348762686b054cae77cfde4552205be3", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + }, + "sanipueblo/law-xml-codified": { + "repo_data": { + "library_dir": "C:\\OLL\\test1", + "name": "sanipueblo/law-xml-codified", + "urls": [ + "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + ], + "default_branch": "main", + "custom": { + "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "type": "xml-codified", + "serve": "historical", + "serve-prefix": "_xml" + } + }, + "commits": { + "publication/2022-01-07-03": { + "before_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "after_pull": { + "commit": "664fedc2daac96e296cf6833ac2e8f009956ba95", + "custom": { + "build-date": "2022-01-07", + "codified-date": "2021-08-30" + } + }, + "new": [], + "unauthenticated": [] + } + } + } + } + }, + "openlawlibrary/law": { + "changed": false, + "event": "event/succeeded", + "repo_name": "openlawlibrary/law", + "error_msg": "", + "auth_repo": { + "data": { + "library_dir": "C:\\OLL\\test1", + "name": "openlawlibrary/law", + "urls": [ + "https://github.com/oll-test-repos/openlawlibrary-law.git" + ], + "default_branch": "master", + "custom": {}, + "conf_directory_root": "C:\\OLL\\test1\\openlawlibrary", + "out_of_band_authentication": null, + "hosts": {}, + "dependencies": { + "cityofsanmateo/law": { + "out-of-band-authentication": "bfcbc7db7adc3f43291a64b0572b6b114e63e98a" + }, + "sanipueblo/law": { + "out-of-band-authentiction": "d7a6b796cffe53ad89b4504084402570b7d17f6b" + } + } + }, + "commits": { + "before_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef", + "new": [], + "after_pull": "024e1bb920bcfd64a4edbeeec7f1471a2acdabef" + } + }, + "target_repos": {} + } + }, + "auth_repo_name": "openlawlibrary/law" +} \ No newline at end of file diff --git a/taf/tests/test_schemas.py b/taf/tests/test_schemas.py index 8b7eb6bf2..acfe71424 100644 --- a/taf/tests/test_schemas.py +++ b/taf/tests/test_schemas.py @@ -3,12 +3,17 @@ from jsonschema import validate, RefResolver, Draft7Validator from jsonschema.exceptions import ValidationError from pathlib import Path -from taf.updater.schemas import repo_update_schema, host_update_schema +from taf.updater.schemas import ( + repo_update_schema, + host_update_schema, + update_update_schema, +) schema_store = { repo_update_schema["$id"]: repo_update_schema, host_update_schema["$id"]: host_update_schema, + update_update_schema["$id"]: update_update_schema, } @@ -27,6 +32,15 @@ def test_host_validation_valid(host_handlers_valid_inputs): validator.validate(handler_input_data) +def test_update_validation_valid(update_handlers_valid_inputs): + resolver = RefResolver.from_schema(update_update_schema, store=schema_store) + validator = Draft7Validator(update_update_schema, resolver=resolver) + + for handler_input_path in update_handlers_valid_inputs: + handler_input_data = json.loads(Path(handler_input_path).read_text()) + validator.validate(handler_input_data) + + def test_repo_validation_invalid(repo_handlers_invalid_inputs): for handler_input_path in repo_handlers_invalid_inputs: handler_input_data = json.loads(Path(handler_input_path).read_text()) @@ -42,3 +56,13 @@ def test_host_validation_invalid(host_handlers_invalid_inputs): handler_input_data = json.loads(Path(handler_input_path).read_text()) with pytest.raises(ValidationError): validator.validate(handler_input_data) + + +def test_update_validation_invalid(update_handlers_invalid_inputs): + resolver = RefResolver.from_schema(update_update_schema, store=schema_store) + validator = Draft7Validator(update_update_schema, resolver=resolver) + + for handler_input_path in update_handlers_invalid_inputs: + handler_input_data = json.loads(Path(handler_input_path).read_text()) + with pytest.raises(ValidationError): + validator.validate(handler_input_data) diff --git a/taf/tests/test_types.py b/taf/tests/test_types.py new file mode 100644 index 000000000..cab560854 --- /dev/null +++ b/taf/tests/test_types.py @@ -0,0 +1,38 @@ +import json +from taf.updater.types.update import Update +from pathlib import Path +from cattr import structure + + +def test_update_structure_valid(types_update_valid_inputs): + for handler_input_path in types_update_valid_inputs: + handler_input_data = json.loads(Path(handler_input_path).read_text()) + result = structure(handler_input_data, Update) + assert ( + Update( + changed=result.changed, + error_msg=result.error_msg, + event=result.event, + hosts=result.hosts, + auth_repos=result.auth_repos, + auth_repo_name="openlawlibrary/law", + ) + == result + ) + + +def test_update_structure_invalid(types_update_invalid_inputs): + for handler_input_path in types_update_invalid_inputs: + handler_input_data = json.loads(Path(handler_input_path).read_text()) + result = structure(handler_input_data, Update) + assert ( + Update( + changed=False, + event="", + error_msg="", + hosts={}, + auth_repos={}, + auth_repo_name="", + ) + == result + ) diff --git a/taf/updater/lifecycle_handlers.py b/taf/updater/lifecycle_handlers.py index 8cfa7798e..24d332b97 100644 --- a/taf/updater/lifecycle_handlers.py +++ b/taf/updater/lifecycle_handlers.py @@ -14,6 +14,8 @@ ) from taf.exceptions import ScriptExecutionError from taf.log import taf_logger +from taf.updater.types.update import Update +from cattr import structure class LifecycleStage(enum.Enum): @@ -112,6 +114,7 @@ def _execute_scripts(repos_and_data, lifecycle_stage, event): repos_and_data = _execute_scripts(repos_and_data, lifecycle_stage, event) elif event == Event.UNCHANGED: repos_and_data = _execute_scripts(repos_and_data, lifecycle_stage, event) + repos_and_data = _execute_scripts( repos_and_data, lifecycle_stage, Event.SUCCEEDED ) @@ -122,6 +125,13 @@ def _execute_scripts(repos_and_data, lifecycle_stage, event): _print_data(repos_and_data, library_dir, lifecycle_stage) repos_and_data = _execute_scripts(repos_and_data, lifecycle_stage, Event.COMPLETED) + # return formatted response if update lifecycle is done + if lifecycle_stage == LifecycleStage.UPDATE: + for _, data in repos_and_data.items(): + data = data["data"]["update"] + # example of converting data to classes. for now we're using cattrs default converters. + # TODO: goal is full support of class types + return structure(data, Update) # return transient data as it should be propagated to other event and handlers return { repo.name: data["data"]["state"]["transient"] @@ -131,6 +141,7 @@ def _execute_scripts(repos_and_data, lifecycle_stage, event): handle_repo_event = partial(_handle_event, LifecycleStage.REPO) handle_host_event = partial(_handle_event, LifecycleStage.HOST) +handle_update_event = partial(_handle_event, LifecycleStage.UPDATE) def execute_scripts(auth_repo, last_commit, scripts_rel_path, data, scripts_root_dir): @@ -171,7 +182,7 @@ def execute_scripts(auth_repo, last_commit, scripts_rel_path, data, scripts_root output = run("py", script_path, input=json_data) except subprocess.CalledProcessError as e: taf_logger.error( - "An error occurred while exeucuting {}: {}", script_path, e.output + "An error occurred while executing {}: {}", script_path, e.output ) raise ScriptExecutionError(script_path, e.output) if output is not None and output != "": @@ -282,8 +293,65 @@ def prepare_data_host( return host_data_by_repos -def prepare_data_completed(): - return {} +def prepare_data_update( + event, + transient_data, + persistent_data, + library_dir, + hosts, + repos_update_data, + error, + root_auth_repo, +): + + update_hosts = {} + all_auth_repos = {} + for auth_repo_name in repos_update_data: + all_auth_repos[auth_repo_name] = _repo_update_data( + **repos_update_data[auth_repo_name] + ) + + for host_data in hosts: + auth_repos = {} + for _, contained_repo_data in host_data.data_by_auth_repo.items(): + for host_auth_repos in contained_repo_data["auth_repos"]: + for repo_name, repo_host_data in host_auth_repos.items(): + auth_repo = {} + auth_repo[repo_name] = _repo_update_data( + **repos_update_data[repo_name] + ) + auth_repo[repo_name]["custom"] = repo_host_data["custom"] + auth_repos["update"] = auth_repo + + update_hosts[host_data.name] = { + "host_name": host_data.name, + "error_msg": str(error) if error else "", + "auth_repos": auth_repos, + "custom": contained_repo_data["custom"], + } + + return { + root_auth_repo: { + "data": { + "update": { + "changed": event == Event.CHANGED, + "event": _format_event(event), + "error_msg": str(error) if error else "", + "hosts": update_hosts, + "auth_repos": all_auth_repos, + "auth_repo_name": root_auth_repo.name, + }, + "state": { + "transient": transient_data, + "persistent": persistent_data, + }, + "config": get_config(library_dir), + }, + "commit": repos_update_data[root_auth_repo.name]["commits_data"][ + "after_pull" + ], + } + } def _repo_update_data(auth_repo, update_status, commits_data, targets_data, error): diff --git a/taf/updater/schemas.py b/taf/updater/schemas.py index 1ca584506..4daf5e263 100644 --- a/taf/updater/schemas.py +++ b/taf/updater/schemas.py @@ -6,7 +6,7 @@ "properties": { "library_dir": { "title": "Library's Root Directory", - "descirption": "Library's root directory. Repository's name is appended to it to form the full path", + "description": "Library's root directory. Repository's name is appended to it to form the full path", "type": "string", }, "name": { @@ -52,7 +52,7 @@ auth_repo_schema = { "description": "All information about an authentication repository coupled with update details", "type": "object", - "title": "Authentication Rpository with Update Details", + "title": "Authentication Repository with Update Details", "properties": { "data": { "description": "All properties of the authentication repository. Can be used to instantiate the AuthenticationRepository", @@ -72,7 +72,7 @@ }, "out_of_band_authentication": { "title": "Out of Band Authentication", - "description": "Commit used to check the authentication repository's validity. Supposed to be uqual to the first commit", + "description": "Commit used to check the authentication repository's validity. Supposed to be equal to the first commit", "type": ["string", "null"], }, "hosts": { @@ -86,7 +86,7 @@ "properties": { "custom": { "title": "Custom", - "descirption": "Any information required for futher processing. Not used by the framework", + "description": "Any information required for futher processing. Not used by the framework", "type": "object", } }, @@ -335,3 +335,89 @@ "required": ["update"], "additionalProperties": False, } + +update_update_schema = { + "type": "object", + "$id": "update_update.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Update Handlers Input", + "properties": { + "update": { + "description": "All information related to the update process of update - last handler (containing all authentication repositories linked to all host)", + "type": "object", + "title": "Update data", + "properties": { + "changed": { + "title": "Change Indicator", + "description": "Indicates if at least one of the host's repositories was updated (will be false if pull was successful, but there were no new commits)", + "type": "boolean", + }, + "event": { + "title": "Update Event", + "description": "Event type - succeeded, changed, unchanged, failed, completed", + "type": "string", + }, + "error_msg": { + "title": "Error message", + "description": "Error message that was raised while updating the host's repositories", + "type": "string", + }, + "hosts": { + "title": "Hosts", + "description": "Dictionary of hosts whose update was attempted", + "type": "object", + "patternProperties": { + "^.*$": { + "title": "Single Host", + "type": "object", + "items": {"$ref": "update_update.schema.json#"}, + } + }, + }, + "auth_repos": { + "title": "Authentication Repositories with a flat structure", + "type": "object", + "items": {"$ref": "repo_update.schema.json#"}, + }, + "auth_repo_name": { + "title": "Name", + "description": "Name of authentication repository that was called by the updater", + "type": "string", + }, + }, + "required": [ + "changed", + "event", + "hosts", + "error_msg", + "auth_repos", + "auth_repo_name", + ], + "additionalProperties": False, + }, + "state": { + "title": "State", + "description": "Persistent and transient states", + "type": "object", + "properties": { + "transient": { + "title": "Transient", + "type": "object", + "description": "Transient data is arbitrary data passed from one script execution to the next one. It is discarded at the end of the process", + }, + "persistent": { + "title": "Persistent", + "type": "object", + "description": "Persistent data is arbitrary date passed from one script execution the next one and stored to disk (to a file called persistent.json directly inside the library root)", + }, + }, + }, + "config": { + "title": "Configuration data", + "description": "Additional configuration, loaded from config.json located inside the library root", + "type": "object", + }, + }, + "required": ["update"], + "additionalProperties": False, +} diff --git a/taf/updater/types/update.py b/taf/updater/types/update.py new file mode 100644 index 000000000..7e62508e7 --- /dev/null +++ b/taf/updater/types/update.py @@ -0,0 +1,12 @@ +from attrs import define, field +from typing import Dict + + +@define +class Update: + changed: bool = field(default=False) + event: str = field(default="") + error_msg: str = field(default="") + hosts: Dict = field(factory=dict) + auth_repos: Dict = field(factory=dict) + auth_repo_name: str = field(default="") diff --git a/taf/updater/updater.py b/taf/updater/updater.py index c464d9188..dca50d503 100644 --- a/taf/updater/updater.py +++ b/taf/updater/updater.py @@ -22,9 +22,19 @@ ) from taf.updater.handlers import GitUpdater from taf.utils import on_rm_error -from taf.hosts import load_hosts_json, set_hosts_of_repo, load_hosts, get_hosts -from taf.updater.lifecycle_handlers import handle_repo_event, handle_host_event, Event - +from taf.hosts import ( + load_hosts_json, + set_hosts_of_repo, + load_hosts, + get_hosts, +) +from taf.updater.lifecycle_handlers import ( + handle_repo_event, + handle_host_event, + handle_update_event, + Event, +) +from cattr import unstructure disable_tuf_console_logging() @@ -35,6 +45,29 @@ class UpdateType(enum.Enum): EITHER = "either" +def _check_update_status(repos_update_data, auth_repo_name, host_update_status, errors): + # helper function to set update status of update handler based on repo or host status. + # if either hosts or repo handlers event status changed, + # change the update handler status + repo_status = repos_update_data[auth_repo_name]["update_status"] + repo_error = repos_update_data[auth_repo_name]["error"] + + update_update_status = Event.UNCHANGED + + if ( + repo_status != update_update_status + and update_update_status == host_update_status + ): + update_update_status = repo_status + + if repos_update_data[auth_repo_name]["error"] is not None: + repo_error = repos_update_data[auth_repo_name]["error"] + errors += str(repo_error) + else: + update_update_status = host_update_status + return update_update_status, errors + + def _execute_repo_handlers( update_status, auth_repo, @@ -75,6 +108,8 @@ def _load_hosts_json(auth_repo): # TODO config path should be configurable + + def load_library_context(config_path): config = {} config_path = Path(config_path) @@ -217,6 +252,8 @@ def update_repository( hosts = get_hosts() host_update_status = Event.UNCHANGED errors = "" + update_transient_data = {} + for host in hosts: # check if host update was successful - meaning that all repositories # of that host were updated successfully @@ -231,7 +268,7 @@ def update_repository( and host_update_status != Event.FAILED ): # if one failed, then failed - # else if one changed, then chenged + # else if one changed, then changed # else unchanged host_update_status = update_status repo_error = host_repo_update_data["error"] @@ -239,6 +276,9 @@ def update_repository( errors += str(repo_error) if host_repo_name in transient_data: host_transient_data[host_repo_name] = transient_data[host_repo_name] + update_transient_data[host_repo_name] = host_transient_data[ + host_repo_name + ] handle_host_event( host_update_status, @@ -249,9 +289,27 @@ def update_repository( repos_update_data, errors, ) + + update_update_status, errors = _check_update_status( + repos_update_data, auth_repo_name, host_update_status, errors + ) + + update_data = handle_update_event( + update_update_status, + update_transient_data, + root_auth_repo.library_dir, + scripts_root_dir, + hosts, + repos_update_data, + errors, + root_auth_repo, + ) + if root_error: raise root_error + return unstructure(update_data) + def _update_named_repository( url, @@ -354,7 +412,6 @@ def _update_named_repository( out_of_band_authentication, checkout, ) - # if commits_data is empty, do not attempt to load the host or dependencies # that can happen in the repository didn't exists, but could not be validated # and was therefore deleted @@ -395,6 +452,7 @@ def _update_named_repository( hosts_hierarchy_per_repo[child_auth_repo.name] = list( hosts_hierarchy_per_repo[auth_repo.name] ) + try: _update_named_repository( child_auth_repo.urls[0], @@ -457,7 +515,6 @@ def _update_named_repository( targets_data, transient_data, ) - if repos_update_data is not None: repos_update_data[auth_repo.name] = { "auth_repo": auth_repo,