-
Notifications
You must be signed in to change notification settings - Fork 34
crypto/internal/backend: add deprecation warnings for specific crypto backends #1884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: microsoft/main
Are you sure you want to change the base?
Conversation
… backends Add deprecation warnings for opensslcrypto, cngcrypto, and darwincrypto GOEXPERIMENT values in CI environments (GitHub Actions and Azure DevOps). These specific backend experiments are deprecated in favor of systemcrypto, which automatically selects the appropriate backend for the target platform. The warnings use CI-specific formats: - GitHub Actions: ::warning:: annotation - Azure DevOps: ##vso[task.logissue type=warning] command Warnings are only emitted when: 1. Running in a detected CI environment 2. The deprecated backend was explicitly specified by the user (not auto-selected by systemcrypto) This helps users migrate away from the specific backend experiments without breaking existing tooling that might parse stdout/stderr, and avoids warning when systemcrypto automatically selects a backend.
0998bf2
to
17a0655
Compare
d6535f5
to
8c2e476
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better than emitting some unformatted string to stdout, but only because it's more likely to be seen, as far as I can tell. It can still cause breakage:
- It's still something being printed to a std output stream, just in a way that some environments can automatically parse.
- A warning is often considered an error in principle, even if that logic is not directly implemented in AzDO/Actions.
- Arguably it's worse to detect environment because then it's less reproducible. If the output is causing an error in a non-obvious way (e.g. if stderr is parsed by something else, never reported directly and therefore never seen by AzDO/Actions), this could be quite a challenge to debug.
- Or: it might simply show up as an error, which is already bad.
But even without that, I don't think we have justification for removing or even discouraging the old experiment values. What's the problem if people keep using them? Who benefits from this warning?
+ backend) | ||
+ } | ||
+ // For other environments, we don't emit warnings to avoid breaking | ||
+ // users who might be parsing stdout/stderr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this logic holds: I would expect child processes to inherit the variables, so e.g. even if isAzureDevOps()
is true, there might be a wrapper process doing parsing.
Add deprecation warnings for opensslcrypto, cngcrypto, and darwincrypto GOEXPERIMENT values in CI environments (GitHub Actions and Azure DevOps). These specific backend experiments are deprecated in favor of systemcrypto, which automatically selects the appropriate backend for the target platform.
The warnings use CI-specific formats:
Warnings are only emitted when:
This helps users migrate away from the specific backend experiments without breaking existing tooling that might parse stdout/stderr, and avoids warning when systemcrypto automatically selects a backend.
A few test outputs to confirm functionality: