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

[history] Populate history operations via goal rather than directly. #1186

Conversation

dmach
Copy link

@dmach dmach commented Sep 4, 2018

When transaction is populated directly, running scriptlets ends up
with errors: RuntimeError: TransactionItem not found for key:
Using populating transaction via goal and Base._goal2transaction()
fixes the problem.

Resolves: rhbz#1625259

@dmach
Copy link
Author

dmach commented Sep 4, 2018

@rh-atomic-bot try

@rh-atomic-bot
Copy link

⌛ Trying commit 4f9f8a6 with merge 2913a66...

rh-atomic-bot pushed a commit that referenced this pull request Sep 4, 2018
When transaction is populated directly, running scriptlets ends up
with errors: RuntimeError: TransactionItem not found for key: <rpm-name>
Using populating transaction via goal and Base._goal2transaction()
fixes the problem.

Resolves: rhbz#1625259

Closes: #1186
Approved by: <try>
@rh-atomic-bot
Copy link

💔 Test failed - status-papr

@dmach dmach force-pushed the fix/history-TransactionItem-not-found-for-key branch from 4f9f8a6 to 2087d5d Compare September 6, 2018 07:33
@dmach
Copy link
Author

dmach commented Sep 6, 2018

@rh-atomic-bot retry

@dmach dmach force-pushed the fix/history-TransactionItem-not-found-for-key branch from 2087d5d to 3481393 Compare September 6, 2018 14:16
dnf/base.py Outdated

self.history.rpm.new(pkg, action, ti.reason)
# try to use package from the original repo first
q = self.sack.query().available().filter(nevra_strict=str(ti), reponame=ti.from_repo)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Flake8]

[E501] line too long (101 > 100 characters)

@dmach dmach force-pushed the fix/history-TransactionItem-not-found-for-key branch 4 times, most recently from 69ff7a9 to 316460b Compare September 6, 2018 14:38
@dnf-bot
Copy link
Member

dnf-bot commented Sep 6, 2018

Flake8 detected 22 issues on 316460b
Visit https://sider.review/gh/3671909/pull_requests/1186 to review the issues.

@dmach dmach force-pushed the fix/history-TransactionItem-not-found-for-key branch from 316460b to 346871a Compare September 6, 2018 14:41
dnf/base.py Outdated

self.history.rpm.new(pkg, action, ti.reason)
# try to use package from the original repo first
q = self.sack.query().available().filter(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please ramove ".available()". It is not necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q = self.sack.query().filterm(nevra_strict=str(ti))

@dmach dmach force-pushed the fix/history-TransactionItem-not-found-for-key branch from 346871a to 87fd648 Compare September 6, 2018 15:07
@j-mracek
Copy link
Member

j-mracek commented Sep 6, 2018

Failing tests:
history-1-dnf-2 history-1-dnf-3 history_undo-dnf-2 history_undo-dnf-3 security_3-dnf-2 security_3-dnf-3 security_4-dnf-2 security_4-dnf-3 security_5-dnf-2 security_5-dnf-3 shell-1-dnf-2 shell-1-dnf-3 shell-2-dnf-2 shell-2-dnf-3 shell-3-dnf-2 shell-3-dnf-3 shell-4-dnf-2 shell-4-dnf-3 shell-5-dnf-2 shell-5-dnf-3 shell-6-dnf-2 shell-6-dnf-3 shell-7-dnf-2 shell-7-dnf-3 shell-8-dnf-2 shell-8-dnf-3 swap-2-shell-dnf-2 swap-2-shell-dnf-3 swap-3-shell-dnf-2 swap-3-shell-dnf-3

@dmach
Copy link
Author

dmach commented Sep 6, 2018

@rh-atomic-bot retry

@dmach
Copy link
Author

dmach commented Sep 6, 2018

@rh-atomic-bot try

@rh-atomic-bot
Copy link

⌛ Trying commit 87fd648 with merge 1904fc8...

rh-atomic-bot pushed a commit that referenced this pull request Sep 6, 2018
When transaction is populated directly, running scriptlets ends up
with errors: RuntimeError: TransactionItem not found for key: <rpm-name>
Using populating transaction via goal and Base._goal2transaction()
fixes the problem.

Resolves: rhbz#1625259

Closes: #1186
Approved by: <try>
@rh-atomic-bot
Copy link

💔 Test failed - status-papr

dnf/base.py Outdated

self.history.rpm.new(pkg, action, ti.reason)
# try to use package from the original repo first
q = self.sack.query().available().filter(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q = self.sack.query().filterm(nevra_strict=str(ti))

dnf/cli/cli.py Outdated
@@ -617,7 +617,7 @@ def history_rollback_transaction(self, extcmd):
# operations += history.transaction_nevra_ops(id_)

try:
self._history_undo_operations(mobj, old.tid + 1, True)
self._history_undo_operations(mobj, old.tid + 1, True, strict=self.base.conf.strict)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace "strict=self.base.conf.strict" by "strict=self.conf.strict"

dnf/cli/cli.py Outdated
self._history_undo_operations(
mobj,
old.tid)
self._history_undo_operations(mobj, old.tid, strict=self.base.conf.strict)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace "strict=self.base.conf.strict" by "strict=self.conf.strict"

When transaction is populated directly, running scriptlets ends up
with errors: RuntimeError: TransactionItem not found for key: <rpm-name>
Using populating transaction via goal and Base._goal2transaction()
fixes the problem.

Resolves: rhbz#1625259
@dmach dmach force-pushed the fix/history-TransactionItem-not-found-for-key branch from 87fd648 to 199d788 Compare September 6, 2018 18:37
@dmach
Copy link
Author

dmach commented Sep 6, 2018

@rh-atomic-bot retry

@dmach
Copy link
Author

dmach commented Sep 6, 2018

@rh-atomic-bot try

@rh-atomic-bot
Copy link

⌛ Trying commit 199d788 with merge a15ad9a...

rh-atomic-bot pushed a commit that referenced this pull request Sep 6, 2018
When transaction is populated directly, running scriptlets ends up
with errors: RuntimeError: TransactionItem not found for key: <rpm-name>
Using populating transaction via goal and Base._goal2transaction()
fixes the problem.

Resolves: rhbz#1625259

Closes: #1186
Approved by: <try>
@j-mracek
Copy link
Member

j-mracek commented Sep 6, 2018

Failed test(s): history-1-dnf-2 history-1-dnf-3

@rh-atomic-bot
Copy link

💥 Test timed out

@dmach
Copy link
Author

dmach commented Sep 14, 2018

Depends on rpm-software-management/libdnf#579

@dmach
Copy link
Author

dmach commented Sep 19, 2018

@rh-atomic-bot try

@dmach
Copy link
Author

dmach commented Sep 19, 2018

@rh-atomic-bot retry

@rh-atomic-bot
Copy link

⌛ Trying commit 199d788 with merge 69b25ab...

rh-atomic-bot pushed a commit that referenced this pull request Sep 19, 2018
When transaction is populated directly, running scriptlets ends up
with errors: RuntimeError: TransactionItem not found for key: <rpm-name>
Using populating transaction via goal and Base._goal2transaction()
fixes the problem.

Resolves: rhbz#1625259

Closes: #1186
Approved by: <try>
@rh-atomic-bot
Copy link

💔 Test failed - status-papr

@j-mracek
Copy link
Member

All tests passed

@j-mracek
Copy link
Member

The code looks good

@j-mracek j-mracek merged commit b3edac8 into rpm-software-management:master Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants