bootc-base-imagectl: support hidden manifests, hide minimal-plus

We don't currently want the minimal-plus target to be user-facing. It's
intended only for other Fedora variants.

Let's support "hidden" manifests by having their names end in
`.hidden.yaml`. Then, make `minimal-plus` hidden.

I considered instead having them start with `.` to match
well-established semantics, but I don't like either that this hides them
from an `ls` in the git repo (or even with `-a`, puts them higher up
whereas I want it to be close to `minimal.yaml`).

I also considered leveraging the existing symlink hiding semantics, but
it also felt awkward to rename a file and add a symlink to it just for
the purpose of hiding it.
This commit is contained in:
Jonathan Lebon 2025-06-17 15:07:23 -04:00
parent c2ff52a7cf
commit 87eae9910e
No known key found for this signature in database
12 changed files with 21 additions and 12 deletions

View file

@ -10,7 +10,7 @@ metadata:
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|| "./minimal-plus.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|| "./minimal-plus.hidden.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-42-iot-pull-request.yaml".pathChanged()
|| "Containerfile".pathChanged() )

View file

@ -9,7 +9,7 @@ metadata:
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|| "./minimal-plus.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|| "./minimal-plus.hidden.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-42-iot-push.yaml".pathChanged()
|| "Containerfile".pathChanged() )

View file

@ -9,7 +9,7 @@ metadata:
pipelinesascode.tekton.dev/cancel-in-progress: "true"
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "./minimal-plus.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
== "main" && ( "./minimal-plus.hidden.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-42-minimal-plus-pull-request.yaml".pathChanged()
|| "Containerfile".pathChanged() )
creationTimestamp: null

View file

@ -8,7 +8,7 @@ metadata:
pipelinesascode.tekton.dev/cancel-in-progress: "false"
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main" && ( "./minimal-plus.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
== "main" && ( "./minimal-plus.hidden.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-42-minimal-plus-push.yaml".pathChanged()
|| "Containerfile".pathChanged() )
creationTimestamp: null

View file

@ -10,7 +10,7 @@ metadata:
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|| "./minimal-plus.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|| "./minimal-plus.hidden.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-rawhide-iot-pull-request.yaml".pathChanged()
|| "Containerfile".pathChanged() )

View file

@ -9,7 +9,7 @@ metadata:
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|| "./minimal-plus.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|| "./minimal-plus.hidden.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-rawhide-iot-push.yaml".pathChanged()
|| "Containerfile".pathChanged() )

View file

@ -9,7 +9,7 @@ metadata:
pipelinesascode.tekton.dev/cancel-in-progress: "true"
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "./minimal-plus.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
== "main" && ( "./minimal-plus.hidden.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-rawhide-minimal-plus-pull-request.yaml".pathChanged()
|| "Containerfile".pathChanged() )
creationTimestamp: null

View file

@ -8,7 +8,7 @@ metadata:
pipelinesascode.tekton.dev/cancel-in-progress: "false"
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main" && ( "./minimal-plus.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
== "main" && ( "./minimal-plus.hidden.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-rawhide-minimal-plus-push.yaml".pathChanged()
|| "Containerfile".pathChanged() )
creationTimestamp: null

View file

@ -17,7 +17,12 @@ def run_build_rootfs(args):
Regenerates a base image using a build configuration.
"""
target = args.target
manifest_path = f'/{MANIFESTDIR}/{args.manifest}.yaml'
for fn in [f'{args.manifest}.yaml', f'{args.manifest}.hidden.yaml']:
manifest_path = f'/{MANIFESTDIR}/{fn}'
if os.path.exists(manifest_path):
break
else:
raise Exception(f"manifest not found: {args.manifest}")
rpmostree_argv = ['rpm-ostree', 'compose', 'rootfs']
@ -116,7 +121,7 @@ def run_list(args):
d = '/' + MANIFESTDIR
for ent in sorted(os.listdir(d)):
name, ext = os.path.splitext(ent)
if ext != '.yaml':
if ext != '.yaml' or name.endswith('.hidden'):
continue
fullpath = os.path.join(d, ent)
if os.path.islink(fullpath):

View file

@ -1 +1 @@
minimal-plus.yaml
minimal-plus.hidden.yaml

View file

@ -8,7 +8,11 @@ for image in minimal standard minimal-plus iot; do
# Embed the generic defaults
cp -a $image $manifestdir/
# And the top-level Fedora-specific manifests
cp -a $image.yaml $manifestdir/
if [ -f $image.hidden.yaml ]; then
cp -a $image.hidden.yaml $manifestdir/
else
cp -a $image.yaml $manifestdir/
fi
# And the legacy `fedora-` prefixed names
cp -a fedora-$image.yaml $manifestdir/
done