Skip to content

[codegen] Support the current protocol reference graph deterministically #1100

Description

@bokelley

Summary

The Python type generator did not cleanly consume the current protocol source graph used by the reporting RFC. Two general generator assumptions failed:

  1. sibling macro-*.json references were not recognized/resolved consistently;
  2. selected canonical-ref preservation handled canonical URLs but not equivalent local relative references.

After those were fixed, newly generated shared names (Alignment, PrimaryKey, and TimezoneBasis) also tripped the collision gate and needed explicit review/allowlisting.

Impact

Valid changes in protocol reference layout can break Python generation even when the JSON Schema suite passes. Fixing each schema locally or copying only the desired generated models hides the incompatibility until release time.

Expected

  • Resolve sibling, parent-relative, root-relative, and canonical URL references through one normalized path algorithm.
  • Assert that normalized references cannot escape the schema root.
  • Add fixtures covering sibling macro-*.json references and local/canonical forms of the same reference.
  • Keep collision failures loud, but include a deterministic review/update workflow and focused diagnostics showing each source definition.
  • Run the generator against the protocol PR bundle in CI.

The generator fixes and collision decisions are already implemented in #1095; this issue should remain the regression/acceptance record for that work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions