Skip to content

Add --labels option to filter configs at load time - #98

Merged
yselkowitz merged 2 commits into
fedora-eln:masterfrom
tdawson:command-line-labels
Oct 29, 2025
Merged

yselkowitz merged 2 commits into
fedora-eln:masterfrom
tdawson:command-line-labels

Conversation

@tdawson

@tdawson tdawson commented Oct 22, 2025

Copy link
Copy Markdown
Member

This adds the --labels option to the command line.

It accepts a comma-separated list of label IDs to process. If not specified, all labels are processed.
If an addon (Example: eln-extras) is listed, it makes sure that the base label/view is also added.
Only workloads, environments, views, and repos matching the specified labels will be analyzed.

Assisted-by: Claude noreply@anthropic.com

@tdawson tdawson mentioned this pull request Oct 22, 2025
@yselkowitz yselkowitz linked an issue Oct 22, 2025 that may be closed by this pull request
@yselkowitz

Copy link
Copy Markdown
Member

According to CI, the test needs to be fixed.

@tdawson

tdawson commented Oct 23, 2025

Copy link
Copy Markdown
Member Author

Interesting. I can do it manually and it tests just fine (./test_label_filtering.py) but I didn't test it with pytest.
I need to track down how it's getting "all_configs" when running it manually.

@yselkowitz
yselkowitz self-requested a review October 23, 2025 17:09
@tdawson

tdawson commented Oct 23, 2025

Copy link
Copy Markdown
Member Author

I re-wrote the tests to be pytest tests, also added more.
I'm going to squash it into one commit.
I just wanted to double check before squashing it.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Troy Dawson <tdawson@redhat.com>
@tdawson
tdawson force-pushed the command-line-labels branch from c71e272 to b421b28 Compare October 23, 2025 17:15

@yselkowitz yselkowitz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Running a test now. So far the results seem okay, but the console output needs a tweak.

Comment thread content_resolver/config_manager.py Outdated
Comment thread content_resolver/config_manager.py Outdated
Comment thread content_resolver/config_manager.py Outdated
Comment thread content_resolver/config_manager.py Outdated
Signed-off-by: Troy Dawson <tdawson@redhat.com>
@tdawson

tdawson commented Oct 29, 2025

Copy link
Copy Markdown
Member Author

Good catch. It was literally counting the same thing. We don't really need it since we already listed everything in the per-filtering summary.
I also wanted it to list the views. It makes me feel better knowing what views there are, especially if I only ilsted an add-on.

@yselkowitz yselkowitz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@yselkowitz
yselkowitz merged commit 3032575 into fedora-eln:master Oct 29, 2025
1 check passed
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.

Speed Up Content Resolver

2 participants