Skip to content

GERRIT_SERVER_PORT precedence is undocumented against .gitreview #444

Description

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

  1. 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.
  2. 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

  • docs/features.md and the _resolve_gerrit_info docstring state one
    rule for the port, and the code follows it

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions