Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix mysql commit required #602

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions repository_service_tuf_worker/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ def _add_metadata_hashbin_delegations(
delegated_roles.append(delegated_name)

targets_crud.create_roles(self._db, db_target_roles)
self._db.commit()

def _remove_delegated_role_keys(
self, targets: Metadata[Targets], delegated: DelegatedRole
Expand Down Expand Up @@ -877,6 +878,7 @@ def _add_metadata_delegation(
rolename=role, version=role_metadata.signed.version
)
targets_crud.create_roles(self._db, [db_roles])
self._db.commit()

if persist_targets and len(success) > 0:
self._bump_and_persist(targets, Targets.type)
Expand Down Expand Up @@ -927,6 +929,7 @@ def _delete_metadata_delegation(
self.write_repository_settings(f"{rolename.upper()}_SIGNING", None)
db_role = targets_crud.read_role_by_rolename(self._db, rolename)
targets_crud.update_role_to_deactivated(self._db, db_role)
self._db.commit()
success.append(rolename)

if success:
Expand Down
Loading