Skip to content

Commit

Permalink
Merge pull request #206 from openlawlibrary/ndusan/update-lifecycle-e…
Browse files Browse the repository at this point in the history
…nhancement

Pull pipeline - update handler
  • Loading branch information
renatav authored Feb 11, 2022
2 parents 7d6bbf0 + 1b3b17d commit 4055edd
Show file tree
Hide file tree
Showing 29 changed files with 4,988 additions and 544 deletions.
70 changes: 8 additions & 62 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -39,118 +43,88 @@ 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])
- If top commit of the authentication repository is not the same as the `last_validated_commit`, validate the newer commits as if they were just pulled ([195])

### 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])
Expand All @@ -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])
Expand All @@ -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])
Expand All @@ -185,44 +155,37 @@ 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])
- Fixed branch exists check. Avoid wrongly returning true if there is a warning ([179])
- 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
Expand All @@ -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])
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions taf/auth_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class AuthenticationRepository(GitRepository, TAFRepository):
AUTH_REPOS_HOSTS_KEY = "auth_repos"

_conf_dir = None
_dependencies = {}

def __init__(
self,
Expand Down Expand Up @@ -79,6 +80,7 @@ def to_json_dict(self):
"conf_directory_root": str(self.conf_directory_root),
"out_of_band_authentication": self.out_of_band_authentication,
"hosts": self.hosts,
"dependencies": self.dependencies,
}
)
return data
Expand All @@ -105,6 +107,14 @@ def certs_dir(self):
certs_dir.mkdir(parents=True, exist_ok=True)
return str(certs_dir)

@property
def dependencies(self):
return self._dependencies

@dependencies.setter
def dependencies(self, value):
self._dependencies = value

@property
def is_test_repo(self):
return Path(self.path, self.targets_path, self.TEST_REPO_FLAG_FILE).is_file()
Expand Down
Loading

0 comments on commit 4055edd

Please sign in to comment.