Skip to content

feat(): Adding views for service accounts, ensuring user default view honored #17187

Merged
jjoyce0510 merged 6 commits intomasterfrom
jj--add-service-account-views-oss
Apr 27, 2026
Merged

feat(): Adding views for service accounts, ensuring user default view honored #17187
jjoyce0510 merged 6 commits intomasterfrom
jj--add-service-account-views-oss

Conversation

@jjoyce0510
Copy link
Copy Markdown
Collaborator

@jjoyce0510 jjoyce0510 commented Apr 24, 2026

Summary

In this PR, we add support for defining default views for Service Accounts. In addition, we align agent context kit with DataHub Cloud with respect to handling default view injection. Now we inject the user's PERSONAL default view first if one exists, otherwise fall back to the global org default (if the view resolution env variable is true)

Screenshot 2026-04-24 at 11 31 46 AM

Status

Ready for review.

@github-actions github-actions Bot added product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests labels Apr 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Linear: CAT-1870

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 69.62025% with 24 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../auth/UpdateServiceAccountDefaultViewResolver.java 77.35% 12 Missing ⚠️
...com/linkedin/datahub/graphql/GmsGraphQLEngine.java 0.00% 8 Missing ⚠️
...ub/graphql/resolvers/auth/ServiceAccountUtils.java 76.47% 3 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (69.62%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

📢 Thoughts on this report? Let us know!

John Joyce added 2 commits April 24, 2026 12:29
@alwaysmeticulous
Copy link
Copy Markdown

alwaysmeticulous Bot commented Apr 24, 2026

🔴 Meticulous spotted visual differences in 10 of 1443 screens tested: view and approve differences detected.

Meticulous evaluated ~10 hours of user flows against your PR.

Last updated for commit 632bbbb Merge remote-tracking branch 'cloud/jj--add-service-account-views-oss' i.... This comment will update as new commits are pushed.

@maggiehays maggiehays added the needs-review Label for PRs that need review from a maintainer. label Apr 24, 2026
@otto-the-otter-bot
Copy link
Copy Markdown
Contributor

Review: Smoke Test Analysis (smoke-test/tests/service_accounts/test_service_accounts.py)

✅ What's done well:

  • try/finally cleanup pattern is solid — resources always get cleaned up
  • Tests both set and clear of the default view, not just happy path
  • Uses independent list queries to verify state rather than trusting mutation responses
  • Replacing print() with logger.info() is a nice observability cleanup

⚠️ Concerns:

  1. Missing retry logic on verification steps — After calling updateServiceAccountDefaultView, the test immediately queries listServiceAccounts once to verify. Given DataHub's eventual consistency model (writes go through Kafka → index), this can cause flaky CI failures. Other tests in this same file already use tenacity for retries — recommend wrapping the verification assertions in a @retry decorator similarly.

  2. Pagination assumptionlist_service_accounts_with_default_view fetches only the first 20 accounts (start=0, count=20). If the test environment has >20 service accounts at runtime, the newly created SA may not appear in results and the test will fail silently or with a confusing error.

  3. Hardcoded urn:li:tag:test in view filter — Low risk since the test only validates defaultView linkage, not the view's filter behavior, but worth a note.

Verdict: The test coverage logic is good — the set/clear lifecycle is well thought out. The retry gap is the most actionable fix before merge to avoid flakiness in CI.

Copy link
Copy Markdown
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

Test improvement comments from Otto seem relevant. Take a look and see if its a quick improvement.

Stamping to unblock.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Bundle Report

Changes will increase total bundle size by 2.19kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 22.9MB 2.19kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: datahub-react-web-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 2.19kB 12.49MB 0.02%

Files in assets/index-*.js:

  • ./src/app/identity/serviceAccount/ServiceAccountList.tsx → Total Size: 4.85kB

  • ./src/app/identity/serviceAccount/cacheUtils.ts → Total Size: 2.94kB

  • ./src/app/identity/serviceAccount/ServiceAccountList.hooks.tsx → Total Size: 6.88kB

  • ./src/app/identity/serviceAccount/ServiceAccountList.components.tsx → Total Size: 12.07kB

@maggiehays maggiehays added pending-submitter-merge and removed needs-review Label for PRs that need review from a maintainer. labels Apr 25, 2026
@jjoyce0510 jjoyce0510 merged commit d3f8f0f into master Apr 27, 2026
49 of 51 checks passed
@jjoyce0510 jjoyce0510 deleted the jj--add-service-account-views-oss branch April 27, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-submitter-merge product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants