Skip to content

Commit f2d9742

Browse files
committed
fix: drop build_filter and use build_regex for server-side filtering
Motivation: Drop the redundant build_filter configuration parameter as it caused confusion when it overlapped with build_regex. Design Choices: Removed build_filter from Settings, IncrementConfig, and CLI arguments. Updated load_build_info to use build_regex directly for server-side OBS filtering. Benefits: Simplified configuration and code logic, avoiding ambiguity between two filtering parameters that were often used for the same purpose. Related issue: #496 (comment)
1 parent 9196d2a commit f2d9742

File tree

4 files changed

+1
-13
lines changed

4 files changed

+1
-13
lines changed

openqabot/args.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -592,14 +592,6 @@ def increment_approve( # noqa: PLR0913
592592
str,
593593
typer.Option("--product-regex", help="The regex used to determine what products are relevant"),
594594
] = "^SLE.*",
595-
build_filter: Annotated[
596-
str | None,
597-
typer.Option(
598-
"--build-filter",
599-
envvar="QEM_BOT_BUILD_FILTER",
600-
help="The server-side pattern matching filter for the build listing",
601-
),
602-
] = config_module.settings.build_filter,
603595
increment_config: Annotated[
604596
Path | None,
605597
typer.Option(
@@ -626,7 +618,6 @@ def increment_approve( # noqa: PLR0913
626618
args.build_listing_sub_path = build_listing_sub_path
627619
args.build_regex = build_regex
628620
args.product_regex = product_regex
629-
args.build_filter = build_filter
630621
args.increment_config = increment_config
631622
args.comment = comment
632623

openqabot/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class Settings(BaseSettings):
4545
singlearch: Path = Field(default=Path("/etc/openqabot/singlearch.yml"), alias="QEM_BOT_SINGLEARCH")
4646
retry: int = Field(default=2, alias="QEM_BOT_RETRY")
4747
approve_comment: bool = Field(default=False, alias="QEM_BOT_APPROVE_COMMENT")
48-
build_filter: str | None = Field(default=None, alias="QEM_BOT_BUILD_FILTER")
4948

5049
# App-specific settings
5150
qem_dashboard_url: str = Field(default="http://dashboard.qam.suse.de/", alias="QEM_DASHBOARD_URL")

openqabot/loader/buildinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def load_build_info(
3232
build_project_url = config.build_project_url()
3333
sub_path = config.build_listing_sub_path
3434
url = f"{build_project_url}/{sub_path}/"
35-
params = get_obs_filter_params(config.build_filter or build_regex)
35+
params = get_obs_filter_params(build_regex)
3636
log.debug("Checking for '%s' files on %s with params %s", build_regex, url, params)
3737
rows = retried_requests.get(url, params=params).json().get("data", [])
3838

openqabot/loader/incrementconfig.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class IncrementConfig:
4141
build_listing_sub_path: str = ""
4242
build_regex: str = ""
4343
product_regex: str = ""
44-
build_filter: str | None = field(default_factory=lambda: config.settings.build_filter)
4544
version_regex: str = DEFAULT_VERSION_REGEX
4645
packages: list[str] = field(default_factory=list)
4746
archs: set[str] = field(default_factory=set)
@@ -91,7 +90,6 @@ def from_config_entry(entry: dict[str, Any]) -> IncrementConfig:
9190
build_listing_sub_path=entry["build_listing_sub_path"],
9291
build_regex=entry["build_regex"],
9392
product_regex=entry["product_regex"],
94-
build_filter=entry.get("build_filter", config.settings.build_filter),
9593
version_regex=entry.get("version_regex", DEFAULT_VERSION_REGEX),
9694
packages=entry.get("packages", []),
9795
archs=set(entry.get("archs", [])),

0 commit comments

Comments
 (0)