-
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
rust/lockfile: Add more metadata to generated lockfiles #1938
rust/lockfile: Add more metadata to generated lockfiles #1938
Conversation
Prep for next patch.
E.g. the generation timestamp, repos that were enabled, and their generation timestamps. This is just generally useful, though I'd like to make use specifically of the new `metadata.generated` key in FCOS to drive versioning: coreos/fedora-coreos-releng-automation#50
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.
/approve
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
#[serde(deny_unknown_fields)] |
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.
As soon as this lands in cosa, it will force everyone to upgrade rpm-ostree. I think that's OK. Just noting.
gerror: *mut *mut glib_sys::GError, | ||
) -> libc::c_int { | ||
let filename = ffi_view_os_str(filename); | ||
let packages: Vec<*mut DnfPackage> = ffi_ptr_array_to_vec(packages); | ||
let rpmmd_repos: Vec<*mut DnfRepo> = ffi_ptr_array_to_vec(rpmmd_repos); | ||
|
||
// get current time, but scrub nanoseconds; it's overkill to serialize that |
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 if we instead something like reference the last time the file changed in git? Dunno.
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.
Heh yeah, that's in fact exactly what I initially did (see the commit message in coreos/fedora-coreos-releng-automation@c932c34). Though there were concerns that it was too magic/implicit.
DnfRepoEnabled enablement) | ||
{ | ||
g_autoptr(GPtrArray) ret = g_ptr_array_new (); | ||
GPtrArray *repos = dnf_context_get_repos (dnfctx); |
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.
One side note...from the current libdnf source I'm not sure this order is stable. They are pulled unordered from g_dir_read_name()
and passed to g_ptr_array_sort()
which is guaranteed stable, but we're not usually adding cost, so the array will remain unordered.
We should probably do something more like "sort by cost, then name" or something in libdnf?
(We want this to be stable or otherwise we'll be reordering things in the JSON)
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.
At least as far as the JSON output, we use a BTreeMap
on the repo name, so the order in which we serialize should already be stable (learned that lesson from #1865).
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.
Ah right, OK.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
E.g. the generation timestamp, repos that were enabled, and their
generation timestamps.
This is just generally useful, though I'd like to make use specifically
of the new
metadata.generated
key in FCOS to drive versioning:coreos/fedora-coreos-releng-automation#50