Skip to content

Conversation

@gursewak1997
Copy link
Member

Reorganized the loop structure to iterate over builds first, followed by arch and then actions, optimizing the number of meta.json downloads and reducing redundancy.

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

trivial LGTM

A few questions/suggestions on the code as I was going through.

policy_cleanup = build.setdefault("policy-cleanup", {})
action_duration = convert_duration_to_days(policy[stream][action])
ref_date = today_date - relativedelta(days=int(action_duration))
images_to_keep = policy.get(stream, {}).get("images-keep", [])
Copy link
Member

Choose a reason for hiding this comment

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

images_to_keep should be the same for all runs of these loops, right? if so we can move the variable definition to the outside of these loops.

# Iterate through builds from oldest to newest
for build in reversed(builds):
build_id = build["id"]
(build_date, _) = parse_fcos_version_to_timestamp_and_stream(build_id)
Copy link
Member

Choose a reason for hiding this comment

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

are the outer parentheses required here?

Suggested change
(build_date, _) = parse_fcos_version_to_timestamp_and_stream(build_id)
build_date, _ = parse_fcos_version_to_timestamp_and_stream(build_id)

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

oh actually. if you look at the commit title it is wrong:

overrides: Pin kdump-utils-1.0.48-1.fc42 for ppc64le

Reorganized the loop structure to iterate over builds first, followed by arch
and then actions, optimizing the number of meta.json downloads and reducing redundancy.
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

@gursewak1997 gursewak1997 enabled auto-merge (rebase) November 12, 2024 18:30
@gursewak1997
Copy link
Member Author

/test rhcos

@gursewak1997 gursewak1997 merged commit 48fba72 into coreos:main Nov 12, 2024
5 checks passed
@gursewak1997 gursewak1997 deleted the refactor-gc-code branch November 12, 2024 23:56
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.

2 participants