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

Require one transaction ID for history list + info #2214

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danehlim
Copy link

@danehlim danehlim commented Feb 11, 2025

Summary

Require one transaction ID for dnf history command actions list and info. This is a bugfix that resolves #2213.

Currently, dnf history command actions list and info are missing from the set of actions which should require one transaction ID.

Implementation details

Set self._require_one_transaction_id = True for dnf history command actions list and info.

Testing

Using a Fedora 41 instance with containerd not installed, I ran dnf history list containerd and dnf history info containerd with and without the changes from this pull request.

I verified that without these changes, the commands return a zero exit status and do not write a message to stderr.

Click here to expand for full output of commands without changes from this pull request
$ dnf --version
4.22.0
  Installed: rpm-0:4.20.0-1.fc41.x86_64 at Fri 06 Dec 2024 07:18:57 AM GMT
  Built    : Fedora Project at Tue 08 Oct 2024 03:18:49 PM GMT

$ sudo dnf history list containerd 2>&1 1>/dev/null ; echo $?
0

$ sudo dnf history list containerd ; echo $?
No transaction which manipulates package 'containerd' was found.
0

$ sudo dnf history info containerd 2>&1 1>/dev/null ; echo $?
0

$ sudo dnf history info  containerd ; echo $?
No transaction which manipulates package 'containerd' was found.
0

I also built from source with these pull request's changes included (by following these instructions) and then verified using the built dnf that the commands return a non-zero exit status and write an error message to stderr.

Click here to expand for full output of commands with changes from this pull request
$ PYTHONPATH=`readlink -f .` bin/dnf-3 --version
4.22.0
  Installed: rpm-0:4.20.0-1.fc41.x86_64 at Fri 06 Dec 2024 07:18:57 AM GMT
  Built    : Fedora Project at Tue 08 Oct 2024 03:18:49 PM GMT

$ PYTHONPATH=`readlink -f .` bin/dnf-3 history list containerd 2>&1 1>/dev/null ; echo $?
No transaction which manipulates package 'containerd' was found.
1

$ PYTHONPATH=`readlink -f .` bin/dnf-3 history list containerd ; echo $?
No transaction which manipulates package 'containerd' was found.
1

$ PYTHONPATH=`readlink -f .` bin/dnf-3 history info containerd 2>&1 1>/dev/null ; echo $?
No transaction which manipulates package 'containerd' was found.
1

$ PYTHONPATH=`readlink -f .` bin/dnf-3 history info containerd ; echo $?
No transaction which manipulates package 'containerd' was found.
1

Require one transaction ID for history command actions "list" and "info"

= changelog =
msg: Require one transaction ID for history list + info
type: bugfix
resolves: rpm-software-management#2213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant