Skip to content

runtime: Correct naming & docs for version checking#8191

Merged
charlieegan3 merged 2 commits intoopen-policy-agent:mainfrom
charlieegan3:remove-telemetry-leftovers
Jan 8, 2026
Merged

runtime: Correct naming & docs for version checking#8191
charlieegan3 merged 2 commits intoopen-policy-agent:mainfrom
charlieegan3:remove-telemetry-leftovers

Conversation

@charlieegan3
Copy link
Copy Markdown
Contributor

Rename telemetry functionality to version checking to accurately reflect current behavior following
#7756.

The system only checks GitHub releases for version updates without sending any data about the OPA instance and so the privacy docs have been updated too.

…/opa remove-telemetry-leftovers ✗ go run main.go run -s
{"addrs":["localhost:8181"],"diagnostic-addrs":[],"level":"info","msg":"Initializing server.","time":"2026-01-07T18:23:50Z"}
{"current_version":"1.11.0-dev","download_opa":"https://openpolicyagent.org/downloads/v1.12.2/opa_darwin_arm64_static","latest_version":"1.12.2","level":"info","msg":"OPA is out of date.","release_notes":"https://github.com/open-policy-agent/opa/releases/tag/v1.12.2","time":"2026-01-07T18:23:50Z"}
^C{"level":"info","msg":"Shutting down...","time":"2026-01-07T18:23:53Z"}
{"level":"info","msg":"Server shutdown.","time":"2026-01-07T18:23:53Z"}

…/opa remove-telemetry-leftovers ✗ go run main.go run -s --skip-version-check
{"addrs":["localhost:8181"],"diagnostic-addrs":[],"level":"info","msg":"Initializing server.","time":"2026-01-07T18:23:59Z"}
^C{"level":"info","msg":"Shutting down...","time":"2026-01-07T18:24:01Z"}
{"level":"info","msg":"Server shutdown.","time":"2026-01-07T18:24:01Z"}

Fixes #8093

run: make ci-build-windows ci-go-ci-build-linux ci-go-ci-build-linux-static
timeout-minutes: 30
env:
TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I understand these are no longer needed since we have a GitHub.com default now.

tlsCertRefresh time.Duration
ignore []string
serverMode bool
skipVersionCheck bool // skipVersionCheck is deprecated. Use disableTelemetry instead
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This field used to be deprecated before the telemetry feature was originally implemented, back in ~0.20, but I think it makes sense to go back to using this flag now since it's still here and is well named.

// For backwards compatibility, check if `--skip-version-check` flag set.
if params.skipVersionCheck {
// For backwards compatibility, check if deprecated `--disable-telemetry` flag set.
if params.disableTelemetry {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we need to support this path for some time as this same commit deprecates the flag.

| DOCKER_USER | Docker username for uploading release images. Will be used with `docker login`. Optional -- If not provided the image push steps are skipped. |
| DOCKER_PASSWORD | Docker password or API token for the configured `DOCKER_USER`. Will be used with `docker login`. Optional -- If not provided the image push steps are skipped. |
| SLACK_NOTIFICATION_WEBHOOK | Slack webhook for sending notifications. Optional -- If not provided the notification steps are skipped. |
| TELEMETRY_URL | URL to inject at build-time for OPA version reporting. Optional -- If not provided the default value in OPA's source is used. |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is still set in GH, but I not used and should be removed after merge.

@netlify
Copy link
Copy Markdown

netlify bot commented Jan 7, 2026

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit a0ba825
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/695f83dda394c30008004733
😎 Deploy Preview https://deploy-preview-8191--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

User-Agent: "Open Policy Agent/v0.12.3 (darwin, amd64)"
GET /repos/open-policy-agent/opa/releases/latest HTTP/1.1
Host: api.github.com
User-Agent: OPA-Version-Checker
Copy link
Copy Markdown
Contributor Author

@charlieegan3 charlieegan3 Jan 7, 2026

Choose a reason for hiding this comment

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

I have updated the code to use a custom user agent with no version info.


// WithTelemetryGatherers allows registration of telemetry gatherers which enable injection of additional data in the
// telemetry report
func WithTelemetryGatherers(gs map[string]report.Gatherer) func(*Manager) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed this since it's based on an internal type. I was unsure what to do otherwise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought I remembered EOPA using this, but we have ripped it all out since then. IIRC, you could provide a map[string]func(context.Context) (any, error) and it would work, regardless of the report.Gatherer type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ahh yeah that makes much more sense. I have made some updates in d19852e

@charlieegan3 charlieegan3 marked this pull request as draft January 7, 2026 18:32
@charlieegan3 charlieegan3 force-pushed the remove-telemetry-leftovers branch 2 times, most recently from ca9b573 to ef6110a Compare January 7, 2026 19:41
@charlieegan3 charlieegan3 changed the title runtime: Correct naming of version checking code runtime: Correct naming & docs for version checking Jan 7, 2026
}
m.reporter = reporter

m.reporter.RegisterGatherer("min_compatible_version", func(_ context.Context) (any, error) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was used for telemetry but is no longer used as far as I can see.

@charlieegan3 charlieegan3 force-pushed the remove-telemetry-leftovers branch 2 times, most recently from 9d303a1 to 510def7 Compare January 7, 2026 19:50
Copy link
Copy Markdown
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

Nice cleanup, thanks a lot. And it makes so much more sense to call it "versioncheck" these days. 👍


// WithTelemetryGatherers allows registration of telemetry gatherers which enable injection of additional data in the
// telemetry report
func WithTelemetryGatherers(gs map[string]report.Gatherer) func(*Manager) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought I remembered EOPA using this, but we have ripped it all out since then. IIRC, you could provide a map[string]func(context.Context) (any, error) and it would work, regardless of the report.Gatherer type.

@charlieegan3 charlieegan3 force-pushed the remove-telemetry-leftovers branch from 510def7 to 326d4ac Compare January 7, 2026 20:04
Copy link
Copy Markdown
Contributor

@srenatus srenatus Jan 7, 2026

Choose a reason for hiding this comment

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

Huh, what was that about? 🤔 Ah, the change in CLI parameters. Nevermind.

@charlieegan3 charlieegan3 force-pushed the remove-telemetry-leftovers branch from 326d4ac to f7e6e1a Compare January 7, 2026 20:06
@charlieegan3 charlieegan3 marked this pull request as ready for review January 7, 2026 20:17
Copy link
Copy Markdown
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

LGTM

Rename telemetry functionality to version checking to accurately reflect
current behavior following
open-policy-agent#7756.

The system only checks GitHub releases for version updates without sending
any data about the OPA instance and so the privacy docs have been updated too.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
Deprecate WithTelemetryGatherers since telemetry gathering has been removed.
The function now returns a no-op to maintain API compatibility without
breaking existing code that might uses it.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
@charlieegan3 charlieegan3 enabled auto-merge (squash) January 8, 2026 10:15
@charlieegan3 charlieegan3 force-pushed the remove-telemetry-leftovers branch from d19852e to a0ba825 Compare January 8, 2026 10:15
@charlieegan3
Copy link
Copy Markdown
Contributor Author

Thanks for the review Stephan!

@charlieegan3 charlieegan3 merged commit 6601188 into open-policy-agent:main Jan 8, 2026
31 checks passed
alex60217101990 pushed a commit to alex60217101990/opa that referenced this pull request Jan 10, 2026
…t#8191)

* runtime: Correct naming of version checking code

Rename telemetry functionality to version checking to accurately reflect
current behavior following
open-policy-agent#7756.

The system only checks GitHub releases for version updates without sending
any data about the OPA instance and so the privacy docs have been updated too.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Make WithTelemetryGatherers a no-op

Deprecate WithTelemetryGatherers since telemetry gathering has been removed.
The function now returns a no-op to maintain API compatibility without
breaking existing code that might uses it.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

---------

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update telemetry documentation

2 participants