Summary
Deferred from Copilot review of #442 (round 10, src/github2gerrit/core.py,
_resolve_gerrit_info).
Since #442 an explicit GERRIT_SERVER outranks the .gitreview host. The
port does not follow: when .gitreview supplies the host and GERRIT_SERVER
is not explicit, the file's GerritInfo is returned unchanged and an
explicitly supplied non-default GERRIT_SERVER_PORT is ignored.
docs/features.md ("Gerrit target resolution") lists
GERRIT_SERVER_PORT alongside the other explicit inputs, so the documented
contract and the code disagree.
The underlying problem
Inputs.gerrit_server_port is an int defaulting to 29418; nothing records
whether the operator set it or it defaulted, so the resolver cannot give the
port its own precedence.
Options
- Document that the port travels with the host. An explicit server brings
its GERRIT_SERVER_PORT; otherwise .gitreview owns host and port.
Smallest change; matches current behaviour.
- Track port provenance. Treat a blank
GERRIT_SERVER_PORT env as unset
(the action input defaults to "29418", so the composite action would need
to stop defaulting it), and let an explicit non-default port override the
file's.
Option 1 is the pragmatic choice; a docs-only change to the resolution order
list and the _resolve_gerrit_info docstring. Draft wording exists locally.
Acceptance criteria
Summary
Deferred from Copilot review of #442 (round 10,
src/github2gerrit/core.py,_resolve_gerrit_info).Since #442 an explicit
GERRIT_SERVERoutranks the.gitreviewhost. Theport does not follow: when
.gitreviewsupplies the host andGERRIT_SERVERis not explicit, the file's
GerritInfois returned unchanged and anexplicitly supplied non-default
GERRIT_SERVER_PORTis ignored.docs/features.md("Gerrit target resolution") listsGERRIT_SERVER_PORTalongside the other explicit inputs, so the documentedcontract and the code disagree.
The underlying problem
Inputs.gerrit_server_portis anintdefaulting to29418; nothing recordswhether the operator set it or it defaulted, so the resolver cannot give the
port its own precedence.
Options
its
GERRIT_SERVER_PORT; otherwise.gitreviewowns host and port.Smallest change; matches current behaviour.
GERRIT_SERVER_PORTenv as unset(the action input defaults to
"29418", so the composite action would needto stop defaulting it), and let an explicit non-default port override the
file's.
Option 1 is the pragmatic choice; a docs-only change to the resolution order
list and the
_resolve_gerrit_infodocstring. Draft wording exists locally.Acceptance criteria
docs/features.mdand the_resolve_gerrit_infodocstring state onerule for the port, and the code follows it