Skip to content

fix(insights): attribute AI-bot-applied tags and tier as Generated - #30595

Queued
Shreyansh100704 wants to merge 3 commits into
mainfrom
fix/ai-generated-tag-tier-attribution
Queued

fix(insights): attribute AI-bot-applied tags and tier as Generated#30595
Shreyansh100704 wants to merge 3 commits into
mainfrom
fix/ai-generated-tag-tier-attribution

Conversation

@Shreyansh100704

@Shreyansh100704 Shreyansh100704 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/ai-platform#935

I made tags and tier applied by AI bots (automations, ask-collate) count toward the Generated with Collate AI data-insight, because they were being mis-attributed as manual work. The insight buckets tier/tag by TagLabel.labelType, which is Manual for agent-applied tags, so AI-applied tiers/tags never appeared. This is a different mechanism from description attribution, which already keys on applier identity (AI_BOTS) — so the earlier AI_BOTS fix helped descriptions but not tier/tag. I brought tier/tag attribution up to parity: in SearchIndexUtils.processTagAndTierSources, attribute by identity (TagLabel.appliedBy ∈ AI_BOTS → Generated) instead of labelType. appliedBy is already stamped server-side per tag, so no agent or schema changes are needed.

Type of change:

  • Bug fix

High-level design:

N/A — small change (2 files: one helper method + its unit test).

Tests:

Use cases covered

  • Tier/tag applied by an AI bot (collateaiapplicationbot, aiautomationapplicationbot, collateaiqualityagentapplicationbot) is counted under Generated in the insight, even though the tag's labelType is Manual.
  • Tag applied by a human (UI/REST) stays under Manual.
  • Tag with no appliedBy (historical rows) falls back to its labelType.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated: openmetadata-service/src/test/java/org/openmetadata/service/search/SearchIndexUtilsTest.java — new testAiBotAppliedTagsCountAsGenerated (bot tag + tier →Generated buckets, human tag stays Manual; fails without the fix). Existing testDescriptionAndTagSourceProcessing covers the null-appliedBy fallback.

Backend integration tests

  • Not applicable (no API changes — indexing-layer bucketing only).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes [open-metadata/ai-platform#935](https://github.com/open-metadata/ai-platform/issues/935): Classify AI Generated tags/tiers correctly
  • My PR is linked to a GitHub issue via Fixes [open-metadata/ai-platform#935](https://github.com/open-metadata/ai-platform/issues/935) above.
  • 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. — N/A, no schema change (appliedBy already exists and is populated).
  • For UI changes: I attached a screen recording and/or screenshots above. — N/A, no UI change.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Greptile Summary

This PR updates search insight attribution for tags and tiers applied by recognized AI bots.

  • Adds identity-based attribution that classifies AI-bot-applied tags and tiers as Generated while preserving the existing label-type fallback.
  • Adds unit coverage for AI bot, human, tag, and tier attribution.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/search/SearchIndexUtils.java Adds an appliedBy-based override for recognized AI bots while retaining labelType attribution for other and historical records.
openmetadata-service/src/test/java/org/openmetadata/service/search/SearchIndexUtilsTest.java Verifies Generated attribution for AI-applied tags and tiers and Manual attribution for a human-applied tag.

Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/ai-generate..." | Re-trigger Greptile

@Shreyansh100704
Shreyansh100704 requested a review from a team as a code owner July 28, 2026 14:52
Copilot AI review requested due to automatic review settings July 28, 2026 14:52

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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.

@Shreyansh100704 Shreyansh100704 added the To release Will cherry-pick this PR into the release branch label Jul 28, 2026
@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Jul 28, 2026
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit eadf24eb23afddcba7f28d5ecfffc9c044a7e054 in Playwright run 30441936762, attempt 1.

✅ 1012 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 5 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 59m 38s

⏱️ Max setup 3m 0s · max shard execution 16m 10s · max shard-job elapsed before upload 29m 41s · reporting 6s

🌐 189.31 requests/attempt · 2.22 app boots/UI scenario · 18.40% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 18.4% (convergence target: at most 15%).
  • Application boot ratio was 2.22 per UI scenario (2290 boots / 1030 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 133 0 0 3 0 0
✅ Shard chromium-02 149 0 0 0 0 0
🟡 Shard chromium-03 132 0 1 0 0 0
✅ Shard chromium-04 137 0 0 0 0 0
✅ Shard chromium-05 152 0 0 0 0 0
✅ Shard chromium-06 143 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 23 0 0 0 0 0
✅ Shard ingestion-01 2 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 27 0 0 2 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.tsDomain Propagation (shard chromium-03, 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

@Shreyansh100704
Shreyansh100704 added this pull request to the merge queue Jul 28, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 28, 2026
@Shreyansh100704
Shreyansh100704 added this pull request to the merge queue Jul 28, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 28, 2026
Copilot AI review requested due to automatic review settings July 29, 2026 10:00

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Attributes AI-bot-applied tags and tiers as Generated in data insights by checking appliedBy identity instead of labelType. No issues found.

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants