Skip to content

ART-19650: Fix group input to use client-side filtering - #208

Merged
locriandev merged 1 commit into
art-build-historyfrom
feature/art-19650-group-filter
Jun 8, 2026
Merged

ART-19650: Fix group input to use client-side filtering#208
locriandev merged 1 commit into
art-build-historyfrom
feature/art-19650-group-filter

Conversation

@locriandev

@locriandev locriandev commented Jun 8, 2026

Copy link
Copy Markdown

Summary

Enables client-side filtering by group for already-cached results, avoiding unnecessary BigQuery queries.

The Problem

Currently, group filtering works but always requires fetching from BigQuery. This fix enables filtering cached results client-side.

Current Behavior (Before Fix)

  1. User searches for builds (e.g., name="openshift-cli", no group filter)
  2. BigQuery returns 500 builds across multiple groups (4.15, 4.16, 4.17, etc.)
  3. Results are cached in browser
  4. User wants to see only 4.16 builds from the cached results
  5. User changes Group field to "openshift-4.16"
  6. ❌ "Filter view" button doesn't appear (autocomplete doesn't trigger change events)
  7. ❌ User forced to click "Fetch from DB" again
  8. New BigQuery query runs even though data is already cached

New Behavior (After Fix)

  1. User searches for builds (e.g., name="openshift-cli", no group filter)
  2. BigQuery returns 500 builds across multiple groups
  3. Results are cached in browser
  4. User wants to see only 4.16 builds from the cached results
  5. User changes Group field to "openshift-4.16" (via autocomplete or typing)
  6. ✅ "Filter view" button appears (autocomplete now triggers change events)
  7. ✅ User clicks "Filter view"
  8. Results filtered client-side from cache - no BigQuery query

Root Cause

The group field was already supported in the matchesFilters() client-side filtering function, but the UI wasn't making it discoverable because:

  1. Autocomplete selections didn't trigger form change events - selecting from dropdown updated the value but didn't dispatch change event
  2. Missing wildcard support - group field didn't support * to match all groups (unlike assembly field)

Solution

Client-side filtering enhancements

  • Added wildcard * support for group field (consistent with assembly field)
  • Fixed 3 autocomplete functions to dispatch change events when selections are made:
    • setupAutocomplete() - used for Group field
    • setupStaticAutocomplete() - used for Assembly field
    • setupSourceRepoAutocomplete() - used for Source Repository field
  • Now properly shows "Filter view" button when these fields change via autocomplete

Files Changed

  • static/js/index.js: Enhanced group filtering + event dispatching in 3 autocomplete functions
  • tests/static/index.test.js: Added 3 new tests for group filtering behavior
  • app.py: Auto-formatting by ruff

Benefits

  • Faster filtering - no network round-trip to BigQuery
  • Reduced database load - fewer queries when exploring cached data
  • Better UX - users can interactively filter results across groups without re-fetching

Testing

  • ✅ All 46 JavaScript tests pass (including 3 new group filter tests)
  • ✅ All 16 Python tests pass
  • ✅ Linter passes with no errors
  • ✅ Manually tested application startup

How to Test

  1. Search for builds without specifying a group (e.g., name="openshift-cli")
  2. Observe results from multiple groups are cached
  3. Change the Group field to a specific group (e.g., "openshift-4.16")
  4. Verify "Filter view" button appears
  5. Click "Filter view"
  6. Verify results are filtered client-side (check Network tab - no new /search request)
  7. Verify only builds from selected group are displayed

Fixes: https://redhat.atlassian.net/browse/ART-19650

- Add wildcard '*' support for group filtering (matches all groups)
- Dispatch change events when autocomplete selections are made
- This ensures the "Filter view" button appears when group/assembly/source_repo fields are changed via autocomplete
- Previously, selecting from autocomplete dropdowns would update the input value but not trigger form change detection
- Add comprehensive tests for group filtering behavior

Fixes: ART-19650

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@locriandev locriandev changed the title Fix group input to use client-side filtering (ART-19650) ART-19650: Fix group input to use client-side filtering Jun 8, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 8, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 8, 2026

Copy link
Copy Markdown

@locriandev: This pull request references ART-19650 which is a valid jira issue.

Details

In response to this:

Summary

Fixes group input field to properly use client-side filtering instead of requiring a BigQuery refetch when changed.

Problem

The Group input field was already supported in the client-side filtering logic, but had two issues:

  1. Autocomplete selections didn't trigger form change events, so the "Filter view" button never appeared
  2. Missing wildcard * support for matching all groups

Solution

Client-side filtering enhancements

  • Added wildcard * support for group field (consistent with assembly field)
  • Fixed autocomplete functions to dispatch change events when selections are made
  • Now properly shows "Filter view" button when group/assembly/source_repo fields change

Files Changed

  • static/js/index.js: Enhanced group filtering + event dispatching in 3 autocomplete functions
  • tests/static/index.test.js: Added 3 new tests for group filtering behavior
  • app.py: Auto-formatting by ruff

Testing

  • ✅ All 46 JavaScript tests pass (including 3 new group filter tests)
  • ✅ All 16 Python tests pass
  • ✅ Linter passes with no errors
  • ✅ Manually tested application startup

How to Test

  1. Perform a search to get cached results
  2. Change the Group field (type or select from autocomplete)
  3. Verify "Filter view" button appears
  4. Click "Filter view" to apply group filter without BigQuery refetch
  5. Verify results are filtered to the selected group

Fixes: https://redhat.atlassian.net/browse/ART-19650

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@rayfordj

rayfordj commented Jun 8, 2026

Copy link
Copy Markdown

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 8, 2026
@locriandev
locriandev merged commit 34580fe into art-build-history Jun 8, 2026
1 of 2 checks passed
@locriandev
locriandev deleted the feature/art-19650-group-filter branch June 8, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants