Skip to content

feat/search commit intent filter hardware#1902

Open
alanpeixinho wants to merge 1 commit into
kernelci:mainfrom
profusion:feat/search-commit-intent-filter-hardware
Open

feat/search commit intent filter hardware#1902
alanpeixinho wants to merge 1 commit into
kernelci:mainfrom
profusion:feat/search-commit-intent-filter-hardware

Conversation

@alanpeixinho
Copy link
Copy Markdown
Contributor

Include an option to do commit searches on the search bar of the hardware listing page.

How to test

  • Open the hardware listing page and type a valid commit hash, it should list include only the status of the specified commit.
  • When using regular text (not containing any valid commit hashes), the regular text search should take place.
  • In the case of using both, the page should join the behaviours, listing the selected commits, and applygin textual search for the extra text.

@alanpeixinho alanpeixinho force-pushed the feat/search-commit-intent-filter-hardware branch 5 times, most recently from a413002 to 87a4ad1 Compare May 15, 2026 17:15
  * Add optional gitCommitHashes query param (comma-separated full hashes).
  * Backend uses matching checkouts instead of tree heads when provided.
  * Dashboard parses commit hash tokens for hardware search.
  * Dashboard search bar simple intent detection to apply smart search.

  One-line variant:

  feat(hardware): add gitCommitHashes filter and search intent for commits

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho alanpeixinho force-pushed the feat/search-commit-intent-filter-hardware branch from 87a4ad1 to a57a074 Compare May 15, 2026 20:10
@alanpeixinho alanpeixinho marked this pull request as ready for review May 15, 2026 20:11
@gustavobtflores gustavobtflores added enhancement New feature or request Frontend Most or all of the changes for this issue will be in the frontend code. labels May 19, 2026
Comment on lines +39 to +62
sql, exec_params = mock_cursor.execute.call_args[0]
assert "selected_checkouts AS" in sql
assert "SELECT DISTINCT" in sql
assert "commits_list" not in exec_params

@patch("kernelCI_app.queries.hardware.connection")
def test_get_hardware_listing_data_commit_filter_tokens(self, mock_connection):
mock_cursor = setup_mock_cursor(mock_connection)
mock_cursor.fetchall.return_value = []

get_hardware_listing_data(
start_date=datetime(2025, 11, 10),
end_date=datetime(2025, 11, 12),
origin="maestro",
commits_list=["a" * 40],
)

sql, exec_params = mock_cursor.execute.call_args[0]
assert "selected_checkouts AS" in sql
assert "JOIN selected_checkouts AC ON b.checkout_id = AC.id" in sql
assert "ANY(%(commits_list)s)" in sql
assert "git_commit_tags" in sql and "&&" in sql
assert "SELECT DISTINCT" not in sql
assert exec_params["commits_list"] == ["a" * 40]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't feel that these tests are valuable, tbh

@gustavobtflores
Copy link
Copy Markdown
Contributor

The PR introduces changes to the HardwareV1 page, which is not currently used in the dashboard. We should apply these changes to the V2 version instead.

We may also consider removing this separation entirely in another PR to avoid further confusion.

!commitIntentTokens.some(t =>
matchesCommitToken(
tree.head_git_commit_hash ?? '',
tree.head_git_commit_tags,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The field sent from the backend is head_git_commit_tag not head_git_commit_tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Frontend Most or all of the changes for this issue will be in the frontend code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants