Skip to content

Set generated default user-agent version at publish time, not regen #69

@zfarrell

Description

@zfarrell

Problem

The generated Configuration::default() user-agent in src/apis/configuration.rs is baked in by the regen workflow, which passes the crate version read at regen time (--http-user-agent "hotdata-rust/${PACKAGE_VERSION}" / packageVersion= in .github/workflows/regenerate.yml).

This is the wrong place to set it: at regen time we don't know what version will ship. A regen is just a set of changes; the release tooling later decides which version rolls them out (and the bump kind). So the generated default UA always reflects the version committed at the last regen, not the version actually published — it lags, and we've had to hand-correct it during release (e.g. it read hotdata-rust/0.3.2 while cutting 0.4.0).

Note this only affects the raw Configuration::default() path. The ergonomic ClientBuilder already computes hotdata-rust/{CARGO_PKG_VERSION} at compile time, so hotdata::Client users are unaffected.

Proposed fix

Move the generated default user-agent version update into the publish step (scripts/release.sh), not regen:

  • Regen should stop pinning a concrete version into the generated UA (or pin a neutral placeholder).
  • release.sh prepare (which already bumps Cargo.toml to the known release version) should also rewrite the user_agent line in src/apis/configuration.rs to match, so it ships correct.

The release step is the only point where the version is actually known.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions