You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We apologize for any inconvenience if your PR was broken by changes to constants in test files!
What happened:
Number-string (e.g., "1") constants (e.g., acctest.Ct1) are no longer defined -- this only affects test files
As you might guess, CI/Semgrep checks now don't enforce use of constants for number strings
Fixing your PR:
If your PR includes changes to test files, replace constants with number-strings, e.g., replacing acctest.Ct1 with "1" (see below for autofix instructions)
More details
Previously, in tests, we used number-string (e.g., "1") constants (e.g., acctest.Ct1) for common numbers:
As maintainers, we made the decision that this pattern was not a net benefit and made the code harder to read. As a result, we have reverted all number-string constants back to number-strings in test files:
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
TL;DR
We apologize for any inconvenience if your PR was broken by changes to constants in test files!
What happened:
"1"
) constants (e.g.,acctest.Ct1
) are no longer defined -- this only affects test filesFixing your PR:
acctest.Ct1
with"1"
(see below for autofix instructions)More details
Previously, in tests, we used number-string (e.g.,
"1"
) constants (e.g.,acctest.Ct1
) for common numbers:As maintainers, we made the decision that this pattern was not a net benefit and made the code harder to read. As a result, we have reverted all number-string constants back to number-strings in test files:
Autofixing
Process 1
For most PRs, with changes in only a few test files, this is how to autofix your PR:
main
branch and pull the latestorigin/main
OR mergeorigin/main
onto your branchmake fix-constants
This will replace constants throughout the test codebase with the right number string: e.g.,
acctest.Ct1
will be replaced with"1"
.Process 2
For bigger PRs, affecting many test files, this advanced approach can reduce the merge conflicts. In most cases, you should use Process 1.
git checkout ed86924 -- GNUmakefile .ci/.semgrep-test-constants-temp.yml
make fix-constants
main
branch and pull the latestorigin/main
OR mergeorigin/main
onto your branchReferences
#39840
The text was updated successfully, but these errors were encountered: