Skip to content

Fix stale dateField URL param and restore SearchListFilter test comments#26532

Merged
ShaileshParmar11 merged 14 commits intomainfrom
copilot/add-incident-manager-filtering
Mar 20, 2026
Merged

Fix stale dateField URL param and restore SearchListFilter test comments#26532
ShaileshParmar11 merged 14 commits intomainfrom
copilot/add-incident-manager-filtering

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

Demo:

Screen.Recording.2026-03-18.at.9.35.31.PM.mov

Two fixes on top of the incident manager date-field filtering feature:

handleDateRangeClear — stale dateField URL param

When clearing the date range picker, dateField was omitted from the cleanup, leaving a stale param in the URL. On the next date range selection, the old dateField value silently persisted to the API.

  const updatedFilters = omit(allParams, [
    'startTs',
    'endTs',
    'key',
    'title',
+   'dateField',   // clear together with the date range it belongs to
  ]);

SearchListFilterTest.java — comments restored

Explanatory comments that document the dateField routing contract (timestamp@timestamp, updatedAtupdatedAt) and per-test intent were removed in a prior session. They are now restored.

Also corrected the noTimestamp test's expected value: TestCaseResolutionStatus is a time-series entity with no deleted field, so the filter falls back to match_all rather than {"term": {"deleted": "false"}}.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

  • I have added a test that covers the exact scenario we are fixing.

  • I have added tests around the new logic.

Original prompt

This section details on the original issue you should resolve

<issue_title>Incident manager filtering</issue_title>
<issue_description>Feature
As a user when looking at the incident manager tab I want to be able to visualize and filter by either last updated at or created at.

Currently the incident manager only allows for filter on created at date, but the timestamp shows the last updated at creating confusion for users

Image</issue_description>

<agent_instructions>also add relevant tests for the fixes</agent_instructions>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

… Manager

- Backend: Add dateField query param to /search/list endpoint in TestCaseResolutionStatusResource
- Backend: Update SearchListFilter to filter by updatedAt when dateField=updatedAt, else @timestamp
- Frontend: Add dateField to TestCaseIncidentStatusParams type
- Frontend: Add date field type selector (Created At / Last Updated At) to IncidentManager UI
- Tests: Add unit tests for date field selector rendering, URL updates, and API param passing

Co-authored-by: ShaileshParmar11 <71748675+ShaileshParmar11@users.noreply.github.com>
Copilot AI changed the title [WIP] Add filtering options for incident manager by last updated and created at Fixes: Add Created At / Last Updated At date field selector to Incident Manager filter Mar 17, 2026
Copilot AI requested a review from ShaileshParmar11 March 17, 2026 04:59
…e in IncidentManager

- Use SortingDropDown (text + chevron, same as TableQueries) instead of Ant Design Select
- Remove the 'Date:' Form.Item label wrapper
- The date field type selector now shows inline as e.g. 'Created at ∨' beside the date range picker
- Update unit tests to mock SortingDropDown and use button-based interaction

Co-authored-by: ShaileshParmar11 <71748675+ShaileshParmar11@users.noreply.github.com>
Copilot AI changed the title Fixes: Add Created At / Last Updated At date field selector to Incident Manager filter Fixes: Add Created At / Last Updated At date field filter to Incident Manager Mar 18, 2026
@github-actions
Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions
Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

… and unused import

Co-authored-by: ShaileshParmar11 <71748675+ShaileshParmar11@users.noreply.github.com>
Copilot AI changed the title Fixes: Add Created At / Last Updated At date field filter to Incident Manager Improvement: Replace Date label with inline dropdown in Incident Manager filter bar Mar 18, 2026
… value

Co-authored-by: ShaileshParmar11 <71748675+ShaileshParmar11@users.noreply.github.com>
Copilot AI changed the title Improvement: Replace Date label with inline dropdown in Incident Manager filter bar Add backend unit tests for dateField routing in SearchListFilter incident status queries Mar 18, 2026
Co-authored-by: ShaileshParmar11 <71748675+ShaileshParmar11@users.noreply.github.com>
@github-actions
Copy link
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

TeddyCr
TeddyCr previously approved these changes Mar 18, 2026
@github-actions
Copy link
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@github-actions
Copy link
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
64.99% (57997/89229) 44.76% (30666/68507) 47.75% (9176/19213)

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

🟡 Playwright Results — all passed (11 flaky)

✅ 3398 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 183 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 455 0 0 2
✅ Shard 2 305 0 0 1
🟡 Shard 3 670 0 5 33
🟡 Shard 4 687 0 1 41
🟡 Shard 5 671 0 1 73
🟡 Shard 6 610 0 4 33
🟡 11 flaky test(s) (passed on retry)
  • Features/BulkImport.spec.ts › Database (shard 3, 1 retry)
  • Features/DataQuality/TestCaseIncidentPermissions.spec.ts › User with TEST_CASE.EDIT_ALL can see edit icon on incidents (shard 3, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with only VIEW cannot PATCH results (shard 3, 1 retry)
  • Features/ImpactAnalysis.spec.ts › Verify Upstream connections (shard 3, 1 retry)
  • Features/Permissions/GlossaryPermissions.spec.ts › Team-based permissions work correctly (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Tag Add, Update and Remove (shard 5, 2 retries)
  • Pages/HyperlinkCustomProperty.spec.ts › should accept valid http and https URLs (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Announcement create, edit & delete (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@gitar-bot
Copy link

gitar-bot bot commented Mar 19, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Fixes stale dateField URL parameter handling and restores SearchListFilterTest comments, addressing type mismatch in callback prop and clearing dateField when date range is cleared. No issues found.

✅ 2 resolved
Bug: Type mismatch: narrow callback passed to broader prop type

📄 openmetadata-ui/src/main/resources/ui/src/components/IncidentManager/IncidentManager.component.tsx:765
handleDateFieldChange is typed as (value: 'timestamp' | 'updatedAt') => void, but SortingDropDown expects handleFieldDropDown: (value: string) => void. Under strictFunctionTypes, TypeScript will reject this assignment because the callback's parameter type is narrower than what the prop declares. At runtime this is safe since fieldList only contains those two values, but the types are technically incompatible.

Either widen handleDateFieldChange to accept string (with a runtime guard/cast inside), or use an inline wrapper.

Edge Case: dateField not cleared when date range is cleared

📄 openmetadata-ui/src/main/resources/ui/src/components/IncidentManager/IncidentManager.component.tsx:437
When the user clears the date range picker via handleDateRangeClear, startTs and endTs are removed from the URL params, but dateField is not. This leaves a stale dateField parameter in the URL and in API requests even though no date range is active. While the backend handles this gracefully (the dateField is only used inside the if (startTimestamp != null && endTimestamp != null) guard), it's still a UX issue: if the user later sets a new date range, the previously selected dateField silently persists, which may surprise the user.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link

@ShaileshParmar11 ShaileshParmar11 enabled auto-merge (squash) March 20, 2026 04:42
@ShaileshParmar11 ShaileshParmar11 merged commit b51735a into main Mar 20, 2026
44 of 45 checks passed
@ShaileshParmar11 ShaileshParmar11 deleted the copilot/add-incident-manager-filtering branch March 20, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incident manager filtering

4 participants