From cdde3d68aca996e6f3fafb12d971ba2219d0ec8c Mon Sep 17 00:00:00 2001 From: n-dusan Date: Tue, 4 Jan 2022 13:41:14 +0100 Subject: [PATCH 01/17] feat: add update partial --- taf/updater/lifecycle_handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taf/updater/lifecycle_handlers.py b/taf/updater/lifecycle_handlers.py index 8cfa7798..9b0e4a03 100644 --- a/taf/updater/lifecycle_handlers.py +++ b/taf/updater/lifecycle_handlers.py @@ -131,7 +131,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): persistent_path = auth_repo.library_dir / PERSISTENT_FILE_NAME From 6dcb655676b5f192da958b0ee850a1729a0b945d Mon Sep 17 00:00:00 2001 From: n-dusan Date: Wed, 19 Jan 2022 00:07:47 +0100 Subject: [PATCH 02/17] feat: prepare data for update lifecycle Since the last handler that's missing is the UPDATE, implemented: * prepare_data without existing hosts. Example: repo handler is called, and hosts aren't defined. Return a JSON structure that's similar to HOSTS lifecycle. * prepare_data with existing hosts. Example: repo handler and hosts are called. Return a JSON structure that includes both repos and hosts data. --- taf/updater/lifecycle_handlers.py | 99 +++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/taf/updater/lifecycle_handlers.py b/taf/updater/lifecycle_handlers.py index 9b0e4a03..eeb0334b 100644 --- a/taf/updater/lifecycle_handlers.py +++ b/taf/updater/lifecycle_handlers.py @@ -122,6 +122,8 @@ 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) + if lifecycle_stage == LifecycleStage.UPDATE: + return repos_and_data # return transient data as it should be propagated to other event and handlers return { repo.name: data["data"]["state"]["transient"] @@ -133,6 +135,7 @@ def _execute_scripts(repos_and_data, lifecycle_stage, event): 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): persistent_path = auth_repo.library_dir / PERSISTENT_FILE_NAME # do not load the script from the file system @@ -282,6 +285,31 @@ def prepare_data_host( return host_data_by_repos +def prepare_data_update( + event, + transient_data, + persistent_data, + library_dir, + repo, + repos_update_data, + error, + skip_hosts, + root_auth_repo +): + + prepared_data = {} + + if skip_hosts is True: + prepared_data = _format_update_without_host( + repos_update_data, repo, event, error, transient_data, persistent_data, library_dir, root_auth_repo) + else: + + prepared_data = _format_update( + repo, repos_update_data, event, error, transient_data, persistent_data, library_dir, root_auth_repo) + + return prepared_data + + def prepare_data_completed(): return {} @@ -312,3 +340,74 @@ def _format_event(event): return f"event/{Event.SUCCEEDED.value}" else: return f"event/{Event.FAILED.value}" + + +def _format_update_without_host(repos_update_data, repo, event, error, transient_data, persistent_data, library_dir, root_auth_repo): + update_data_by_repos = {} + auth_repos = [] + for repo_name, repo_data in repos_update_data.items(): + repo_data = _repo_update_data(**repos_update_data[repo_name]) + auth_repos.append({"update": repo_data}) + + update_data_by_repos[repo] = { + "data": { + "update": { + "changed": event == Event.CHANGED, + "event": _format_event(event), + "error_msg": str(error) if error else "", + "hosts": { + "auth_repos": auth_repos, + "custom": repo_data["auth_repo"]["data"]["custom"], + } + }, + "state": { + "transient": transient_data, + "persistent": persistent_data, + }, + "config": get_config(library_dir), + }, + "commit": repos_update_data[repo_name]["commits_data"][ + "after_pull" + ], + } + return update_data_by_repos + + +def _format_update(repo, repos_update_data, event, error, transient_data, persistent_data, library_dir, root_auth_repo): + update_hosts = [] + for host in repo: + for root_repo, contained_repo_data in host.data_by_auth_repo.items(): + auth_repos = [] + for host_auth_repos in contained_repo_data["auth_repos"]: + for repo_name, repo_host_data in host_auth_repos.items(): + repo_data = _repo_update_data(**repos_update_data[repo_name]) + repo_data["custom"] = repo_host_data["custom"] + auth_repos.append({"update": repo_data}) + + update_hosts.append({ + "host_name": host.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, + }, + "state": { + "transient": transient_data, + "persistent": persistent_data, + }, + "config": get_config(library_dir), + }, + "commit": repos_update_data[root_auth_repo.name]["commits_data"][ + "after_pull" + ], + } + } From 64eaebd4fd19814e3792d520e3e0c49164a16599 Mon Sep 17 00:00:00 2001 From: n-dusan Date: Fri, 28 Jan 2022 04:11:16 +0100 Subject: [PATCH 03/17] refactor: minor fixes to wording and consistency --- taf/repositoriesdb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/taf/repositoriesdb.py b/taf/repositoriesdb.py index ecf15935..02a3e909 100644 --- a/taf/repositoriesdb.py +++ b/taf/repositoriesdb.py @@ -120,7 +120,7 @@ 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( @@ -358,14 +358,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 = ( From 1e066a7119af80307a71fada83f07701b3932401 Mon Sep 17 00:00:00 2001 From: n-dusan Date: Fri, 28 Jan 2022 04:13:51 +0100 Subject: [PATCH 04/17] feat: add dependency field to auth repo The dependency field is read from dependencies.json and is mapped to the root authentication repository that contains it. * refactor loading hosts and dependencies into a wrapper that calls the same function. --- taf/auth_repo.py | 16 ++++++++++++++++ taf/hosts.py | 11 ++++++++++- taf/updater/updater.py | 15 +++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/taf/auth_repo.py b/taf/auth_repo.py index 8ba61ed4..ec2ea767 100644 --- a/taf/auth_repo.py +++ b/taf/auth_repo.py @@ -34,6 +34,7 @@ def __init__( out_of_band_authentication=None, hosts=None, path=None, + dependencies=None, *args, **kwargs, ): @@ -68,6 +69,7 @@ def __init__( # this repository's hosts file specifying its hosts # in other words, propagate hosts data from parent to the child repository self.hosts = hosts + self.dependencies = dependencies # TODO rework conf_dir @@ -79,6 +81,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 @@ -183,6 +186,19 @@ def set_last_validated_commit(self, commit): self._log_debug(f"setting last validated commit to: {commit}") Path(self.conf_dir, self.LAST_VALIDATED_FILENAME).write_text(commit) + def set_dependencies(self, dependencies): + """ + Set dependencies.json content to authentication repository. + If the dependencies.json is empty, field is empty. + """ + deps = {} + for dependency_info in dependencies.values(): + for dependency_name, dependency_data in dependency_info.items(): + if len(dependency_data): + deps[dependency_name] = dependency_data + + self.dependencies = deps + def sorted_commits_and_branches_per_repositories( self, commits, target_repos=None, custom_fns=None, default_branch=None ): diff --git a/taf/hosts.py b/taf/hosts.py index 559917ba..b03d318f 100644 --- a/taf/hosts.py +++ b/taf/hosts.py @@ -137,10 +137,19 @@ def set_hosts_of_repo(auth_repo, hosts): def load_hosts_json(auth_repo, commit=None): + return _load_json(auth_repo, commit, path=HOSTS_JSON_PATH) + + +def load_dependencies_json(auth_repo, commit=None): + return _load_json(auth_repo, commit, path=DEPENDENCIES_JSON_PATH) + + +def _load_json(auth_repo, commit=None, path=None): if commit is None: commit = auth_repo.top_commit_of_branch(auth_repo.default_branch) try: - return _get_json_file(auth_repo, HOSTS_JSON_PATH, commit) + if path in (DEPENDENCIES_JSON_PATH, HOSTS_JSON_PATH, MIRRORS_JSON_PATH, REPOSITORIES_JSON_PATH): + return _get_json_file(auth_repo, path, commit) except MissingHostsError: return {} diff --git a/taf/updater/updater.py b/taf/updater/updater.py index c464d918..b4d3d79a 100644 --- a/taf/updater/updater.py +++ b/taf/updater/updater.py @@ -74,7 +74,19 @@ def _load_hosts_json(auth_repo): raise UpdateFailedError(str(e)) +def _load_dependencies_json(auth_repo): + try: + return load_dependencies_json(auth_repo) + except MissingHostsError as e: + # if a there is no host file, the update should not fail + taf_logger.info(str(e)) + return {} + except InvalidHostsError as e: + raise UpdateFailedError(str(e)) + # TODO config path should be configurable + + def load_library_context(config_path): config = {} config_path = Path(config_path) @@ -384,6 +396,9 @@ def _update_named_repository( commits=commits, ) + # read dependencies.json and set them to the parent authentication repository + auth_repo.set_dependencies(_load_dependencies_json(auth_repo)) + if update_status != Event.FAILED: errors = [] # load the repositories from dependencies.json and update these repositories From 898fa79267d1a048b0fec9b12b0ad4378ebe4128 Mon Sep 17 00:00:00 2001 From: n-dusan Date: Fri, 28 Jan 2022 12:37:10 -0700 Subject: [PATCH 05/17] refactor: rework prepare update data --- taf/updater/lifecycle_handlers.py | 129 +++++++++++------------------- 1 file changed, 46 insertions(+), 83 deletions(-) diff --git a/taf/updater/lifecycle_handlers.py b/taf/updater/lifecycle_handlers.py index eeb0334b..c41c0774 100644 --- a/taf/updater/lifecycle_handlers.py +++ b/taf/updater/lifecycle_handlers.py @@ -174,7 +174,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 != "": @@ -290,24 +290,58 @@ def prepare_data_update( transient_data, persistent_data, library_dir, - repo, + hosts, repos_update_data, error, - skip_hosts, root_auth_repo ): - prepared_data = {} + update_hosts = {} + flat_auth_repos = {} + for auth_repo_name in repos_update_data.keys(): + flat_auth_repos[auth_repo_name] = _repo_update_data( + **repos_update_data[auth_repo_name]) - if skip_hosts is True: - prepared_data = _format_update_without_host( - repos_update_data, repo, event, error, transient_data, persistent_data, library_dir, root_auth_repo) - else: - - prepared_data = _format_update( - repo, repos_update_data, event, error, transient_data, persistent_data, library_dir, root_auth_repo) + for host_data in hosts: + auth_repos = {} + for root_repo, 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({"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 prepared_data + 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": flat_auth_repos, + "auth_repo": 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 prepare_data_completed(): @@ -340,74 +374,3 @@ def _format_event(event): return f"event/{Event.SUCCEEDED.value}" else: return f"event/{Event.FAILED.value}" - - -def _format_update_without_host(repos_update_data, repo, event, error, transient_data, persistent_data, library_dir, root_auth_repo): - update_data_by_repos = {} - auth_repos = [] - for repo_name, repo_data in repos_update_data.items(): - repo_data = _repo_update_data(**repos_update_data[repo_name]) - auth_repos.append({"update": repo_data}) - - update_data_by_repos[repo] = { - "data": { - "update": { - "changed": event == Event.CHANGED, - "event": _format_event(event), - "error_msg": str(error) if error else "", - "hosts": { - "auth_repos": auth_repos, - "custom": repo_data["auth_repo"]["data"]["custom"], - } - }, - "state": { - "transient": transient_data, - "persistent": persistent_data, - }, - "config": get_config(library_dir), - }, - "commit": repos_update_data[repo_name]["commits_data"][ - "after_pull" - ], - } - return update_data_by_repos - - -def _format_update(repo, repos_update_data, event, error, transient_data, persistent_data, library_dir, root_auth_repo): - update_hosts = [] - for host in repo: - for root_repo, contained_repo_data in host.data_by_auth_repo.items(): - auth_repos = [] - for host_auth_repos in contained_repo_data["auth_repos"]: - for repo_name, repo_host_data in host_auth_repos.items(): - repo_data = _repo_update_data(**repos_update_data[repo_name]) - repo_data["custom"] = repo_host_data["custom"] - auth_repos.append({"update": repo_data}) - - update_hosts.append({ - "host_name": host.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, - }, - "state": { - "transient": transient_data, - "persistent": persistent_data, - }, - "config": get_config(library_dir), - }, - "commit": repos_update_data[root_auth_repo.name]["commits_data"][ - "after_pull" - ], - } - } From ebcf67bb985f4d0cb7f03f196da4a0a4f76b08d0 Mon Sep 17 00:00:00 2001 From: n-dusan Date: Fri, 28 Jan 2022 15:15:00 -0700 Subject: [PATCH 06/17] feat: include update handler schema --- taf/updater/schemas.py | 87 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 4 deletions(-) diff --git a/taf/updater/schemas.py b/taf/updater/schemas.py index 1ca58450..144c9802 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,82 @@ "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": { + "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"], + "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, +} From 6930eb9198b253404fc3d53d5f8dfb7663937a5e Mon Sep 17 00:00:00 2001 From: n-dusan Date: Sat, 29 Jan 2022 09:32:34 -0700 Subject: [PATCH 07/17] feat: add tests for update handler schema --- taf/tests/conftest.py | 18 ++++++++++++++++++ taf/tests/test_schemas.py | 22 +++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/taf/tests/conftest.py b/taf/tests/conftest.py index 5dbb1d96..dacd5e70 100644 --- a/taf/tests/conftest.py +++ b/taf/tests/conftest.py @@ -34,8 +34,10 @@ HANDLERS_DATA_INPUT_DIR = TEST_DATA_PATH / "handler_inputs" 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): @@ -181,6 +183,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 +207,14 @@ 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/test_schemas.py b/taf/tests/test_schemas.py index 8b7eb6bf..3704d222 100644 --- a/taf/tests/test_schemas.py +++ b/taf/tests/test_schemas.py @@ -3,12 +3,13 @@ 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 +28,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 +52,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) From 716588ed4f5edf3e6d41cdb631a558d48866ad9d Mon Sep 17 00:00:00 2001 From: n-dusan Date: Sat, 29 Jan 2022 14:23:12 -0700 Subject: [PATCH 08/17] new: introduce update class type [wip] * Map specific attributes from a handler dictionary to class types. Initial work on setting up a class. Using cattrs dependency --- taf/updater/types/update.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 taf/updater/types/update.py diff --git a/taf/updater/types/update.py b/taf/updater/types/update.py new file mode 100644 index 00000000..1f9bfb4f --- /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: str = field(default='') From beb1d53c230f0603e61839da211175469e2447eb Mon Sep 17 00:00:00 2001 From: n-dusan Date: Sat, 29 Jan 2022 14:32:37 -0700 Subject: [PATCH 09/17] use cattrs --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bc5a9a7f..b420b5a3 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, From 57f1c1086b62c3c1e0f9415e45b8cac91be3444f Mon Sep 17 00:00:00 2001 From: n-dusan Date: Sat, 29 Jan 2022 15:02:04 -0700 Subject: [PATCH 10/17] feat: map dict els to update class --- taf/tests/conftest.py | 20 ++++++++++++++++++ taf/updater/lifecycle_handlers.py | 10 ++++++++- taf/updater/updater.py | 35 +++++++++++++++++++++++-------- 3 files changed, 55 insertions(+), 10 deletions(-) diff --git a/taf/tests/conftest.py b/taf/tests/conftest.py index dacd5e70..1b0035dd 100644 --- a/taf/tests/conftest.py +++ b/taf/tests/conftest.py @@ -32,6 +32,10 @@ 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" @@ -167,6 +171,22 @@ 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""" diff --git a/taf/updater/lifecycle_handlers.py b/taf/updater/lifecycle_handlers.py index c41c0774..6b82e571 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,8 +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: - return repos_and_data + 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"] diff --git a/taf/updater/updater.py b/taf/updater/updater.py index b4d3d79a..5c9c46e3 100644 --- a/taf/updater/updater.py +++ b/taf/updater/updater.py @@ -1,4 +1,5 @@ import json +from logging import root import shutil import enum @@ -22,9 +23,9 @@ ) 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_dependencies_json, 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() @@ -229,6 +230,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 @@ -243,7 +246,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"] @@ -251,6 +254,7 @@ 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, @@ -261,9 +265,23 @@ def update_repository( repos_update_data, errors, ) + + update_data = handle_update_event( + host_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, @@ -366,7 +384,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 @@ -410,6 +427,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], @@ -472,7 +490,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, @@ -915,7 +932,7 @@ def _get_commits( # check which commits are newer that the previous head commit if old_head in fetched_commits: new_commits_on_repo_branch = fetched_commits[ - fetched_commits.index(old_head) + 1 : : + fetched_commits.index(old_head) + 1:: ] else: new_commits_on_repo_branch = repository.all_commits_since_commit( @@ -1102,7 +1119,7 @@ def _update_target_repository( if commit == target_commits[-1]: update_successful = True if commit != new_commits[-1]: - additional_commits = new_commits[new_commit_index + 1 :] + additional_commits = new_commits[new_commit_index + 1:] break if len(additional_commits): taf_logger.warning( @@ -1133,7 +1150,7 @@ def _update_target_repository( branch_current_head = repository.top_commit_of_branch(branch) if branch_current_head in additional_commits: additional_commits = additional_commits[ - additional_commits.index(branch_current_head) + 1 : + additional_commits.index(branch_current_head) + 1: ] return additional_commits From c0f2902d65562a5fe8cd43261630df058623d673 Mon Sep 17 00:00:00 2001 From: n-dusan Date: Sat, 29 Jan 2022 19:17:14 -0700 Subject: [PATCH 11/17] add tests for structuring --- .../update/invalid/wrong_nested_field.json | 857 ++++++++++++++++++ .../types/update/valid/update_all_fields.json | 855 +++++++++++++++++ .../types/update/valid/update_no_hosts.json | 427 +++++++++ taf/tests/test_types.py | 20 + 4 files changed, 2159 insertions(+) create mode 100644 taf/tests/data/types/update/invalid/wrong_nested_field.json create mode 100644 taf/tests/data/types/update/valid/update_all_fields.json create mode 100644 taf/tests/data/types/update/valid/update_no_hosts.json create mode 100644 taf/tests/test_types.py 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 00000000..1cd2ec17 --- /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 00000000..12a906e7 --- /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": "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 00000000..ce6b3d10 --- /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": "openlawlibrary/law" +} \ No newline at end of file diff --git a/taf/tests/test_types.py b/taf/tests/test_types.py new file mode 100644 index 00000000..eeaee878 --- /dev/null +++ b/taf/tests/test_types.py @@ -0,0 +1,20 @@ +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='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='') == result From 4dcbfdcd7a3e1465bb99e0899c332e4dc4c9f9ec Mon Sep 17 00:00:00 2001 From: n-dusan Date: Sat, 29 Jan 2022 20:17:14 -0700 Subject: [PATCH 12/17] feat: add tests for update schema --- .../update/array_instead_of_object.json | 896 ++++++++++++++++++ .../update/required_field_missing.json | 471 +++++++++ .../handler_inputs/valid/update/update.json | 892 +++++++++++++++++ 3 files changed, 2259 insertions(+) create mode 100644 taf/tests/data/handler_inputs/invalid/update/array_instead_of_object.json create mode 100644 taf/tests/data/handler_inputs/invalid/update/required_field_missing.json create mode 100644 taf/tests/data/handler_inputs/valid/update/update.json 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 00000000..f1b30632 --- /dev/null +++ b/taf/tests/data/handler_inputs/invalid/update/array_instead_of_object.json @@ -0,0 +1,896 @@ +{ + "update": { + "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" + }, + "state": { + "transient": { + "sanipueblo/law": { + "script1": { + "sanipueblo/law": "this is transient" + }, + "script2": { + "sanipueblo/law": "this is transient" + } + }, + "cityofsanmateo/law": { + "script1": { + "sanipueblo/law": "this is transient" + }, + "script2": { + "sanipueblo/law": "this is transient" + } + }, + "script1": { + "cityofsanamteo/law": "this is transient" + }, + "script2": { + "cityofsanamteo/law": "this is transient" + } + }, + "persistent": { + "script1": { + "cityofsanamteo/law": "this is persistent" + }, + "script2": { + "cityofsanamteo/law": "this is 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 00000000..7af0267f --- /dev/null +++ b/taf/tests/data/handler_inputs/invalid/update/required_field_missing.json @@ -0,0 +1,471 @@ +{ + "update": { + "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_repo": "openlawlibrary/law" + }, + "state": { + "transient": { + "sanipueblo/law": { + "script1": { + "sanipueblo/law": "this is transient" + }, + "script2": { + "sanipueblo/law": "this is transient" + } + }, + "cityofsanmateo/law": { + "script1": { + "sanipueblo/law": "this is transient" + }, + "script2": { + "sanipueblo/law": "this is transient" + } + }, + "script1": { + "cityofsanamteo/law": "this is transient" + }, + "script2": { + "cityofsanamteo/law": "this is transient" + } + }, + "persistent": { + "script1": { + "cityofsanamteo/law": "this is persistent" + }, + "script2": { + "cityofsanamteo/law": "this is persistent" + } + } + }, + "config": {} +} \ No newline at end of file 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 00000000..c409df59 --- /dev/null +++ b/taf/tests/data/handler_inputs/valid/update/update.json @@ -0,0 +1,892 @@ +{ + "update": { + "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" + }, + "state": { + "transient": { + "sanipueblo/law": { + "script1": { + "sanipueblo/law": "this is transient" + }, + "script2": { + "sanipueblo/law": "this is transient" + } + }, + "cityofsanmateo/law": { + "script1": { + "sanipueblo/law": "this is transient" + }, + "script2": { + "sanipueblo/law": "this is transient" + } + }, + "script1": { + "cityofsanamteo/law": "this is transient" + }, + "script2": { + "cityofsanamteo/law": "this is transient" + } + }, + "persistent": { + "script1": { + "cityofsanamteo/law": "this is persistent" + }, + "script2": { + "cityofsanamteo/law": "this is persistent" + } + } + }, + "config": {} +} \ No newline at end of file From d3641d2b2d0f90c23c30d4a8a0f0dc78c0dc5b84 Mon Sep 17 00:00:00 2001 From: n-dusan Date: Mon, 31 Jan 2022 15:29:12 +0100 Subject: [PATCH 13/17] docs: update and numbering --- CHANGELOG.md | 70 ++++--------------------------- taf/auth_repo.py | 4 +- taf/hosts.py | 7 +++- taf/repositoriesdb.py | 6 ++- taf/tests/conftest.py | 11 ++--- taf/tests/test_schemas.py | 8 +++- taf/tests/test_types.py | 26 ++++++++++-- taf/updater/lifecycle_handlers.py | 12 +++--- taf/updater/schemas.py | 13 ++++-- taf/updater/types/update.py | 6 +-- taf/updater/updater.py | 29 +++++++++---- 11 files changed, 94 insertions(+), 98 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbe0b622..c0546476 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/taf/auth_repo.py b/taf/auth_repo.py index ec2ea767..a34fa507 100644 --- a/taf/auth_repo.py +++ b/taf/auth_repo.py @@ -81,7 +81,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 + "dependencies": self.dependencies, } ) return data @@ -188,7 +188,7 @@ def set_last_validated_commit(self, commit): def set_dependencies(self, dependencies): """ - Set dependencies.json content to authentication repository. + Set dependencies.json content to authentication repository. If the dependencies.json is empty, field is empty. """ deps = {} diff --git a/taf/hosts.py b/taf/hosts.py index b03d318f..f0d32fdd 100644 --- a/taf/hosts.py +++ b/taf/hosts.py @@ -148,7 +148,12 @@ def _load_json(auth_repo, commit=None, path=None): if commit is None: commit = auth_repo.top_commit_of_branch(auth_repo.default_branch) try: - if path in (DEPENDENCIES_JSON_PATH, HOSTS_JSON_PATH, MIRRORS_JSON_PATH, REPOSITORIES_JSON_PATH): + if path in ( + DEPENDENCIES_JSON_PATH, + HOSTS_JSON_PATH, + MIRRORS_JSON_PATH, + REPOSITORIES_JSON_PATH, + ): return _get_json_file(auth_repo, path, commit) except MissingHostsError: return {} diff --git a/taf/repositoriesdb.py b/taf/repositoriesdb.py index 02a3e909..69916aef 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=library_dir, name=name, urls=urls, out_of_band_authentication=out_of_band_authentication, custom=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( diff --git a/taf/tests/conftest.py b/taf/tests/conftest.py index 1b0035dd..81b04f0c 100644 --- a/taf/tests/conftest.py +++ b/taf/tests/conftest.py @@ -174,17 +174,13 @@ def wrong_keystore(): @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") - ] + 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") - ] + return [input_path for input_path in UPDATE_TYPES_INVALID_INPUT_DIR.glob("*.json")] @fixture @@ -231,7 +227,8 @@ def host_handlers_invalid_inputs(): 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") + input_path + for input_path in UPDATE_HANDLERS_DATA_INVALID_INPUT_IDR.glob("*.json") ] diff --git a/taf/tests/test_schemas.py b/taf/tests/test_schemas.py index 3704d222..acfe7142 100644 --- a/taf/tests/test_schemas.py +++ b/taf/tests/test_schemas.py @@ -3,13 +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, update_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 + update_update_schema["$id"]: update_update_schema, } diff --git a/taf/tests/test_types.py b/taf/tests/test_types.py index eeaee878..61c6c624 100644 --- a/taf/tests/test_types.py +++ b/taf/tests/test_types.py @@ -8,13 +8,31 @@ 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='openlawlibrary/law') == result + assert ( + Update( + changed=result.changed, + error_msg=result.error_msg, + event=result.event, + hosts=result.hosts, + auth_repos=result.auth_repos, + auth_repo="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='') == result + assert ( + Update( + changed=False, + event="", + error_msg="", + hosts={}, + auth_repos={}, + auth_repo="", + ) + == result + ) diff --git a/taf/updater/lifecycle_handlers.py b/taf/updater/lifecycle_handlers.py index 6b82e571..f8414789 100644 --- a/taf/updater/lifecycle_handlers.py +++ b/taf/updater/lifecycle_handlers.py @@ -14,7 +14,7 @@ ) from taf.exceptions import ScriptExecutionError from taf.log import taf_logger -from taf.updater.types.update import (Update) +from taf.updater.types.update import Update from cattr import structure @@ -301,14 +301,15 @@ def prepare_data_update( hosts, repos_update_data, error, - root_auth_repo + root_auth_repo, ): update_hosts = {} flat_auth_repos = {} for auth_repo_name in repos_update_data.keys(): flat_auth_repos[auth_repo_name] = _repo_update_data( - **repos_update_data[auth_repo_name]) + **repos_update_data[auth_repo_name] + ) for host_data in hosts: auth_repos = {} @@ -317,7 +318,8 @@ def prepare_data_update( 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]) + **repos_update_data[repo_name] + ) auth_repo[repo_name]["custom"] = repo_host_data["custom"] auth_repos.update({"update": auth_repo}) @@ -337,7 +339,7 @@ def prepare_data_update( "error_msg": str(error) if error else "", "hosts": update_hosts, "auth_repos": flat_auth_repos, - "auth_repo": root_auth_repo.name + "auth_repo": root_auth_repo.name, }, "state": { "transient": transient_data, diff --git a/taf/updater/schemas.py b/taf/updater/schemas.py index 144c9802..36ec0d0b 100644 --- a/taf/updater/schemas.py +++ b/taf/updater/schemas.py @@ -372,7 +372,7 @@ "type": "object", "items": {"$ref": "update_update.schema.json#"}, } - } + }, }, "auth_repos": { "title": "Authentication Repositories with a flat structure", @@ -383,9 +383,16 @@ "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"], + "required": [ + "changed", + "event", + "hosts", + "error_msg", + "auth_repos", + "auth_repo", + ], "additionalProperties": False, }, "state": { diff --git a/taf/updater/types/update.py b/taf/updater/types/update.py index 1f9bfb4f..76fe19eb 100644 --- a/taf/updater/types/update.py +++ b/taf/updater/types/update.py @@ -5,8 +5,8 @@ @define class Update: changed: bool = field(default=False) - event: str = field(default='') - error_msg: str = field(default='') + event: str = field(default="") + error_msg: str = field(default="") hosts: Dict = field(factory=dict) auth_repos: Dict = field(factory=dict) - auth_repo: str = field(default='') + auth_repo: str = field(default="") diff --git a/taf/updater/updater.py b/taf/updater/updater.py index 5c9c46e3..7c380050 100644 --- a/taf/updater/updater.py +++ b/taf/updater/updater.py @@ -1,5 +1,4 @@ import json -from logging import root import shutil import enum @@ -23,8 +22,19 @@ ) from taf.updater.handlers import GitUpdater from taf.utils import on_rm_error -from taf.hosts import load_dependencies_json, 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 taf.hosts import ( + load_dependencies_json, + 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() @@ -85,6 +95,7 @@ def _load_dependencies_json(auth_repo): except InvalidHostsError as e: raise UpdateFailedError(str(e)) + # TODO config path should be configurable @@ -254,7 +265,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] + update_transient_data[host_repo_name] = host_transient_data[ + host_repo_name + ] handle_host_event( host_update_status, @@ -274,7 +287,7 @@ def update_repository( hosts, repos_update_data, errors, - root_auth_repo + root_auth_repo, ) if root_error: @@ -932,7 +945,7 @@ def _get_commits( # check which commits are newer that the previous head commit if old_head in fetched_commits: new_commits_on_repo_branch = fetched_commits[ - fetched_commits.index(old_head) + 1:: + fetched_commits.index(old_head) + 1 : : ] else: new_commits_on_repo_branch = repository.all_commits_since_commit( @@ -1119,7 +1132,7 @@ def _update_target_repository( if commit == target_commits[-1]: update_successful = True if commit != new_commits[-1]: - additional_commits = new_commits[new_commit_index + 1:] + additional_commits = new_commits[new_commit_index + 1 :] break if len(additional_commits): taf_logger.warning( @@ -1150,7 +1163,7 @@ def _update_target_repository( branch_current_head = repository.top_commit_of_branch(branch) if branch_current_head in additional_commits: additional_commits = additional_commits[ - additional_commits.index(branch_current_head) + 1: + additional_commits.index(branch_current_head) + 1 : ] return additional_commits From 3eee2a774c118f460b0f8f28bb3e54d2ec400a8b Mon Sep 17 00:00:00 2001 From: n-dusan Date: Thu, 10 Feb 2022 00:40:30 +0100 Subject: [PATCH 14/17] refactor: update json data for tests * Rename field `auto_repo` to `auth_repo_name` and update json examples. * Rename partners and urls it leads to in json examples. --- .../invalid/host/missing_required.json | 105 ++----- .../invalid/host/wrong_type.json | 105 ++----- .../invalid/repo/additional_property.json | 57 ++-- .../invalid/repo/missing_required.json | 27 +- .../invalid/repo/missing_required_inner.json | 57 ++-- .../invalid/repo/wrong_type.json | 55 ++-- .../update/array_instead_of_object.json | 270 ++++++++---------- .../update/required_field_missing.json | 162 +++++------ .../data/handler_inputs/valid/host/host.json | 107 ++----- .../valid/repo/failed_repo.json | 26 +- .../valid/repo/succeeded_repo.json | 56 ++-- ...ucceeded_unauthenticated_commits_repo.json | 56 ++-- .../repo/succeeded_with_new_commits_repo.json | 56 ++-- .../valid/repo/unchanged_repo.json | 56 ++-- .../handler_inputs/valid/update/update.json | 270 ++++++++---------- .../types/update/valid/update_all_fields.json | 2 +- .../types/update/valid/update_no_hosts.json | 2 +- taf/tests/test_types.py | 4 +- taf/updater/schemas.py | 4 +- taf/updater/types/update.py | 2 +- 20 files changed, 617 insertions(+), 862 deletions(-) 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 a4ac8a40..925b9287 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 19cd3109..5872bb17 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 15450ba3..9bd30f1b 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 516b111d..89f9bfbc 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 a3604b89..a45511c1 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 64e73f2a..67b64ffa 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 index f1b30632..37f636b1 100644 --- 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 @@ -5,29 +5,29 @@ "error_msg": "", "hosts": [ { - "san-ildefonso.nsn.us.open.law.vagrant": { - "host_name": "san-ildefonso.nsn.us.open.law.vagrant", + "houston.texas.us.open.law.vagrant": { + "host_name": "houston.texas.us.open.law.vagrant", "error_msg": "", "auth_repos": { "update": { - "sanipueblo/law": { + "portland/law": { "changed": false, "event": "event/succeeded", - "repo_name": "sanipueblo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law" + "http://github.com/houston/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "conf_directory_root": "C:\\OLL\\test1\\portland", "out_of_band_authentication": null, "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": {} + "houston.texas.us.open.law.vagrant": {} }, "dependencies": {} }, @@ -38,12 +38,12 @@ } }, "target_repos": { - "sanipueblo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml" + "http://github.com/houston/portland-law-xml" ], "default_branch": "main", "custom": { @@ -72,16 +72,16 @@ } } }, - "sanipueblo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-html" + "http://github.com/houston/portland-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "preview": "git@github.com:houston/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -108,16 +108,16 @@ } } }, - "sanipueblo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + "http://github.com/houston/portland-law-xml-codified" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "preview": "git@github.com:houston/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -153,46 +153,46 @@ } }, { - "sanmateo.ca.us.open.law.vagrant": { - "host_name": "sanmateo.ca.us.open.law.vagrant", + "portland.oregon.open.law.vagrant": { + "host_name": "portland.oregon.open.law.vagrant", "error_msg": "", "auth_repos": { "update": { - "cityofsanmateo/law": { + "houstontexas/law": { "changed": false, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "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": "C:\\OLL\\test1\\cityofsanmateo", + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", "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" + "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" } } @@ -209,13 +209,13 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "houstontexas/law-docs": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-docs", + "name": "houstontexas/law-docs", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "git@github.com:houston/houstontexas-law-docs.git", + "http://github.com/houston/houstontexas-law-docs" ], "default_branch": "main", "custom": { @@ -243,13 +243,13 @@ } } }, - "cityofsanmateo/law-xml": { + "houstontexas/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml", + "name": "houstontexas/law-xml", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "git@github.com:houston/houstontexas-law-xml.git", + "http://github.com/houston/houstontexas-law-xml" ], "default_branch": "main", "custom": { @@ -283,17 +283,17 @@ } } }, - "cityofsanmateo/law-html": { + "houstontexas/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-html", + "name": "houstontexas/law-html", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "git@github.com:houston/houstontexas-law-html.git", + "http://github.com/houston/houstontexas-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "git@github.com:houston/houstontexas-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -323,17 +323,17 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "houstontexas/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml-codified", + "name": "houstontexas/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" + "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:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "git@github.com:houston/houstontexas-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -368,8 +368,8 @@ "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" + "git@github.com:houston/openlawlibrary-law-static-assets.git", + "http://github.com/houston/openlawlibrary-law-static-assets" ], "default_branch": "main", "custom": { @@ -413,20 +413,20 @@ "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" } } @@ -436,41 +436,41 @@ } ], "auth_repos": { - "cityofsanmateo/law": { + "houstontexas/law": { "changed": false, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "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": "C:\\OLL\\test1\\cityofsanmateo", + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", "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" + "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" } } @@ -487,13 +487,13 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "houstontexas/law-docs": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-docs", + "name": "houstontexas/law-docs", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "git@github.com:houston/houstontexas-law-docs.git", + "http://github.com/houston/houstontexas-law-docs" ], "default_branch": "main", "custom": { @@ -521,13 +521,13 @@ } } }, - "cityofsanmateo/law-xml": { + "houstontexas/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml", + "name": "houstontexas/law-xml", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "git@github.com:houston/houstontexas-law-xml.git", + "http://github.com/houston/houstontexas-law-xml" ], "default_branch": "main", "custom": { @@ -561,17 +561,17 @@ } } }, - "cityofsanmateo/law-html": { + "houstontexas/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-html", + "name": "houstontexas/law-html", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "git@github.com:houston/houstontexas-law-html.git", + "http://github.com/houston/houstontexas-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "git@github.com:houston/houstontexas-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -601,17 +601,17 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "houstontexas/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml-codified", + "name": "houstontexas/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" + "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:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "git@github.com:houston/houstontexas-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -646,8 +646,8 @@ "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" + "git@github.com:houston/openlawlibrary-law-static-assets.git", + "http://github.com/houston/openlawlibrary-law-static-assets" ], "default_branch": "main", "custom": { @@ -685,24 +685,24 @@ } } }, - "sanipueblo/law": { + "portland/law": { "changed": false, "event": "event/succeeded", - "repo_name": "sanipueblo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law" + "http://github.com/houston/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "conf_directory_root": "C:\\OLL\\test1\\portland", "out_of_band_authentication": null, "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": {} + "houston.texas.us.open.law.vagrant": {} }, "dependencies": {} }, @@ -713,12 +713,12 @@ } }, "target_repos": { - "sanipueblo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml" + "http://github.com/houston/portland-law-xml" ], "default_branch": "main", "custom": { @@ -747,16 +747,16 @@ } } }, - "sanipueblo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-html" + "http://github.com/houston/portland-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "preview": "git@github.com:houston/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -783,16 +783,16 @@ } } }, - "sanipueblo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + "http://github.com/houston/portland-law-xml-codified" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "preview": "git@github.com:houston/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -831,7 +831,7 @@ "library_dir": "C:\\OLL\\test1", "name": "openlawlibrary/law", "urls": [ - "https://github.com/oll-test-repos/openlawlibrary-law.git" + "https://github.com/houston/openlawlibrary-law.git" ], "default_branch": "master", "custom": {}, @@ -839,10 +839,10 @@ "out_of_band_authentication": null, "hosts": {}, "dependencies": { - "cityofsanmateo/law": { + "houstontexas/law": { "out-of-band-authentication": "bfcbc7db7adc3f43291a64b0572b6b114e63e98a" }, - "sanipueblo/law": { + "portland/law": { "out-of-band-authentiction": "d7a6b796cffe53ad89b4504084402570b7d17f6b" } } @@ -856,41 +856,11 @@ "target_repos": {} } }, - "auth_repo": "openlawlibrary/law" + "auth_repo_name": "openlawlibrary/law" }, "state": { - "transient": { - "sanipueblo/law": { - "script1": { - "sanipueblo/law": "this is transient" - }, - "script2": { - "sanipueblo/law": "this is transient" - } - }, - "cityofsanmateo/law": { - "script1": { - "sanipueblo/law": "this is transient" - }, - "script2": { - "sanipueblo/law": "this is transient" - } - }, - "script1": { - "cityofsanamteo/law": "this is transient" - }, - "script2": { - "cityofsanamteo/law": "this is transient" - } - }, - "persistent": { - "script1": { - "cityofsanamteo/law": "this is persistent" - }, - "script2": { - "cityofsanamteo/law": "this is persistent" - } - } + "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 index 7af0267f..0dc0c810 100644 --- a/taf/tests/data/handler_inputs/invalid/update/required_field_missing.json +++ b/taf/tests/data/handler_inputs/invalid/update/required_field_missing.json @@ -4,29 +4,29 @@ "event": "event/succeeded", "error_msg": "", "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": { - "host_name": "san-ildefonso.nsn.us.open.law.vagrant", + "portland.oregon.open.law.vagrant": { + "host_name": "portland.oregon.open.law.vagrant", "error_msg": "", "auth_repos": { "update": { - "sanipueblo/law": { + "portland/law": { "changed": false, "event": "event/succeeded", - "repo_name": "sanipueblo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law", + "name": "portland/law", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law" + "http://github.com/houston/portland-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "conf_directory_root": "C:\\OLL\\test1\\portland", "out_of_band_authentication": null, "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": {} + "portland.oregon.open.law.vagrant": {} }, "dependencies": {} }, @@ -37,12 +37,12 @@ } }, "target_repos": { - "sanipueblo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml", + "name": "portland/law-xml", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml" + "http://github.com/houston/portland-law-xml" ], "default_branch": "main", "custom": { @@ -71,16 +71,16 @@ } } }, - "sanipueblo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-html", + "name": "portland/law-html", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-html" + "http://github.com/houston/portland-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "preview": "git@github.com:houston/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -107,16 +107,16 @@ } } }, - "sanipueblo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml-codified", + "name": "portland/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + "http://github.com/houston/portland-law-xml-codified" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "preview": "git@github.com:houston/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -150,46 +150,46 @@ }, "custom": null }, - "sanmateo.ca.us.open.law.vagrant": { - "host_name": "sanmateo.ca.us.open.law.vagrant", + "houston.texas.open.law.vagrant": { + "host_name": "houston.texas.open.law.vagrant", "error_msg": "", "auth_repos": { "update": { - "cityofsanmateo/law": { + "houstontexas/law": { "changed": false, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "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": "C:\\OLL\\test1\\cityofsanmateo", + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", "out_of_band_authentication": null, "hosts": { - "sanmateo.ca.us.open.law.vagrant": { + "houston.texas.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" } } @@ -206,13 +206,13 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "houstontexas/law-docs": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-docs", + "name": "houstontexas/law-docs", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "git@github.com:houston/houstontexas-law-docs.git", + "http://github.com/houston/houstontexas-law-docs" ], "default_branch": "main", "custom": { @@ -240,13 +240,13 @@ } } }, - "cityofsanmateo/law-xml": { + "houstontexas/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml", + "name": "houstontexas/law-xml", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "git@github.com:houston/houstontexas-law-xml.git", + "http://github.com/houston/houstontexas-law-xml" ], "default_branch": "main", "custom": { @@ -280,17 +280,17 @@ } } }, - "cityofsanmateo/law-html": { + "houstontexas/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-html", + "name": "houstontexas/law-html", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "git@github.com:houston/houstontexas-law-html.git", + "http://github.com/houston/houstontexas-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "git@github.com:houston/houstontexas-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -320,17 +320,17 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "houstontexas/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml-codified", + "name": "houstontexas/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" + "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:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "git@github.com:houston/houstontexas-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -365,8 +365,8 @@ "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" + "git@github.com:houston/openlawlibrary-law-static-assets.git", + "http://github.com/houston/openlawlibrary-law-static-assets" ], "default_branch": "main", "custom": { @@ -410,20 +410,20 @@ "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" } } @@ -431,41 +431,11 @@ } } }, - "auth_repo": "openlawlibrary/law" + "auth_repo_name": "openlawlibrary/law" }, "state": { - "transient": { - "sanipueblo/law": { - "script1": { - "sanipueblo/law": "this is transient" - }, - "script2": { - "sanipueblo/law": "this is transient" - } - }, - "cityofsanmateo/law": { - "script1": { - "sanipueblo/law": "this is transient" - }, - "script2": { - "sanipueblo/law": "this is transient" - } - }, - "script1": { - "cityofsanamteo/law": "this is transient" - }, - "script2": { - "cityofsanamteo/law": "this is transient" - } - }, - "persistent": { - "script1": { - "cityofsanamteo/law": "this is persistent" - }, - "script2": { - "cityofsanamteo/law": "this is persistent" - } - } + "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 e49544e9..1fbacf1c 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 44e1fbf3..a2087773 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 b5fe04b5..59c5304a 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 e061e5b6..c93459f6 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 b5fe04b5..59c5304a 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 797bf8ed..3f45b9e7 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 index c409df59..9f39f0e9 100644 --- a/taf/tests/data/handler_inputs/valid/update/update.json +++ b/taf/tests/data/handler_inputs/valid/update/update.json @@ -4,29 +4,29 @@ "event": "event/succeeded", "error_msg": "", "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": { - "host_name": "san-ildefonso.nsn.us.open.law.vagrant", + "houston.texas.us.open.law.vagrant": { + "host_name": "houston.texas.us.open.law.vagrant", "error_msg": "", "auth_repos": { "update": { - "sanipueblo/law": { + "houstontexas/law": { "changed": false, "event": "event/succeeded", - "repo_name": "sanipueblo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law", + "name": "houstontexas/law", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law" + "http://github.com/portland/houstontexas-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", "out_of_band_authentication": null, "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": {} + "houston.texas.us.open.law.vagrant": {} }, "dependencies": {} }, @@ -37,12 +37,12 @@ } }, "target_repos": { - "sanipueblo/law-xml": { + "houstontexas/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml", + "name": "houstontexas/law-xml", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml" + "http://github.com/portland/houstontexas-law-xml" ], "default_branch": "main", "custom": { @@ -71,16 +71,16 @@ } } }, - "sanipueblo/law-html": { + "houstontexas/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-html", + "name": "houstontexas/law-html", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-html" + "http://github.com/portland/houstontexas-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "preview": "git@github.com:portland/houstontexas-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -107,16 +107,16 @@ } } }, - "sanipueblo/law-xml-codified": { + "houstontexas/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml-codified", + "name": "houstontexas/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + "http://github.com/portland/houstontexas-law-xml-codified" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "preview": "git@github.com:portland/houstontexas-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -150,46 +150,46 @@ }, "custom": null }, - "sanmateo.ca.us.open.law.vagrant": { - "host_name": "sanmateo.ca.us.open.law.vagrant", + "portland.oregon.open.law.vagrant": { + "host_name": "portland.oregon.open.law.vagrant", "error_msg": "", "auth_repos": { "update": { - "cityofsanmateo/law": { + "portland/law": { "changed": false, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "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": "C:\\OLL\\test1\\cityofsanmateo", + "conf_directory_root": "C:\\OLL\\test1\\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" } } @@ -206,13 +206,13 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-docs", + "name": "portland/law-docs", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "git@github.com:portland/portland-law-docs.git", + "http://github.com/portland/portland-law-docs" ], "default_branch": "main", "custom": { @@ -240,13 +240,13 @@ } } }, - "cityofsanmateo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml", + "name": "portland/law-xml", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "git@github.com:portland/portland-law-xml.git", + "http://github.com/portland/portland-law-xml" ], "default_branch": "main", "custom": { @@ -280,17 +280,17 @@ } } }, - "cityofsanmateo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-html", + "name": "portland/law-html", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "git@github.com:portland/portland-law-html.git", + "http://github.com/portland/portland-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "git@github.com:portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -320,17 +320,17 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml-codified", + "name": "portland/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" + "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:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "git@github.com:portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -365,8 +365,8 @@ "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" + "git@github.com:portland/openlawlibrary-law-static-assets.git", + "http://github.com/portland/openlawlibrary-law-static-assets" ], "default_branch": "main", "custom": { @@ -410,20 +410,20 @@ "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" } } @@ -432,41 +432,41 @@ } }, "auth_repos": { - "cityofsanmateo/law": { + "portland/law": { "changed": false, "event": "event/succeeded", - "repo_name": "cityofsanmateo/law", + "repo_name": "portland/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "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": "C:\\OLL\\test1\\cityofsanmateo", + "conf_directory_root": "C:\\OLL\\test1\\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" } } @@ -483,13 +483,13 @@ } }, "target_repos": { - "cityofsanmateo/law-docs": { + "portland/law-docs": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-docs", + "name": "portland/law-docs", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-docs.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-docs" + "git@github.com:portland/portland-law-docs.git", + "http://github.com/portland/portland-law-docs" ], "default_branch": "main", "custom": { @@ -517,13 +517,13 @@ } } }, - "cityofsanmateo/law-xml": { + "portland/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml", + "name": "portland/law-xml", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-xml.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-xml" + "git@github.com:portland/portland-law-xml.git", + "http://github.com/portland/portland-law-xml" ], "default_branch": "main", "custom": { @@ -557,17 +557,17 @@ } } }, - "cityofsanmateo/law-html": { + "portland/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-html", + "name": "portland/law-html", "urls": [ - "git@github.com:oll-test-repos/cityofsanmateo-law-html.git", - "http://github.com/oll-test-repos/cityofsanmateo-law-html" + "git@github.com:portland/portland-law-html.git", + "http://github.com/portland/portland-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/cityofsanmateo-law-html-preview.git", + "preview": "git@github.com:portland/portland-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -597,17 +597,17 @@ } } }, - "cityofsanmateo/law-xml-codified": { + "portland/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "cityofsanmateo/law-xml-codified", + "name": "portland/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" + "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:oll-test-repos/cityofsanmateo-law-xml-codified-preview.git", + "preview": "git@github.com:portland/portland-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -642,8 +642,8 @@ "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" + "git@github.com:portland/openlawlibrary-law-static-assets.git", + "http://github.com/portland/openlawlibrary-law-static-assets" ], "default_branch": "main", "custom": { @@ -681,24 +681,24 @@ } } }, - "sanipueblo/law": { + "houstontexas/law": { "changed": false, "event": "event/succeeded", - "repo_name": "sanipueblo/law", + "repo_name": "houstontexas/law", "error_msg": "", "auth_repo": { "data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law", + "name": "houstontexas/law", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law" + "http://github.com/portland/houstontexas-law" ], "default_branch": "master", "custom": {}, - "conf_directory_root": "C:\\OLL\\test1\\sanipueblo", + "conf_directory_root": "C:\\OLL\\test1\\houstontexas", "out_of_band_authentication": null, "hosts": { - "san-ildefonso.nsn.us.open.law.vagrant": {} + "houston.texas.us.open.law.vagrant": {} }, "dependencies": {} }, @@ -709,12 +709,12 @@ } }, "target_repos": { - "sanipueblo/law-xml": { + "houstontexas/law-xml": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml", + "name": "houstontexas/law-xml", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml" + "http://github.com/portland/houstontexas-law-xml" ], "default_branch": "main", "custom": { @@ -743,16 +743,16 @@ } } }, - "sanipueblo/law-html": { + "houstontexas/law-html": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-html", + "name": "houstontexas/law-html", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-html" + "http://github.com/portland/houstontexas-law-html" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-html-preview.git", + "preview": "git@github.com:portland/houstontexas-law-html-preview.git", "type": "html", "serve": "historical", "location_regex": "/" @@ -779,16 +779,16 @@ } } }, - "sanipueblo/law-xml-codified": { + "houstontexas/law-xml-codified": { "repo_data": { "library_dir": "C:\\OLL\\test1", - "name": "sanipueblo/law-xml-codified", + "name": "houstontexas/law-xml-codified", "urls": [ - "http://github.com/oll-test-repos/sanipueblo-law-xml-codified" + "http://github.com/portland/houstontexas-law-xml-codified" ], "default_branch": "main", "custom": { - "preview": "git@github.com:oll-test-repos/sanipueblo-law-xml-codified-preview.git", + "preview": "git@github.com:portland/houstontexas-law-xml-codified-preview.git", "type": "xml-codified", "serve": "historical", "serve-prefix": "_xml" @@ -827,7 +827,7 @@ "library_dir": "C:\\OLL\\test1", "name": "openlawlibrary/law", "urls": [ - "https://github.com/oll-test-repos/openlawlibrary-law.git" + "https://github.com/portland/openlawlibrary-law.git" ], "default_branch": "master", "custom": {}, @@ -835,10 +835,10 @@ "out_of_band_authentication": null, "hosts": {}, "dependencies": { - "cityofsanmateo/law": { + "portland/law": { "out-of-band-authentication": "bfcbc7db7adc3f43291a64b0572b6b114e63e98a" }, - "sanipueblo/law": { + "houstontexas/law": { "out-of-band-authentiction": "d7a6b796cffe53ad89b4504084402570b7d17f6b" } } @@ -852,41 +852,11 @@ "target_repos": {} } }, - "auth_repo": "openlawlibrary/law" + "auth_repo_name": "openlawlibrary/law" }, "state": { - "transient": { - "sanipueblo/law": { - "script1": { - "sanipueblo/law": "this is transient" - }, - "script2": { - "sanipueblo/law": "this is transient" - } - }, - "cityofsanmateo/law": { - "script1": { - "sanipueblo/law": "this is transient" - }, - "script2": { - "sanipueblo/law": "this is transient" - } - }, - "script1": { - "cityofsanamteo/law": "this is transient" - }, - "script2": { - "cityofsanamteo/law": "this is transient" - } - }, - "persistent": { - "script1": { - "cityofsanamteo/law": "this is persistent" - }, - "script2": { - "cityofsanamteo/law": "this is persistent" - } - } + "transient": {}, + "persistent": {} }, "config": {} } \ 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 index 12a906e7..41ebf51d 100644 --- a/taf/tests/data/types/update/valid/update_all_fields.json +++ b/taf/tests/data/types/update/valid/update_all_fields.json @@ -851,5 +851,5 @@ "target_repos": {} } }, - "auth_repo": "openlawlibrary/law" + "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 index ce6b3d10..8e00b1b6 100644 --- a/taf/tests/data/types/update/valid/update_no_hosts.json +++ b/taf/tests/data/types/update/valid/update_no_hosts.json @@ -423,5 +423,5 @@ "target_repos": {} } }, - "auth_repo": "openlawlibrary/law" + "auth_repo_name": "openlawlibrary/law" } \ No newline at end of file diff --git a/taf/tests/test_types.py b/taf/tests/test_types.py index 61c6c624..cab56085 100644 --- a/taf/tests/test_types.py +++ b/taf/tests/test_types.py @@ -15,7 +15,7 @@ def test_update_structure_valid(types_update_valid_inputs): event=result.event, hosts=result.hosts, auth_repos=result.auth_repos, - auth_repo="openlawlibrary/law", + auth_repo_name="openlawlibrary/law", ) == result ) @@ -32,7 +32,7 @@ def test_update_structure_invalid(types_update_invalid_inputs): error_msg="", hosts={}, auth_repos={}, - auth_repo="", + auth_repo_name="", ) == result ) diff --git a/taf/updater/schemas.py b/taf/updater/schemas.py index 36ec0d0b..4daf5e26 100644 --- a/taf/updater/schemas.py +++ b/taf/updater/schemas.py @@ -379,7 +379,7 @@ "type": "object", "items": {"$ref": "repo_update.schema.json#"}, }, - "auth_repo": { + "auth_repo_name": { "title": "Name", "description": "Name of authentication repository that was called by the updater", "type": "string", @@ -391,7 +391,7 @@ "hosts", "error_msg", "auth_repos", - "auth_repo", + "auth_repo_name", ], "additionalProperties": False, }, diff --git a/taf/updater/types/update.py b/taf/updater/types/update.py index 76fe19eb..7e62508e 100644 --- a/taf/updater/types/update.py +++ b/taf/updater/types/update.py @@ -9,4 +9,4 @@ class Update: error_msg: str = field(default="") hosts: Dict = field(factory=dict) auth_repos: Dict = field(factory=dict) - auth_repo: str = field(default="") + auth_repo_name: str = field(default="") From 683a545922750ef357b6ab0331d15d4fe11a557f Mon Sep 17 00:00:00 2001 From: n-dusan Date: Thu, 10 Feb 2022 00:46:59 +0100 Subject: [PATCH 15/17] refactor: move dependencies to `repositoriesdb` Since auth_repo object has a dependencies field that will later be returned by the updater, it can be a property. * Added a setter for that dependencies property. * Based on discussion found in PR #206, the logic for reading `dependencies.json` into an attribute that an auth_repo will later use is now moved to `repositoriesdb`. Makes sense that we don't need to load dependencies.json from each of the commits to set the `dependencies` attribute, just the most recent commit. Because of that, we also don't need to instatiate a different exception class, since it's already wrapped up by `InvalidOrMissingMetadataError`. Removed the raise error from that, to have feature parity with `_load_mirrors_json`. --- taf/auth_repo.py | 24 +++++++++--------------- taf/hosts.py | 16 +--------------- taf/repositoriesdb.py | 14 ++++++++++---- taf/updater/updater.py | 15 --------------- 4 files changed, 20 insertions(+), 49 deletions(-) diff --git a/taf/auth_repo.py b/taf/auth_repo.py index a34fa507..67d24f33 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, @@ -34,7 +35,6 @@ def __init__( out_of_band_authentication=None, hosts=None, path=None, - dependencies=None, *args, **kwargs, ): @@ -69,7 +69,6 @@ def __init__( # this repository's hosts file specifying its hosts # in other words, propagate hosts data from parent to the child repository self.hosts = hosts - self.dependencies = dependencies # TODO rework conf_dir @@ -108,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() @@ -186,19 +193,6 @@ def set_last_validated_commit(self, commit): self._log_debug(f"setting last validated commit to: {commit}") Path(self.conf_dir, self.LAST_VALIDATED_FILENAME).write_text(commit) - def set_dependencies(self, dependencies): - """ - Set dependencies.json content to authentication repository. - If the dependencies.json is empty, field is empty. - """ - deps = {} - for dependency_info in dependencies.values(): - for dependency_name, dependency_data in dependency_info.items(): - if len(dependency_data): - deps[dependency_name] = dependency_data - - self.dependencies = deps - def sorted_commits_and_branches_per_repositories( self, commits, target_repos=None, custom_fns=None, default_branch=None ): diff --git a/taf/hosts.py b/taf/hosts.py index f0d32fdd..559917ba 100644 --- a/taf/hosts.py +++ b/taf/hosts.py @@ -137,24 +137,10 @@ def set_hosts_of_repo(auth_repo, hosts): def load_hosts_json(auth_repo, commit=None): - return _load_json(auth_repo, commit, path=HOSTS_JSON_PATH) - - -def load_dependencies_json(auth_repo, commit=None): - return _load_json(auth_repo, commit, path=DEPENDENCIES_JSON_PATH) - - -def _load_json(auth_repo, commit=None, path=None): if commit is None: commit = auth_repo.top_commit_of_branch(auth_repo.default_branch) try: - if path in ( - DEPENDENCIES_JSON_PATH, - HOSTS_JSON_PATH, - MIRRORS_JSON_PATH, - REPOSITORIES_JSON_PATH, - ): - return _get_json_file(auth_repo, path, commit) + return _get_json_file(auth_repo, HOSTS_JSON_PATH, commit) except MissingHostsError: return {} diff --git a/taf/repositoriesdb.py b/taf/repositoriesdb.py index 69916aef..ad7545db 100644 --- a/taf/repositoriesdb.py +++ b/taf/repositoriesdb.py @@ -142,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, @@ -528,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/updater/updater.py b/taf/updater/updater.py index 7c380050..54f26c5d 100644 --- a/taf/updater/updater.py +++ b/taf/updater/updater.py @@ -23,7 +23,6 @@ from taf.updater.handlers import GitUpdater from taf.utils import on_rm_error from taf.hosts import ( - load_dependencies_json, load_hosts_json, set_hosts_of_repo, load_hosts, @@ -85,17 +84,6 @@ def _load_hosts_json(auth_repo): raise UpdateFailedError(str(e)) -def _load_dependencies_json(auth_repo): - try: - return load_dependencies_json(auth_repo) - except MissingHostsError as e: - # if a there is no host file, the update should not fail - taf_logger.info(str(e)) - return {} - except InvalidHostsError as e: - raise UpdateFailedError(str(e)) - - # TODO config path should be configurable @@ -426,9 +414,6 @@ def _update_named_repository( commits=commits, ) - # read dependencies.json and set them to the parent authentication repository - auth_repo.set_dependencies(_load_dependencies_json(auth_repo)) - if update_status != Event.FAILED: errors = [] # load the repositories from dependencies.json and update these repositories From e4b974cbf36435a764bbe67bb4b7c557a9201bf4 Mon Sep 17 00:00:00 2001 From: n-dusan Date: Thu, 10 Feb 2022 00:54:17 +0100 Subject: [PATCH 16/17] refactor: rename fields in prepare_data_update --- taf/updater/lifecycle_handlers.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/taf/updater/lifecycle_handlers.py b/taf/updater/lifecycle_handlers.py index f8414789..24d332b9 100644 --- a/taf/updater/lifecycle_handlers.py +++ b/taf/updater/lifecycle_handlers.py @@ -305,15 +305,15 @@ def prepare_data_update( ): update_hosts = {} - flat_auth_repos = {} - for auth_repo_name in repos_update_data.keys(): - flat_auth_repos[auth_repo_name] = _repo_update_data( + 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 root_repo, contained_repo_data in host_data.data_by_auth_repo.items(): + 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 = {} @@ -321,7 +321,7 @@ def prepare_data_update( **repos_update_data[repo_name] ) auth_repo[repo_name]["custom"] = repo_host_data["custom"] - auth_repos.update({"update": auth_repo}) + auth_repos["update"] = auth_repo update_hosts[host_data.name] = { "host_name": host_data.name, @@ -338,8 +338,8 @@ def prepare_data_update( "event": _format_event(event), "error_msg": str(error) if error else "", "hosts": update_hosts, - "auth_repos": flat_auth_repos, - "auth_repo": root_auth_repo.name, + "auth_repos": all_auth_repos, + "auth_repo_name": root_auth_repo.name, }, "state": { "transient": transient_data, @@ -354,10 +354,6 @@ def prepare_data_update( } -def prepare_data_completed(): - return {} - - def _repo_update_data(auth_repo, update_status, commits_data, targets_data, error): return { "changed": update_status == Event.CHANGED, From 1b3b17d1e2df4930aecba1497185b9d8c50647bb Mon Sep 17 00:00:00 2001 From: n-dusan Date: Fri, 11 Feb 2022 04:45:50 +0100 Subject: [PATCH 17/17] fix: check status and errors to update handler --- taf/updater/updater.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/taf/updater/updater.py b/taf/updater/updater.py index 54f26c5d..dca50d50 100644 --- a/taf/updater/updater.py +++ b/taf/updater/updater.py @@ -45,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, @@ -267,8 +290,12 @@ def update_repository( errors, ) + update_update_status, errors = _check_update_status( + repos_update_data, auth_repo_name, host_update_status, errors + ) + update_data = handle_update_event( - host_update_status, + update_update_status, update_transient_data, root_auth_repo.library_dir, scripts_root_dir,