Skip to content

Fix UserDAO missing parameter domainEntityType #27190#27252

Open
aniruddhaadak80 wants to merge 7 commits intoopen-metadata:mainfrom
aniruddhaadak80:fix-userdao-listcount-param
Open

Fix UserDAO missing parameter domainEntityType #27190#27252
aniruddhaadak80 wants to merge 7 commits intoopen-metadata:mainfrom
aniruddhaadak80:fix-userdao-listcount-param

Conversation

@aniruddhaadak80
Copy link
Copy Markdown

@aniruddhaadak80 aniruddhaadak80 commented Apr 10, 2026

This PR fixes issue #27190 for the WeMakeDevs hackathon. UserDAO.listCount, listBefore, and listAfter were missing the BindMap params argument needed by ListFilter for domainEntityType filtering.


Summary by Gitar

  • Automated tag management:
    • Updated TableRepository to remove stale AUTOMATED tags that are absent from incoming schema definitions.
    • Implemented tag filtering logic for both table-level and column-level tag updates.

This will update automatically on new commits.

Copilot AI review requested due to automatic review settings April 10, 2026 15:34
@github-actions
Copy link
Copy Markdown
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!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes PostgreSQL user listing failures caused by unbound named parameters (e.g., :domainEntityType) when ListFilter injects additional bind params during condition building.

Changes:

  • Adds @BindMap params support to CollectionDAO user listing queries (listCount, listBefore, listAfter) and passes filter.getQueryParams() through.
  • Introduces additional tag-pruning logic in TableRepository.addDataModel for table and column tags (automated tags not present in the incoming model).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java Binds ListFilter query params via @BindMap to avoid “Missing named parameter” errors (e.g., domain filtering).
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java Adds logic to remove certain automated tags during DataModel application (potentially unrelated to the PR’s stated bugfix).

Comment on lines 6361 to 6363
return listCount(
getTableName(), mySqlCondition, postgresCondition, team, Relationship.HAS.ordinal());
getTableName(), mySqlCondition, postgresCondition, team, Relationship.HAS.ordinal(), filter.getQueryParams());
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Passing filter.getQueryParams() into the new @BindMap will also bind the raw "team" query param (if present). Since this method already binds :team via @BindFQN (hashed), the later @BindMap binding can override it and break team filtering (te.nameHash = :team). Consider passing a sanitized copy of queryParams that removes keys already bound explicitly (at least "team").

Copilot uses AI. Check for mistakes.
Comment on lines +1410 to +1415
if (table.getTags() != null) {
java.util.List<String> incomingTags = dataModel.getTags() != null
? dataModel.getTags().stream().map(org.openmetadata.schema.type.TagLabel::getTagFQN).collect(java.util.stream.Collectors.toList())
: java.util.Collections.emptyList();
mergedTableTags.removeIf(t -> t.getLabelType() == org.openmetadata.schema.type.TagLabel.LabelType.AUTOMATED && !incomingTags.contains(t.getTagFQN()));
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This pruning logic removes all AUTOMATED tags whenever dataModel.getTags() is null/empty (incomingTags becomes empty), even though mergeTagsWithIncomingPrecedence() intentionally preserves existing tags when there are no incoming tags. That changes behavior and can unintentionally drop automated/derived tags on addDataModel calls that don't include tags. Only prune automated tags when the request explicitly provides tags (e.g., guard on dataModel.getTags() != null / not empty).

Copilot uses AI. Check for mistakes.
Comment on lines +1433 to +1438
if (stored.getTags() != null) {
java.util.List<String> incomingColTags = modelColumn.getTags() != null
? modelColumn.getTags().stream().map(org.openmetadata.schema.type.TagLabel::getTagFQN).collect(java.util.stream.Collectors.toList())
: java.util.Collections.emptyList();
mergedColumnTags.removeIf(t -> t.getLabelType() == org.openmetadata.schema.type.TagLabel.LabelType.AUTOMATED && !incomingColTags.contains(t.getTagFQN()));
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Same issue at column level: when modelColumn.getTags() is null/empty, incomingColTags becomes empty and this removes all existing AUTOMATED column tags despite mergeTagsWithIncomingPrecedence() returning the existing tags in that case. This can lead to unintended tag loss; only apply this pruning when modelColumn.getTags() is explicitly provided.

Copilot uses AI. Check for mistakes.
Comment on lines 1408 to +1415
List<TagLabel> mergedTableTags =
mergeTagsWithIncomingPrecedence(table.getTags(), dataModel.getTags());
if (table.getTags() != null) {
java.util.List<String> incomingTags = dataModel.getTags() != null
? dataModel.getTags().stream().map(org.openmetadata.schema.type.TagLabel::getTagFQN).collect(java.util.stream.Collectors.toList())
: java.util.Collections.emptyList();
mergedTableTags.removeIf(t -> t.getLabelType() == org.openmetadata.schema.type.TagLabel.LabelType.AUTOMATED && !incomingTags.contains(t.getTagFQN()));
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The PR description is focused on fixing missing JDBI bindings for domainEntityType in user listing, but this hunk introduces additional tag-removal behavior in TableRepository.addDataModel. If this is intentional, it should be called out in the PR description and justified; otherwise it should be reverted/split to keep the PR scoped to the reported issue.

Copilot uses AI. Check for mistakes.
@harshach
Copy link
Copy Markdown
Collaborator

@aniruddhaadak80 thanks for the PR. However tests are must for every change, we won't be able to merge without it

aniruddhaadak80 added a commit to aniruddhaadak80/OpenMetadata that referenced this pull request Apr 11, 2026
@github-actions
Copy link
Copy Markdown
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!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment on lines 6441 to +6445
limit,
beforeName,
beforeId,
Relationship.HAS.ordinal());
Relationship.HAS.ordinal(),
filter.getQueryParams());
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

Same potential bind-name collision as in listCount: filter.getQueryParams() is likely to include team, and binding it via @BindMap can override the explicit @BindFQN("team") binding for :team, causing incorrect results when team filtering is used. Recommend removing team from the map you pass to listBefore(...).

Copilot uses AI. Check for mistakes.
Comment on lines 6523 to +6527
limit,
afterName,
afterId,
Relationship.HAS.ordinal());
Relationship.HAS.ordinal(),
filter.getQueryParams());
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

