Skip to content

SLCORE-2244 Implement IDESupportedLanguageViewed Gessie telemetry event#1926

Open
nquinquenel wants to merge 2 commits intomasterfrom
feature/nq/SLCORE-2244-supp-lang-viewed-event
Open

SLCORE-2244 Implement IDESupportedLanguageViewed Gessie telemetry event#1926
nquinquenel wants to merge 2 commits intomasterfrom
feature/nq/SLCORE-2244-supp-lang-viewed-event

Conversation

@nquinquenel
Copy link
Member

No description provided.

@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Mar 18, 2026

SLCORE-2244

Copy link

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 adds a new Gessie telemetry event (Analytics.IDE.IDESupportedLanguageViewed) emitted when the user opens the IDE “Supported Languages” view, wiring it end-to-end from RPC notification through backend telemetry and into Gessie event posting.

Changes:

  • Added a new RPC notification (supportedLanguageViewed) and params DTO to report the UI action from client to backend.
  • Implemented a new Gessie payload type (IDESupportedLanguageViewedPayload) and generalized Gessie metadata construction via a GessieEventPayload interface.
  • Added backend logic to enrich the event with local user id + connection-related info, plus medium/unit tests to verify behavior.

Reviewed changes

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

Show a summary per file
File Description
rpc-protocol/.../SupportedLanguageViewedParams.java New RPC params DTO carrying configScopeId.
rpc-protocol/.../TelemetryRpcService.java Adds supportedLanguageViewed JSON notification to the telemetry RPC contract.
backend/rpc-impl/.../TelemetryRpcServiceDelegate.java Wires the new RPC notification to TelemetryService.supportedLanguageViewed(...).
backend/core/.../TelemetryService.java Builds and forwards IDESupportedLanguageViewedPayload to GessieService (incl. user id + OS + connection info).
backend/core/.../TelemetryServerAttributesProvider.java Resolves optional connection-related info for Gessie payloads from effective binding.
backend/core/.../GessieConnectionInfo.java New record to transport resolved connection info (type/user/org/installation).
backend/telemetry/.../event/payload/GessieEventPayload.java New interface to provide event type/version generically for metadata building.
backend/telemetry/.../event/payload/MessagePayload.java Updated to implement GessieEventPayload and define type/version constants.
backend/telemetry/.../event/payload/IDESupportedLanguageViewedPayload.java New payload record for the IDESupportedLanguageViewed event.
backend/telemetry/.../GessieService.java Refactors posting via generic metadata builder and adds API to post supported-language-viewed event.
backend/core/src/test/.../TelemetryServiceTests.java Unit tests for gating/enrichment behavior of supportedLanguageViewed.
backend/telemetry/src/test/.../GessieServiceTests.java Unit test verifying correct event metadata/payload posting for the new event.
medium-tests/.../GessieSupportedLanguageViewedMediumTests.java Medium tests verifying HTTP event emission behavior (enabled/disabled, bound/unbound scopes).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@nquinquenel nquinquenel force-pushed the feature/nq/SLCORE-2244-supp-lang-viewed-event branch from c76d18f to 363fb81 Compare March 19, 2026 09:34
@nquinquenel nquinquenel requested a review from Copilot March 19, 2026 09:41
@nquinquenel nquinquenel marked this pull request as ready for review March 19, 2026 09:41
@nquinquenel nquinquenel requested a review from Krosovok March 19, 2026 09:41
@sonar-review-alpha
Copy link

sonar-review-alpha bot commented Mar 19, 2026

Summary

Adds a new RPC method to record Gessie telemetry when users open the "Supported Languages" view in the IDE. The event captures local user ID, product version, OS, and connection context (SonarQube/SonarCloud binding details) to provide usage insights. Implementation includes a new GessieEventPublisher that resolves connection info from the config scope and guards against missing telemetry opt-in or user IDs.

What reviewers should know

Where to start:

  1. RPC protocol: rpc-protocol/.../TelemetryRpcService.java — new supportedLanguageViewed() method
  2. Parameters: rpc-protocol/.../SupportedLanguageViewedParams.java — simple wrapper taking configScopeId
  3. Implementation chain: TelemetryRpcServiceDelegateGessieEventPublisherGessieService → HTTP client

Non-obvious decisions:

  • Connection info (SQC vs SQS) is resolved by TelemetryServerAttributesProvider.getGessieConnectionInfo(), which is config-scope-aware. For unbound scopes, all connection fields are null.
  • Event is silently dropped if: Gessie disabled, telemetry user opt-in false, or local user ID unavailable (only logged in debug mode)
  • SQC and SQS have different attribute patterns: SQC includes organization UUID; SQS includes installation ID (see test cases)

Files to review carefully:

  • GessieEventPublisher — guards and nullability logic for connection info
  • IDESupportedLanguageViewedPayload — Gessie event contract
  • Medium tests — cover unbound vs bound scopes, disabled telemetry, and both SQS/SQC connection types

  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

Copy link

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

Implements the new Gessie telemetry event Analytics.IDE.IDESupportedLanguageViewed end-to-end, exposing it through the RPC protocol and wiring it through the backend telemetry services.

Changes:

  • Added a new RPC notification (supportedLanguageViewed) and its params DTO to let IDE clients report opening the “Supported Languages” view.
  • Implemented a new Gessie payload (IDESupportedLanguageViewedPayload) and refactored GessieService to post events via a common payload interface (GessieEventPayload).
  • Added unit + medium tests validating payload composition and HTTP posting behavior.

Reviewed changes

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

Show a summary per file
File Description
rpc-protocol/.../SupportedLanguageViewedParams.java New RPC params DTO carrying configScopeId.
rpc-protocol/.../TelemetryRpcService.java Adds supportedLanguageViewed JSON notification to the RPC interface.
backend/rpc-impl/.../TelemetryRpcServiceDelegate.java Delegates the new RPC notification to TelemetryService.
backend/core/.../TelemetryService.java Builds and sends the new Gessie event payload, including OS + connection info.
backend/core/.../TelemetryServerAttributesProvider.java Adds helper to resolve connection-related info for the payload.
backend/core/.../GessieConnectionInfo.java New record representing resolved connection info for Gessie events.
backend/telemetry/.../GessieService.java Refactors posting into generic postEvent and adds supportedLanguageViewed.
backend/telemetry/.../event/payload/GessieEventPayload.java New interface for payloads to supply event type/version.
backend/telemetry/.../event/payload/MessagePayload.java Updated to implement GessieEventPayload and expose type/version constants.
backend/telemetry/.../event/payload/IDESupportedLanguageViewedPayload.java New payload record for the Supported Languages viewed event.
backend/telemetry/.../GessieServiceTests.java New unit tests for enablement + event posting correctness.
backend/core/.../TelemetryServiceTests.java Extends unit tests to cover supportedLanguageViewed payload creation.
medium-tests/.../GessieSupportedLanguageViewedMediumTests.java Adds medium tests validating HTTP calls made to the Gessie endpoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@nquinquenel nquinquenel force-pushed the feature/nq/SLCORE-2244-supp-lang-viewed-event branch from 363fb81 to d5014b1 Compare March 19, 2026 09:53
Copy link

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

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

Conclusion: Clean, well-tested implementation overall. One design issue worth fixing before this pattern is replicated for future Gessie events.

🗣️ Give feedback

Comment on lines +429 to +430
public void supportedLanguageViewed(String configScopeId) {
if (!gessieService.isEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about this one, but a food for thought.

I am not sure if this method belongs here. Yes, it is telemetry, but Gessie is also a separate thing. And it also makes you expose gessieService.isEnabled() to the outside.

It would make more sense for the method to be in GessieService (or some new class that would use it and have isEnabled logic there) and use it directly in TelemetryRpcServiceDelegate. So it's all telemetry but implementations are different and not reference each other.

Copy link
Member Author

Choose a reason for hiding this comment

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

I kinda agree, I still want to have this enablement check in this method to avoid computing all this if telemetry is disabled.

I created a dedicated GessieEventPublisher class, to support the logic of such events related to Gessie, to avoid having them in TelemetryService class.

GessieService is focused on the HOW to send event, while GessieEventPublisher focuses on WHAT data to gather.

@nquinquenel nquinquenel force-pushed the feature/nq/SLCORE-2244-supp-lang-viewed-event branch from 638a5dc to 92d8af4 Compare March 19, 2026 21:26
@nquinquenel nquinquenel force-pushed the feature/nq/SLCORE-2244-supp-lang-viewed-event branch from 92d8af4 to cd9b1d1 Compare March 19, 2026 21:31
@sonarqube-next
Copy link

Copy link

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

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

LGTM! ✅

🗣️ Give feedback

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