-
Notifications
You must be signed in to change notification settings - Fork 87
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
Add replay
command to replay stored transactions
#1536
Add replay
command to replay stored transactions
#1536
Conversation
dnf5/commands/replay/replay.cpp
Outdated
settings.set_ignore_installed(ignore_installed->get_value()); | ||
|
||
try { | ||
context.get_goal()->add_serialized_transaction(transaction_path + TRANSACTION_JSON, settings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not right - transaction_path + TRANSACTION_JSON
. It incorrectly merge path and file name even with default setting to cirrent directory and file transactiontransaction.json
.
The second problem is with permissions - -rw-------. 1 root root 166 Jun 11 13:59 tmptransaction.json
I would prefer to grand a read permissions to everyone. But this is related to Goal method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but there are some parts that could be improved.
I have added a new commit which adds error handling for paring of the JSON serialized transaction. It introduces |
Rebased to fix the builddep plugin failing build. |
Also removes couple unused headers.
Rebased again to fix new conflicts. |
Added |
doc/changes.rst
Outdated
@@ -203,6 +203,9 @@ Changes to individual commands | |||
|
|||
``history`` | |||
* ``undo`` subcommand now accepts ``--ignore-extras`` and ``--ignore-installed`` like original ``history replay`` command. | |||
* ``store`` subcommand now outputs a directory with transaction JSON file instead of a single transaction JSON file directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow it is not clear to me. What about:
store
subcommand accepts directory path as an argument instead of file path. The default is ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated it and added a new line about the --output
option.
doc/changes.rst
Outdated
@@ -203,6 +203,9 @@ Changes to individual commands | |||
|
|||
``history`` | |||
* ``undo`` subcommand now accepts ``--ignore-extras`` and ``--ignore-installed`` like original ``history replay`` command. | |||
* ``store`` subcommand now outputs a directory with transaction JSON file instead of a single transaction JSON file directly. | |||
* ``replay`` subcommand was moved to a standalone ``replay`` command, that now accepts a path to a directory instead of a single file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor or optional - What about to replace of a single file
by of a file path
.
doc/changes.rst
Outdated
@@ -203,6 +203,9 @@ Changes to individual commands | |||
|
|||
``history`` | |||
* ``undo`` subcommand now accepts ``--ignore-extras`` and ``--ignore-installed`` like original ``history replay`` command. | |||
* ``store`` subcommand now outputs a directory with transaction JSON file instead of a single transaction JSON file directly. | |||
* ``replay`` subcommand was moved to a standalone ``replay`` command, that now accepts a path to a directory instead of a single file. | |||
The directory can be created with ``--store`` option and in addition to the JSON transaction can contain packages, group and environments used in the transaction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that transaction can
is incorrect and there should be transaction, it can
.
In comparison to dnf4 the command: - is no longer a `history` subcommand, it is a standalone command. - accepts as an argument a path to a directory where the transaction is stored. This is because now any transaction can be stored using the `--store` option which also stores the elements (packages, groups..) of the transaction.
This allows referencing from other files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
01f0c59
I am proposing to name the command
replay
because in my opinion it nicely conveys the functionality and it has continuity with the dnf4 command. However I am not against discussing other names.In comparison to dnf4 the command:
history
subcommand, it is a standalone command.stored. This is because now any transaction can be stored using the
--store
option which also stores the elements (packages, groups..)of the transaction.
This is the CLI for replying serialized transactions. The same API is already used by system upgrade and history undo.
It is required to enable a lot of CI tests but I will work on that once we decide on the command name.