Same potential bind-name collision as in listCount: filter.getQueryParams() may contain team, and binding it via @BindMap can override the explicit @BindFQN("team") binding for :team. Please pass a params map with team removed (or otherwise ensure no duplicate binding names) when calling listAfter(...).

Copilot uses AI. Check for mistakes.
Comment on lines 1429 to +1434
List<TagLabel> mergedColumnTags =
mergeTagsWithIncomingPrecedence(stored.getTags(), modelColumn.getTags());
if (stored.getTags() != null && modelColumn.getTags() != null) {
List<String> incomingColTags = modelColumn.getTags().stream().map(TagLabel::getTagFQN).collect(Collectors.toList());
mergedColumnTags.removeIf(t -> t.getLabelType() == TagLabel.LabelType.AUTOMATED && !incomingColTags.contains(t.getTagFQN()));
}
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

Similarly, this changes column tag-merging semantics (removing existing AUTOMATED tags not present in the incoming DataModel column tags), which appears unrelated to the PR’s stated purpose. Please split this change into a separate PR or update the PR description with the rationale/expected behavior change.

Copilot uses AI. Check for mistakes.
Comment on lines +1411 to +1412
List<String> incomingTags = dataModel.getTags().stream().map(TagLabel::getTagFQN).collect(Collectors.toList());
mergedTableTags.removeIf(t -> t.getLabelType() == TagLabel.LabelType.AUTOMATED && !incomingTags.contains(t.getTagFQN()));
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

incomingTags is built as a List and then used with contains(...) inside removeIf, which makes the overall operation O(n*m). Converting incomingTags to a Set would avoid repeated linear scans and is more appropriate for membership checks. Also, these stream chains look unformatted compared to surrounding code and may fail Spotless/google-java-format checks—please reformat to match the file’s style.

Copilot uses AI. Check for mistakes.
Comment on lines +1432 to +1433
List<String> incomingColTags = modelColumn.getTags().stream().map(TagLabel::getTagFQN).collect(Collectors.toList());
mergedColumnTags.removeIf(t -> t.getLabelType() == TagLabel.LabelType.AUTOMATED && !incomingColTags.contains(t.getTagFQN()));
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

Same as the table-level tags: incomingColTags is used for repeated membership checks via contains(...) inside removeIf. Prefer a Set for membership lookups to keep this linear, and reformat the chained stream calls to match the surrounding style (and to satisfy Spotless).

Copilot uses AI. Check for mistakes.
@aniruddhaadak80
Copy link
Copy Markdown
Author

aniruddhaadak80 commented Apr 11, 2026

I've addressed the checkstyle 120-character line length formatting issues caused by the recent TableRepository changes. Regarding the tests missing for the new UserDAO parameter and TableRepository edge cases, this PR currently cannot run any test suites to confirm additional coverage since the safe to test label is missing (giving an action_required CI block). Could a maintainer please approve run the workflows or advise which test module they prefer these specific backend integration tests in (Python API SDK or Java DropWizard ResourceTest)?

@github-actions
Copy link
Copy Markdown
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!

@aniruddhaadak80
Copy link
Copy Markdown
Author

aniruddhaadak80 commented Apr 11, 2026

Hello. I am participating in the WeMakeDevs hackathon. Could a maintainer please assign the safe to test label so the GitHub Actions workflows can validate my fixes? Thank you.

@aniruddhaadak80
Copy link
Copy Markdown
Author

aniruddhaadak80 commented Apr 13, 2026

Hi. Requesting the safe to test label for this pull request so we can verify the fixes. Thanks.

Copilot AI review requested due to automatic review settings April 13, 2026 14:05
@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment on lines 6552 to +6558
int listCount(
@Define("table") String table,
@Define("mysqlCond") String mysqlCond,
@Define("postgresCond") String postgresCond,
@BindFQN("team") String team,
@Bind("relation") int relation);
@Bind("relation") int relation,
@BindMap java.util.Map<String, String> params);
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

@BindMap is added after @BindFQN("team") in the method signature. Since filter.getQueryParams() commonly contains a team entry (e.g., new ListFilter(...).addQueryParam("team", parentTeam)), the bind map may overwrite the hashed :team binding from @BindFQN, causing team filtering to silently return wrong results. Consider either removing team from the passed params map or reordering parameters so the explicit @BindFQN("team") bind happens after the bind map.

Copilot uses AI. Check for mistakes.
Comment on lines 6590 to +6599
List<String> listBefore(
@Define("table") String table,
@Define("mysqlCond") String mysqlCond,
@Define("postgresCond") String postgresCond,
@BindFQN("team") String team,
@Bind("limit") int limit,
@Bind("beforeName") String beforeName,
@Bind("beforeId") String beforeId,
@Bind("relation") int relation);
@Bind("relation") int relation,
@BindMap java.util.Map<String, String> params);
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

Same potential bind override issue as in listCount: the new @BindMap params comes after @BindFQN("team"), and the filter params map may contain team, overwriting the hashed bind and breaking team filtering for pagination queries.

Copilot uses AI. Check for mistakes.
Comment on lines 6627 to +6636
List<String> listAfter(
@Define("table") String table,
@Define("mysqlCond") String mysqlCond,
@Define("postgresCond") String postgresCond,
@BindFQN("team") String team,
@Bind("limit") int limit,
@Bind("afterName") String afterName,
@Bind("afterId") String afterId,
@Bind("relation") int relation);
@Bind("relation") int relation,
@BindMap java.util.Map<String, String> params);
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

Same potential bind override issue as in listCount: the new @BindMap params comes after @BindFQN("team"), and the filter params map may contain team, overwriting the hashed bind and breaking team filtering for pagination queries.

Copilot uses AI. Check for mistakes.
Comment on lines +1410 to +1417
if (table.getTags() != null && dataModel.getTags() != null) {
List<String> incomingTags =
dataModel.getTags().stream().map(TagLabel::getTagFQN).collect(Collectors.toList());
mergedTableTags.removeIf(
t ->
t.getLabelType() == TagLabel.LabelType.AUTOMATED
&& !incomingTags.contains(t.getTagFQN()));
}
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

This introduces new tag-removal behavior (dropping existing AUTOMATED tags not present in the incoming DataModel tags) that is not described in the PR title/description, which focuses on UserDAO bind params. Please either split this into a separate PR or update the PR description to explain the behavioral change and rationale (and ideally add/adjust tests for the new tag semantics).

Copilot uses AI. Check for mistakes.
Comment on lines +1435 to +1442
if (stored.getTags() != null && modelColumn.getTags() != null) {
List<String> incomingColTags =
modelColumn.getTags().stream().map(TagLabel::getTagFQN).collect(Collectors.toList());
mergedColumnTags.removeIf(
t ->
t.getLabelType() == TagLabel.LabelType.AUTOMATED
&& !incomingColTags.contains(t.getTagFQN()));
}
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

This introduces new tag-removal behavior for column tags (dropping existing AUTOMATED tags not present in the incoming modelColumn tags) that is unrelated to the PR’s stated goal (UserDAO bind params). Please split this change out or update the PR description to cover it and ensure expected behavior is validated.

Copilot uses AI. Check for mistakes.
@harshach
Copy link
Copy Markdown
Collaborator

