# HG changeset patch # User RhodeCode Admin # Date 2023-08-03 18:52:10 # Node ID e080003367e801aec8e8959ae069e0b56d4bfd5b # Parent 1d3bc90928d7de81735b2b8c6ab790a41df13229 events: added more validation of repo type events diff --git a/rhodecode/events/repo.py b/rhodecode/events/repo.py --- a/rhodecode/events/repo.py +++ b/rhodecode/events/repo.py @@ -130,6 +130,10 @@ def _commits_as_dict(event, commit_ids, # matters we short circuit then. return [] + # we failed to remove all needed_commits from all repositories + if needed_commits: + raise ValueError(f'Unexpectedly not found {needed_commits} in all available repos {repos}') + missing_commits = set(commit_ids) - set(c['raw_id'] for c in commits) if missing_commits: log.error('Inconsistent repository state. ' @@ -298,7 +302,7 @@ class RepoVCSEvent(RepoEvent): def __init__(self, repo_name, extras): self.repo = Repository.get_by_repo_name(repo_name) if not self.repo: - raise Exception('repo by this name %s does not exist' % repo_name) + raise Exception(f'repo by this name {repo_name} does not exist') self.extras = extras super().__init__(self.repo)