Skip to content

Fixes 36413: Return 400 for malformed entity names (backport 2.1 #36414) - #36415

Merged
manerow merged 2 commits into
2.1from
fix/invalid-fqn-returns-400-2.1
Oct 29, 2026
Merged

manerow merged 2 commits into
2.1from
fix/invalid-fqn-returns-400-2.1

Conversation

@manerow

@manerow manerow commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Cherry-pick of PR #36414 (Fixes #36413)

What it does

A malformed entity name in a request, for example GET /api/v1/tables/name/", made the API return HTTP 500 with no message. The name parser's error was never translated, so the server reported it as an unhandled exception.

The parser now reports a malformed name as IllegalArgumentException("Invalid fully qualified name <input>"). The server already maps that exception to 400, so every endpoint that takes a name now answers 400 with a clear message. Valid names behave as before. The full explanation is in the main PR.

How it was tested on 2.1

  • The cherry-pick applies cleanly; its patch is identical to the main PR (git patch-id --stable).
  • All 827 unit tests in the util package pass, including the updated FullyQualifiedNameTest.
  • The new BaseEntityIT.get_entityByMalformedName_400 passed for all 63 entity types on MySQL + Elasticsearch.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with one non-blocking test gap from the previous review.

Findings

  1. P2 Error message remains untested ▶

Summary

The PR turns malformed entity names into HTTP 400 errors with a clear message.

  • Malformed entity names now return a clear client error.

Reviews (2) · Last reviewed commit: "Mark new FQN parse locals final" · Reviewed by Greptile

@manerow manerow self-assigned this Oct 28, 2026
@manerow
manerow requested a review from a team as a code owner October 28, 2026 08:26
@manerow
manerow requested review from mohityadav766 and removed request for a team October 28, 2026 08:26
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@manerow manerow added the skip-pr-checks Bypass PR metadata validation check label Oct 28, 2026
@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Oct 28, 2026
Comment on lines +535 to +537
ApiAssertions.assertBadRequest(
() -> getEntityByName("\""),
"Getting " + getEntityType() + " by a malformed name should be a bad request");

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.

P2 Error message remains untested

The new API test checks only HTTP 400. The second argument to assertBadRequest is an assertion label, not the expected response message. Capture the returned exception and check that the response includes Invalid fully qualified name and the malformed input. Otherwise, the test still passes if the API returns an empty or generic message, leaving the clear-message part of this fix untested.

@gitar-bot

gitar-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Mapping malformed FQN parse failures to HTTP 400 across name-based endpoints could disrupt clients that expect the former server-error response.

Backport of the malformed entity name fix: the FQN parser now throws IllegalArgumentException for invalid names, so endpoints that take a name return HTTP 400 with a clear message instead of a 500. Valid names are unchanged. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow
manerow merged commit 0c0d220 into 2.1 Oct 29, 2026
72 checks passed
@manerow
manerow deleted the fix/invalid-fqn-returns-400-2.1 branch October 29, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants