Prevent telemetry disabling in OSS edition without WCP connection#4843
Prevent telemetry disabling in OSS edition without WCP connection#4843
Conversation
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
…r check Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
|
let's do one more thing here... In Also, let's do one other abstraction and that's Once we have that abs/impl, then use it in the new EnsureTelemetryEnabledForOss impl. Basically, we don't care on what tier the project is when webiny-js repo === true. |
…tryEnabledForOss Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
Done! Created
Commit: fd435af |
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
webiny#4843) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com> Co-authored-by: adrians5j <adrian@webiny.com> Co-authored-by: Adrian Smijulj <adrian1358@gmail.com>
webiny#4843) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com> Co-authored-by: adrians5j <adrian@webiny.com> Co-authored-by: Adrian Smijulj <adrian1358@gmail.com>
OSS users must not disable telemetry unless connected to Webiny Control Panel (enterprise feature) or working in the webiny-js development repository.
Changes
Added
IsWcpEnabledabstraction and implementation: Created new abstraction to check WCP connection status usingGetProjectIdServiceinstead of direct environment variable access. Provides cleaner separation of concerns and better testability.Added
IsWebinyJsRepoabstraction and implementation: Created new abstraction to detect the webiny-js development repository by checking for the existence ofpackages/admin-uidirectory. This allows developers working on Webiny itself to bypass telemetry restrictions.Added
EnsureTelemetryEnabledForOssBeforeDeploy hook: Validates telemetry state before deployment by checkingIsTelemetryEnabled,IsWcpEnabled, andIsWebinyJsReposervices. ThrowsGracefulErrorwhen telemetry is disabled without WCP connection in non-development environments.Registered built-in implementations in DI container: Auto-loaded in
createProjectSdkContainer.tsafter composite registration, ensuring validation runs on every deployment without requiring explicit user configuration.Behavior
Pattern follows existing built-in hooks like
EnsureCoreDeployedBeforeApiDeployand uses proper abstractions for improved maintainability.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.