Repository navigation
Fixes #35293: Glossary CSV docs, approval by non-reviewers, and expected failures logged as errors [2.0] - #35302
Conversation
… engine [2.0] Backport of #35039 and #35040. A negative from or size on the search endpoints is rejected with a 400 that names the parameter instead of failing in the search engine as a 500, and the UI no longer sends a negative offset. SearchResourceIT conflicted: 2.0 has neither the httpGetSearch helper nor the 400 mapping the old negative-offset test expected, so the new tests and helpers were added by hand. (cherry picked from commit 893cd1b) (cherry picked from commit e3914c5)
…rt [2.0]
The bulk import page asks /v1/csv/documentation/{entityType} for the type it
imports into. For a glossary term that is glossaryTerm, which has no
documentation file, so every request returned a 500 and was logged twice at
ERROR. Glossary-term import already goes through GlossaryCsv, so glossaryTerm
now gets the glossary's documentation. A type with no documentation returns a
404, and the FATAL log before the rethrow is gone.
Anyone the task policy lets resolve an approval task, such as an admin or an owner, could approve a glossary term without being one of its reviewers. The workflow then set the status as that user, the reviewer check rejected it, and the failure was only logged: the task closed as Approved while the term stayed In Review. As on main since #34541, a status change the governance workflow makes, as or impersonating governance-bot, skips the reviewer check: the approval task already decided who may approve. Direct edits are still checked. SetGlossaryTermStatusImpl now writes impersonating governance-bot like the other workflow nodes, so its changes are recognised too.
An alert can name a user or team that is deleted later. Every event for that alert logged the lookup failure at ERROR with a stack trace, although there is simply no one left to notify. A missing recipient is now skipped at DEBUG, as main does since #33967; any other lookup failure is still logged as an error.
| .fn() | ||
| .mockResolvedValue({ data: mockTableSearchResponse }); | ||
|
|
||
| jest.doMock('./axiosClient', () => ({ get: mockGet })); |
There was a problem hiding this comment.
./axiosClient only exists on main. On 2.0, searchAPI.ts still imports its client from ./index, so this mock can't resolve and all 12 new pagination cases fail with Cannot find module './axiosClient'. The one ui-coverage-tests run on this PR failed with that error (job log), and I get the same locally (12 failed, 4 passed). The skip-pr-checks label skipped that job on the rerun, so the PR looks green but would land red on 2.0.
Mocking ./index, like the other tests in this file do, makes all 16 pass locally:
| jest.doMock('./axiosClient', () => ({ get: mockGet })); | |
| jest.doMock('./index', () => ({ get: mockGet })); |
There was a problem hiding this comment.
Good catch, thanks. ./axiosClient only exists on main, and on 2.0 searchAPI.ts imports the client from ./index. I applied your suggestion in be659a7, and searchAPI.test.ts now passes on 2.0 locally (16 of 16).
The green status came from the runs GitHub starts when a label is added. They skip the test jobs unless the label is safe to test (the job condition in yarn-coverage.yml and openmetadata-service-unit-tests.yml), and their skipped result replaced the failed one on the PR. be659a7 is a normal push, so the unit and UI tests run on it.
The pagination tests from #35040 mock ./axiosClient, which only exists on main. On 2.0 searchAPI imports its client from ./index, so the mock could not resolve and all 12 new cases failed. Mock ./index like the rest of the file.
#35239 brought this test to 2.0 while this branch made SetGlossaryTermStatusImpl patch impersonating governance-bot, so the test still expected the plain four-argument patch. It now checks the same call main's copy of the test does.
Code Review ✅ Approved🔴 High risk · Exempting governance-bot workflow status changes from reviewer checks could allow glossary terms to be approved without reviewer authorization if attribution is misapplied. Backports four 2.0 fixes: negative search pagination is rejected with a 400, glossary-term CSV documentation is served, workflow approvals by non-reviewers are applied, and deleted alert recipients are skipped without error logs. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledOptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|



Describe your changes:
Fixes #35293
The 2.0 side of #35293: two real bugs, and two expected conditions that were logged as errors. One commit per fix:
fromorsizeis rejected with a 400 before it reaches the search engine, and the UI no longer sends a negative offset.SearchResourceITconflicted: 2.0 has neither thehttpGetSearchhelper nor the 400 mapping the old negative-offset test expected, so the new tests and helpers were added by hand.glossaryTermgets the glossary documentation instead of a 500, a type without documentation returns a 404, and the failure is logged once.governance-bot, skips the reviewer check, and direct edits are still checked.SetGlossaryTermStatusImplnow writes impersonatinggovernance-botlike the other workflow nodes, so its changes are recognised too.Type of change:
High-level design:
No new design: each commit brings 2.0 in line with main.
EntityStatusWorkflows.isWorkflowChange) without the rest of that feature. On 2.0 the check is a private helper inEntityUpdater.Lookup, where a missing entity means there is no one to notify, without the alert pipeline redesign.Tests:
Use cases covered
fromorsizeon/v1/search/query,/nlq/query,/fieldQueryand/previewreturns a 400.Unit tests
SearchResourceTest(new on 2.0, from Fixes #35037: Reject negative search pagination before it reaches the search engine #35039): 3 tests, 0 failures.EntityCsvTest: 66 tests, 0 failures, including the new glossary-term test.RecipientResolutionTest: 11 tests, 0 failures. The 5 new ones check that a deleted user or team is skipped without an ERROR log, both when the alert names it and when it is an owner, and that any other lookup failure still logs one.searchAPI.test.ts(Jest, from Fixes 35037: Prevent negative offsets from UI pagination #35040): not run locally. The change is identical to main's.EntityCsv,UserRecipientResolverandTeamRecipientResolverare fully covered.SearchResourceline 550 runs, but it always throws in the tests, and jacoco counts a line that throws as missed. The other 6 lines are the approval change inEntityRepositoryandSetGlossaryTermStatusImpl. Only the workflow reaches them, so the ITs below cover them, and ITs are not instrumented.Backend integration tests
openmetadata-integration-tests/for new/changed API endpoints.SearchResourceIT: the negative pagination tests from Fixes #35037: Reject negative search pagination before it reaches the search engine #35039.CsvDocumentationResourceIT(new):glossaryTermreturns the glossary documentation, and an unknown type returns 404.GlossaryTermInheritedReviewerApprovalIT: newtest_nonReviewerApprovingTheTask_movesTermToApprovedandtest_nonReviewerApprovingByDirectEdit_isRejected.Ingestion integration tests
Playwright (UI) tests
openmetadata-ui/.../ui/playwright/for UI changes.QueryEntity.spec.ts: the page-zero case from Fixes 35037: Prevent negative offsets from UI pagination #35040. Not run locally.Manual testing performed
None beyond the tests above.
UI screen recording / screenshots:
Not applicable — the only UI change is #35040's clamp on the page offset sent to the search API, which changes nothing visible.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code