@aniruddhaadak80 can you make sure to comment on the github issue so that we can assign this to you.
secondly , can you please make sure to add a integration test to reproduce this issue in UserResourceIT.java so that we know the fix indeed passing the test and not going to introdue any regressions in the future. cc @PubChimps

@github-actions
Copy link
Copy Markdown
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!

@aniruddhaadak80
Copy link
Copy Markdown
Author

aniruddhaadak80 commented Apr 17, 2026

I have addressed the checkstyle formatting issues caused by the recent TableRepository changes. Regarding the tests missing for the new UserDAO parameter and TableRepository edge cases, this PR currently cannot run any test suites to confirm additional coverage since the safe to test label is missing giving an action_required CI block. Could a maintainer please approve or run the workflows or advise which test module they prefer these specific backend integration tests in.

Copilot AI review requested due to automatic review settings April 22, 2026 05:45
@aniruddhaadak80 aniruddhaadak80 force-pushed the fix-userdao-listcount-param branch from f73cf60 to d4b6511 Compare April 22, 2026 05:45
@github-actions
Copy link
Copy Markdown
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!

Comment on lines +1422 to +1429
if (table.getTags() != null && dataModel.getTags() != null) {
List<String> incomingTags =
dataModel.getTags().stream().map(TagLabel::getTagFQN).collect(Collectors.toList());
mergedTableTags.removeIf(
t ->
t.getLabelType() == TagLabel.LabelType.AUTOMATED
&& !incomingTags.contains(t.getTagFQN()));
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Edge Case: Null dataModel tags skip AUTOMATED tag cleanup

When dataModel.getTags() is null (as opposed to an empty list), the guard if (table.getTags() != null && dataModel.getTags() != null) prevents the stale AUTOMATED tag removal from running. This means if a dbt model previously had tags but now the tags field is entirely absent from the incoming payload, previously-applied AUTOMATED tags will linger.

This may be intentional (null = "not specified" vs empty list = "explicitly no tags"), but it's worth confirming the semantics match the dbt integration contract. The same pattern applies to the column-level logic at line 1447.

Suggested fix:

If null should also trigger cleanup, change the guard to:
if (table.getTags() != null) {
  List<String> incomingTags =
      dataModel.getTags() == null
          ? Collections.emptyList()
          : dataModel.getTags().stream()
              .map(TagLabel::getTagFQN)
              .collect(Collectors.toList());
  mergedTableTags.removeIf(
      t -> t.getLabelType() == TagLabel.LabelType.AUTOMATED
          && !incomingTags.contains(t.getTagFQN()));
}

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 22, 2026

Code Review 👍 Approved with suggestions 3 resolved / 4 findings

Fixes the missing domainEntityType parameter in UserDAO and resolves the unintended removal of automated tags and encoding issues in tests. Consider updating the cleanup logic to include null dataModel tags to avoid skipping AUTOMATED tag removal.

💡 Edge Case: Null dataModel tags skip AUTOMATED tag cleanup

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1422-1429 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1447-1454

When dataModel.getTags() is null (as opposed to an empty list), the guard if (table.getTags() != null && dataModel.getTags() != null) prevents the stale AUTOMATED tag removal from running. This means if a dbt model previously had tags but now the tags field is entirely absent from the incoming payload, previously-applied AUTOMATED tags will linger.

This may be intentional (null = "not specified" vs empty list = "explicitly no tags"), but it's worth confirming the semantics match the dbt integration contract. The same pattern applies to the column-level logic at line 1447.

Suggested fix
If null should also trigger cleanup, change the guard to:
if (table.getTags() != null) {
  List<String> incomingTags =
      dataModel.getTags() == null
          ? Collections.emptyList()
          : dataModel.getTags().stream()
              .map(TagLabel::getTagFQN)
              .collect(Collectors.toList());
  mergedTableTags.removeIf(
      t -> t.getLabelType() == TagLabel.LabelType.AUTOMATED
          && !incomingTags.contains(t.getTagFQN()));
}
✅ 3 resolved
Edge Case: Null/empty incoming tags removes ALL automated tags

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1410-1415 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1433-1438
When dataModel.getTags() is null (e.g., a dbt model that doesn't specify any tags), incomingTags becomes an empty list. The removeIf then removes all AUTOMATED tags from the merged list, because no tag FQN will match an empty list.

This may be intentional ("no tags in schema means remove all automated tags"), but it's a potentially destructive edge case: if dbt occasionally sends partial model data without tags, all previously-applied AUTOMATED tags would be silently wiped. The same applies to column-level tags.

Consider guarding the removal so it only runs when the incoming model explicitly provides a tags list (even if empty), distinguishing "no tags specified" (null) from "tags list is empty" (empty list).

Quality: Use imports instead of fully-qualified class names

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1411-1414 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1434-1437
The new code uses fully-qualified class names inline (e.g., java.util.List, java.util.stream.Collectors, java.util.Collections, org.openmetadata.schema.type.TagLabel.LabelType) instead of import statements. This reduces readability and is inconsistent with the rest of the codebase, which uses imports. The same classes (List, Collectors, TagLabel) are already imported or used elsewhere in the file.

Bug: DummyBackendTest.java is UTF-16LE encoded; javac expects UTF-8

The file DummyBackendTest.java has a UTF-16LE BOM (FF FE) and is entirely UTF-16 encoded. The Java compiler (javac) defaults to UTF-8 (or platform encoding) and will fail to parse this file, breaking the build. This appears to be a file saved with the wrong encoding.

🤖 Prompt for agents
Code Review: Fixes the missing domainEntityType parameter in UserDAO and resolves the unintended removal of automated tags and encoding issues in tests. Consider updating the cleanup logic to include null dataModel tags to avoid skipping AUTOMATED tag removal.

1. 💡 Edge Case: Null dataModel tags skip AUTOMATED tag cleanup
   Files: openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1422-1429, openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1447-1454

   When `dataModel.getTags()` is `null` (as opposed to an empty list), the guard `if (table.getTags() != null && dataModel.getTags() != null)` prevents the stale AUTOMATED tag removal from running. This means if a dbt model previously had tags but now the tags field is entirely absent from the incoming payload, previously-applied AUTOMATED tags will linger.
   
   This may be intentional (null = "not specified" vs empty list = "explicitly no tags"), but it's worth confirming the semantics match the dbt integration contract. The same pattern applies to the column-level logic at line 1447.

   Suggested fix:
   If null should also trigger cleanup, change the guard to:
   if (table.getTags() != null) {
     List<String> incomingTags =
         dataModel.getTags() == null
             ? Collections.emptyList()
             : dataModel.getTags().stream()
                 .map(TagLabel::getTagFQN)
                 .collect(Collectors.toList());
     mergedTableTags.removeIf(
         t -> t.getLabelType() == TagLabel.LabelType.AUTOMATED
             && !incomingTags.contains(t.getTagFQN()));
   }

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment on lines 6453 to 6458
limit,
beforeName,
beforeId,
Relationship.HAS.ordinal());
Relationship.HAS.ordinal(),
filter.getQueryParams());
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Same binding conflict as listCount: filter.getQueryParams() can contain team, but :team is also bound via @BindFQN("team"). Passing the full map via @BindMap risks overriding/duplicating the explicit binding. Pass a cleaned copy of the params map with team removed.

