Description
The GitHub Change ID parser accepts certain malformed Change IDs that do not conform to the expected format.
In particular, PR numbers such as 0, negative values, explicitly signed values, and values with leading zeros are accepted. Repository paths containing empty segments are also accepted.
Steps to Reproduce
- Call the GitHub Change ID parser with a PR number such as
0, -3, +5, or 007.
- Call it with a repository path containing an empty segment, such as
github://github.example.com/uber//frontend/webapp/pull/42/<sha>.
- Observe that the parser returns no error for these malformed inputs.
Expected Behavior
Malformed Change IDs should be rejected during parsing.
PR numbers should be positive and use their canonical decimal representation, and repository paths should not contain empty segments.
Actual Behavior
The parser accepts these malformed inputs instead of returning an error.
Environment
- Go version: go1.27.1
- OS: Windows/amd64
- Bazel: 8.4.1
Logs / Screenshots
Additional test cases reproduce these malformed inputs.
Additional Context
The malformed cases are now covered by unit tests.
Description
The GitHub Change ID parser accepts certain malformed Change IDs that do not conform to the expected format.
In particular, PR numbers such as
0, negative values, explicitly signed values, and values with leading zeros are accepted. Repository paths containing empty segments are also accepted.Steps to Reproduce
0,-3,+5, or007.github://github.example.com/uber//frontend/webapp/pull/42/<sha>.Expected Behavior
Malformed Change IDs should be rejected during parsing.
PR numbers should be positive and use their canonical decimal representation, and repository paths should not contain empty segments.
Actual Behavior
The parser accepts these malformed inputs instead of returning an error.
Environment
Logs / Screenshots
Additional test cases reproduce these malformed inputs.
Additional Context
The malformed cases are now covered by unit tests.