Skip to content

[backend/frontend] feat(xtmhub): send tenant name in register and refresh connectivity (#5615)#5624

Open
carinelebas wants to merge 23 commits intorelease/currentfrom
issue/5615
Open

[backend/frontend] feat(xtmhub): send tenant name in register and refresh connectivity (#5615)#5624
carinelebas wants to merge 23 commits intorelease/currentfrom
issue/5615

Conversation

@carinelebas
Copy link
Copy Markdown
Member

Proposed changes

Send the name of the tenant in register/auto-register/refresh connectivity endpoints so it can be displayed on xtmhub.

Testing Instructions

  • register an a tenant on xtmhub
  • Check the tenant name is well displayed on xtmhub
  • change the name of the tenant on OpenAEV
  • open filigran page to trigger refresh connectivity
  • check the name of the tenant is well updated.

To be tested with xtmhub local or feature env https://dev-pr-2249.hub.staging.filigran.io/app

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality
  • For bug fix -> I implemented a test that covers the bug

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@carinelebas carinelebas self-assigned this Apr 28, 2026
@carinelebas carinelebas marked this pull request as ready for review April 28, 2026 08:00
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

This PR extends the XTM Hub registration/connectivity payloads to include the current tenant name so XTM Hub can display it and keep it updated when connectivity is refreshed.

Changes:

  • Add tenantName/tenant_name to XTM Hub register (FE redirect), auto-register (BE → Hub), and refresh-connectivity (BE → Hub) payloads.
  • Ensure refresh-all-tenants payloads can include tenant names by carrying tenantName through TenantRegistrationDetails.
  • Fetch tenant data alongside registrations to access the tenant name during refresh operations.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
openaev-model/src/main/java/io/openaev/database/repository/TenantXtmHubRegistrationRepository.java Adjusts query to fetch the associated Tenant when listing registrations.
openaev-front/src/admin/components/settings/experience/xtm_hub/XtmHubTab.tsx Adds tenant_name to the XTM Hub redirect query params; uses URL-derived tenant id.
openaev-api/src/test/java/io/openaev/xtmhub/XtmHubServiceTest.java Updates service construction/mocks and asserts tenantName is present in Hub payloads.
openaev-api/src/main/java/io/openaev/xtmhub/XtmHubService.java Resolves tenant name for auto-register and includes tenant name in refresh-connectivity calls.
openaev-api/src/main/java/io/openaev/xtmhub/XtmHubClient.java Extends GraphQL request builders to send tenantName for auto-register and refresh operations.
openaev-api/src/main/java/io/openaev/xtmhub/TenantRegistrationDetails.java Extends record to carry tenantName for all-tenants refresh payload.
Comments suppressed due to low confidence (1)

openaev-api/src/main/java/io/openaev/xtmhub/XtmHubClient.java:186

  • issue (blocking): buildRefreshStatusSingleTenantBody() builds the GraphQL JSON payload via String.format(...) and now interpolates tenantName. Tenant names can legally contain quotes/newlines/backslashes, which will produce invalid JSON and make the refresh call fail (the JsonParser parse will throw). Prefer building the body with JsonObject/addProperty (like buildAutoRegisterBody and buildRefreshStatusAllTenantsBody) so values are correctly escaped, or explicitly JSON-escape all interpolated fields before formatting.
    String mutationBody =
        String.format(
            """
                {
                  "query": "
                    mutation refreshPlatformRegistrationConnectivityStatusSingleTenant($input: RefreshPlatformRegistrationConnectivityStatusSingleTenantInput!) {
                      refreshPlatformRegistrationConnectivityStatusSingleTenant(input: $input) {
                        status

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.50%. Comparing base (468efed) to head (711b321).
⚠️ Report is 15 commits behind head on release/current.

Additional details and impacted files
@@                  Coverage Diff                   @@
##             release/current    #5624       +/-   ##
======================================================
- Coverage              64.67%   40.50%   -24.18%     
- Complexity              6067     6069        +2     
======================================================
  Files                   1159     2118      +959     
  Lines                  35020    56713    +21693     
  Branches                2711     7184     +4473     
======================================================
+ Hits                   22650    22970      +320     
- Misses                 11045    32400    +21355     
- Partials                1325     1343       +18     
Flag Coverage Δ
backend 64.66% <100.00%> (?)
frontend 1.42% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from issue/priv/94 to release/current April 29, 2026 07:29
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