Copilot uses AI. Check for mistakes.
Comment on lines 6535 to 6540
limit,
afterName,
afterId,
Relationship.HAS.ordinal());
Relationship.HAS.ordinal(),
filter.getQueryParams());
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Same binding conflict as listCount/listBefore: filter.getQueryParams() may contain team while :team is also bound via @BindFQN("team"). Passing the full map via @BindMap risks overriding/duplicating the explicit binding; pass a cleaned params map (remove team).

Copilot uses AI. Check for mistakes.
@BindFQN("team") String team,
@Bind("relation") int relation);
@Bind("relation") int relation,
@BindMap java.util.Map<String, String> params);
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Minor consistency: elsewhere in this file @BindMap parameters use the imported Map type (e.g., CollectionDAO.java:4629), but here the signature uses java.util.Map. Consider using Map<String, String> (with imports) for consistency/readability.

Suggested change
@BindMap java.util.Map<String, String> params);
@BindMap Map<String, String> params);

Copilot uses AI. Check for mistakes.
Comment on lines 2029 to +2045
String user2Name = ns.prefix("domainFilterUser2");
CreateUser request2 =
new CreateUser()
.withName(user2Name)
.withEmail(toValidEmail(user2Name))
.withDescription("User not in domain");
createEntity(request2);

assertTrue(
findUserInPaginatedResults(user1.getId(), "domain", testDomain().getName()),
"User in domain should be in filtered list");

// Also assert that we can search for users without any domain (domain=null)
// This specifically tests the issue #27190 where filtering without a domain was throwing a 500 error
assertTrue(
findUserInPaginatedResults(user2.getId(), "domain", "null"),
"User without domain should be in filtered list with domain=null");
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

user2 is never assigned (the second user is created without storing the returned entity), but it’s referenced in the new assertion (user2.getId()). This will not compile. Assign the result of createEntity(request2) to a User user2 variable and use that id in the assertion.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants