-
Notifications
You must be signed in to change notification settings - Fork 197
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 new ex history
command
#1813
Conversation
Requires ostreedev/ostree#1842 |
e8a03f3
to
75aee0e
Compare
☔ The latest upstream changes (presumably 97bb57d) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Just two quick comments. Not sure I understand the high level theory of operation, how the history dir and the journal interact, etc. A brief description of that type of stuff (e.g. as a rustdoc header in the history.rs
file) could help a lot.
Fixup! ⬆️ I added docstrings on the functions that missed them and a header describing the overall approach. In the process, I ended up renaming a bunch of things to clearer, more appropriate, names. |
Rebased! (Just marking as "Ready for review" to pass it through CI). |
bot, retest this please |
One overall doubt that the docstring didn't answer: is there some garbage-collection mechanism to be considered/planned/implemented here for history files? |
Yes, this is implemented by |
/me bikesheds In a recent demo of this work, @jlebon pointed out that @dustymabe suggested that we go a step further and track this difference, so I think this would be excellent, as long as we could display this info in a sane way. Maybe use The more I think on this, it seems like it's really only the |
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.
Overall, this is good code. The doc comment helps significantly, though I still find myself a bit lost while trying to grasp some of the details.
I like the journal unit tests.
We're a bit lacking real e2e tests - we could at least sprinkle a few ex history
assertions inside the existing tests probably?
Overall particularly given the fact that this is ex
I'm in disposition to merge, though I do have one question around the architecture at the end - it seems dramatically simpler if we can serialize everything we care about in the journal.
* it breaks the expectation that journal messages should be somewhat easily | ||
* introspectable. We could also serialize it to JSON first, though we wouldn't be able to | ||
* re-use the printing code in `status.c` as is. Note also the GVariant can be large (e.g. | ||
* we include the full `rpmostree.rpmdb.pkglist` in there). */ |
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.
What elements of this deployment variant do we use? The other option is to log those as structured fields right?
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.
What elements of this deployment variant do we use?
Basically almost everything. :) We pass it to the same function in status.c
that normally prints it. I also want to make use of the pkglist in the future so that we can show the diff from one version to the next.
The other option is to log those as structured fields right?
Yeah, I had briefly looked at this. One obvious annoyance is that the field naming convention means we have to do some translation back and forth for the top-level keys. And the values themselves I guess would have to be run through g_variant_print
and g_variant_parse
. Still, I go back to whether we should shove that much data in the journal in the first place. (Even though the actual limit is a crazy amount like 768M...). It somewhat reminds me of the D-Bus/--json
discussion around pkglists and how we ended up blacklisting it, even though it's mostly for machines.
Yeah, I'm pretty confident in the unit tests, though I definitely intend to add some basic vmcheck tests as well! |
I just realized now that I squashed changes into the commit and rebased in one shot, which makes it hard to see what changed. Anyway, it was mostly a rebase + supporting |
Now with tests! Dropped WIP and updated the original comment as well with the final commit message. I haven't addressed the feedback in #1813 (comment) other than renaming the key names to |
86f7f32
to
443fe25
Compare
This is the rpm-ostree equivalent of `dnf history`. As opposed to the history of the refspec (i.e. `ostree log`), this shows the history of the system, i.e. the refspecs the host deployed, checksums, versions, layered packages, etc... The amount of details remembered is similar to what shows up in `status`. There's definitely some further enhancements possible (e.g. printing package diffs, displaying rollbacks), though this seems in good enough shape as a first cut. Closes: coreos#1489
✔️ Tests all green now! |
I think this is safe enough to try out and use to gather feedback. Thanks for the work on this! |
This is the rpm-ostree equivalent of `dnf history`. As opposed to the history of the refspec (i.e. `ostree log`), this shows the history of the system, i.e. the refspecs the host deployed, checksums, versions, layered packages, etc... The amount of details remembered is similar to what shows up in `status`. There's definitely some further enhancements possible (e.g. printing package diffs, displaying rollbacks), though this seems in good enough shape as a first cut. Closes: #1489 Closes: #1813 Approved by: cgwalters
💔 Test failed - status-papr |
@rh-atomic-bot retry |
This is the rpm-ostree equivalent of `dnf history`. As opposed to the history of the refspec (i.e. `ostree log`), this shows the history of the system, i.e. the refspecs the host deployed, checksums, versions, layered packages, etc... The amount of details remembered is similar to what shows up in `status`. There's definitely some further enhancements possible (e.g. printing package diffs, displaying rollbacks), though this seems in good enough shape as a first cut. Closes: #1489 Closes: #1813 Approved by: cgwalters
💔 Test failed - status-papr |
@rh-atomic-bot retry |
This is the rpm-ostree equivalent of `dnf history`. As opposed to the history of the refspec (i.e. `ostree log`), this shows the history of the system, i.e. the refspecs the host deployed, checksums, versions, layered packages, etc... The amount of details remembered is similar to what shows up in `status`. There's definitely some further enhancements possible (e.g. printing package diffs, displaying rollbacks), though this seems in good enough shape as a first cut. Closes: #1489 Closes: #1813 Approved by: cgwalters
💔 Test failed - status-papr |
@rh-atomic-bot retry |
This is the rpm-ostree equivalent of `dnf history`. As opposed to the history of the refspec (i.e. `ostree log`), this shows the history of the system, i.e. the refspecs the host deployed, checksums, versions, layered packages, etc... The amount of details remembered is similar to what shows up in `status`. There's definitely some further enhancements possible (e.g. printing package diffs, displaying rollbacks), though this seems in good enough shape as a first cut. Closes: #1489 Closes: #1813 Approved by: cgwalters
💔 Test failed - status-papr |
@rh-atomic-bot retry |
☀️ Test successful - status-papr |
This is the rpm-ostree equivalent of
dnf history
. As opposed to thehistory of the refspec (i.e.
ostree log
), this shows the history ofthe system, i.e. the refspecs the host deployed, checksums, versions,
layered packages, etc... The amount of details remembered is similar to
what shows up in
status
.There's definitely some further enhancements possible (e.g. printing
package diffs, displaying rollbacks), though this seems in good enough
shape as a first cut.
Closes: #1489