Migrate main menu config to image display policy objects #471
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This turns
num_dailies
,num_weeklies
, andnum_releases
into three of the fields on a more generic image policy object.This object will initially be used for deciding which images to show on the main menu and which to show in the dropdown. It can also be used for choosing images to reap.
It defines both a number (that is, an image count, equivalent to the current behavior) and an age field, exactly one of which must be specified. Implementation of age-based filtering will be in a future PR. At the moment the functionality present is equivalent to what we have with the individual
num_
fields.It is quite possible that we want to remove PrepullerOptions (part of the v1 external API) and replace it with the policy in SpawnerMenuOptions.policy.main directly. This is part of something to be discussed Thursday, Feb. 6, 2025 in co-work. That would simplify this code a little (as we could remove the code that generates PrepullerOptions from the image policy), but have refactoring implications in the services layer (as well as our published (but with no external consumers) API).