Skip to content

Commit

Permalink
Merge pull request #188 from openlawlibrary/release/0.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreisen authored Oct 22, 2021
2 parents dfe3d7c + c8a0384 commit f79157f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,23 @@ and this project adheres to [Semantic Versioning][semver].

### Changed

### Fixed

## [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

Expand All @@ -32,7 +45,7 @@ and this project adheres to [Semantic Versioning][semver].
### Fixed


[183] https://github.com/openlawlibrary/taf/pull/184
[184] https://github.com/openlawlibrary/taf/pull/184


## [0.12.0] - 10/18/2021
Expand Down Expand Up @@ -549,7 +562,9 @@ and this project adheres to [Semantic Versioning][semver].
[keepachangelog]: https://keepachangelog.com/en/1.0.0/
[semver]: https://semver.org/spec/v2.0.0.html

[Unreleased]: https://github.com/openlawlibrary/taf/compare/v0.12.0...HEAD
[Unreleased]: https://github.com/openlawlibrary/taf/compare/v0.13.1...HEAD
[0.13.1]: https://github.com/openlawlibrary/taf/compare/v0.13.0...v0.13.1
[0.13.0]: https://github.com/openlawlibrary/taf/compare/v0.12.0...v0.13.0
[0.12.0]: https://github.com/openlawlibrary/taf/compare/v0.11.2...v0.12.0
[0.11.1]: https://github.com/openlawlibrary/taf/compare/v0.11.1...v0.11.2
[0.11.1]: https://github.com/openlawlibrary/taf/compare/v0.11.0...v0.11.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import find_packages, setup

PACKAGE_NAME = "taf"
VERSION = "0.13.0"
VERSION = "0.13.1"
AUTHOR = "Open Law Library"
AUTHOR_EMAIL = "[email protected]"
DESCRIPTION = "Implementation of archival authentication"
Expand Down
12 changes: 8 additions & 4 deletions taf/auth_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def set_last_validated_commit(self, commit):
Path(self.conf_dir, self.LAST_VALIDATED_FILENAME).write_text(commit)

def sorted_commits_and_branches_per_repositories(
self, commits, target_repos=None, custom_fns=None
self, commits, target_repos=None, custom_fns=None, default_branch=None
):
"""Return a dictionary consisting of branches and commits belonging
to it for every target repository:
Expand All @@ -202,7 +202,9 @@ def sorted_commits_and_branches_per_repositories(
file is not updated everytime something is committed to the authentication repo.
"""
repositories_commits = defaultdict(dict)
targets = self.targets_at_revisions(*commits, target_repos=target_repos)
targets = self.targets_at_revisions(
*commits, target_repos=target_repos, default_branch=default_branch
)
previous_commits = {}
for commit in commits:
for target_path, target_data in targets[commit].items():
Expand Down Expand Up @@ -231,8 +233,10 @@ def sorted_commits_and_branches_per_repositories(
)
return repositories_commits

def targets_at_revisions(self, *commits, target_repos=None):
def targets_at_revisions(self, *commits, target_repos=None, default_branch=None):
targets = defaultdict(dict)
if default_branch is None:
default_branch = self.default_branch
for commit in commits:
# repositories.json might not exit, if the current commit is
# the initial commit
Expand Down Expand Up @@ -267,7 +271,7 @@ def targets_at_revisions(self, *commits, target_repos=None):
)
if target_content is not None:
target_commit = target_content.pop("commit")
target_branch = target_content.pop("branch", "master")
target_branch = target_content.pop("branch", default_branch)
targets[commit][target_path] = {
"branch": target_branch,
"commit": target_commit,
Expand Down
4 changes: 3 additions & 1 deletion taf/updater/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,9 @@ def _commits_ret(commits, existing_repo, update_successful):
users_auth_repo, commits
)
repositories_branches_and_commits = (
users_auth_repo.sorted_commits_and_branches_per_repositories(commits)
users_auth_repo.sorted_commits_and_branches_per_repositories(
commits, default_branch=default_branch
)
)

additional_commits_per_repo, targets_data = _update_target_repositories(
Expand Down

0 comments on commit f79157f

Please sign in to comment.