fix(cli): report production usage data only for released builds - #3065
Merged
Conversation
|
kanoru3101
marked this pull request as draft
August 31, 2026 15:32
Contributor
Coverage Report
File CoverageNo changed files found. |
Contributor
Performance Benchmark (Lower is Faster)
|
kanoru3101
force-pushed
the
fix/release-usage-improvments
branch
5 times, most recently
from
August 31, 2026 16:23
54e1787 to
4bd44db
Compare
The esbuild define hardcoded `production`, so snapshot builds and any local bundle reported themselves as released usage. The value now comes from BUILD_ENV, which only the release job and the Docker image build set; everything else stays `development`. The release workflow also had no REDOCLY_TELEMETRY, and its post-release smoke checks run the released CLI over three commands. `docker run` does not inherit the workflow environment, so those calls pass the variable explicitly.
kanoru3101
force-pushed
the
fix/release-usage-improvments
branch
from
August 31, 2026 16:29
4bd44db to
3573900
Compare
Contributor
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1788270600 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1788270600 |
kanoru3101
marked this pull request as ready for review
September 1, 2026 14:17
AlbinaBlazhko17
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why/How?
Our own builds and CI runs showed up in usage data as real users. Two fixes:
env: productionnow. Snapshots and local builds reportdevelopment.REDOCLY_TELEMETRY: offin the workflow, because containers don't see that variable.Reference
Follow-up to #2976.
Testing
Verified in Docker: the build arg reaches
RUN, and-e REDOCLY_TELEMETRYforwards the value into containers.Check yourself
Security
Note
Low Risk
Changes affect build-time constants and CI/Docker env wiring for telemetry labeling, not runtime auth or data handling for end users.
Overview
Stops internal CI and non-release builds from polluting usage telemetry as production traffic.
The CLI esbuild step no longer hardcodes
REDOCLY_CLI_BUILD_ENVto production; it now bakes inBUILD_ENVat compile time, defaulting to development when unset. The release workflow setsBUILD_ENV=productionfor npm publish, and Docker Hub builds passBUILD_ENV=productionvia a new DockerfileARGandbuild-args.CI telemetry is tightened: release workflow sets workflow-wide
REDOCLY_TELEMETRY: 'off', and Docker smoke steps in release and smoke workflows use aredocly_dockerhelper that forwards-e REDOCLY_TELEMETRYinto containers (so workflow env vars actually apply inside Docker).Reviewed by Cursor Bugbot for commit f2ed1c5. Bugbot is set up for automated code reviews on this repo. Configure here.