cli/jsonoutput: CI 检查不兼容的 API 变更
In PR #17683, we introduced tailscale.com/cmd/tailscale/cli/jsonouput with the intention of providing "stable and versioned JSON serialisation for CLI output." This package is also intended to provide importable structs that third-party programs, like Headscale, can use to parse this CLI output. We also want to ensure that the wire-protocol, i.e. JSON encoding, doesn't break either. However, there is a danger that we accidentally break the API in this package and don't notice. I suggest we add a check for incompatible API changes to our continuous integration checks to prevent this from happening accidentally. As of 2026-06-03, it looks like golang.org/x/exp/apidiff is still the best option for doing this check. I'm not sure that this tool looks at struct tags, we'll want to confirm that it can prevent incompatible json: changes. The Kubernetes project has an example GitHub Actions workflow that can inspire our implementation, but we should probably constrain this check to just the APIs where we offer backwards-compatibility guarantees:
内容来源: tailscale/tailscale