Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: allow multiple ignores#245

Merged
niemeyer merged 2 commits intocanonical:mainfrom
lczyk:allow_multiple_ignores
Oct 6, 2025
Merged

feat: allow multiple ignores#245
niemeyer merged 2 commits intocanonical:mainfrom
lczyk:allow_multiple_ignores

Conversation

@lczyk
Copy link
Contributor

@lczyk lczyk commented Sep 30, 2025

  • Have you signed the CLA?

Allows passing multiple --ignore flags, for example chisel cut --release=./ --root=rootfs --ignore=unmaintained --ignore=unstable libc6_libs`.

Proposal for addressing this issue/PR in chisel-releases.

TLDR; in chisel-releases cli we want a general cut command which will try to cut both unmaintained and unstable releases (at the time of writing this is 20.04 and 25.10 respectively). As opposed to figuring out the logic dynamically we could just always pass all the ignore flags.

I would also argue that this is the intuitive behavior users would expect + allows us to trivially expand into any future conditions we might want to ignore.

@github-actions
Copy link

github-actions bot commented Sep 30, 2025

Command Mean [s] Min [s] Max [s] Relative
BASE 8.861 ± 0.078 8.693 8.932 1.00
HEAD 8.900 ± 0.157 8.722 9.166 1.00 ± 0.02

Copy link
Collaborator

@letFunny letFunny left a comment

Choose a reason for hiding this comment

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

This looks good, thank you! I was reluctant to allow this in the first place to prevent people from adding this blindly to their CI scripts and using outdated and non-secure image without even knowing about it. Thinking about it some more, that could happen even with one flag as unstable is unlikely to be used for production systems anyway.

I am also tempted to have some tests but I don't think it makes a lot of sense. We are testing both flags individually already using spread and I don't want to have unrelated tests just to combine all flags available in the CI even if not relevant for the case at hand.

@letFunny letFunny added the Simple Nice for a quick look on a minute or two label Oct 2, 2025
@letFunny letFunny requested a review from niemeyer October 2, 2025 10:51
@lczyk
Copy link
Contributor Author

lczyk commented Oct 2, 2025

I am also tempted to have some tests but I don't think it makes a lot of sense...

Yeah, thought about it but wanted to keep the PR small and wait for the feedback. I have tested locally and 1) only the unmaintained and unstable are allowed and 2) if passing both, both are present in cmd.Ignore. All in all github.com/jessevdk/go-flags is doing its job really well 👍

More than happy to add specific multi-flag tests if requested though.

@letFunny
Copy link
Collaborator

letFunny commented Oct 3, 2025

We are already testing them individually. Testing the combination specifically might make sense but it might also be seen as testing the go-flags library.

Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

PR looks fine, and idea is correct. Just a question in terms of conventions: I imagined that we'd be supporting something like --ignore=unmaintained,unstable, but I'm not sure if we have precedence in either direction.

@letFunny Do we have anything analogous in either direction?

@niemeyer
Copy link
Contributor

niemeyer commented Oct 6, 2025

In either case, we can do both. I'm merging this for now.

@niemeyer niemeyer merged commit 2204bf5 into canonical:main Oct 6, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Simple Nice for a quick look on a minute or two

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants