Skip to content

packit: add get-current-version to fix PR builds#86

Merged
jlebon merged 1 commit intomainfrom
packit-fix
Mar 11, 2026
Merged

packit: add get-current-version to fix PR builds#86
jlebon merged 1 commit intomainfrom
packit-fix

Conversation

@jlebon
Copy link
Copy Markdown
Member

@jlebon jlebon commented Mar 11, 2026

Packit defaults to git describe for the project version. So when cutting a release, on PRs where we're bumping the chunkah version in Cargo.toml, we get a mismatch: create-archives.sh reads the version from Cargo.toml (e.g. 0.3.0), but PACKIT_PROJECT_VERSION resolved to 0.2.0 from the last tag, so fix-spec-file referenced a vendor tarball that didn't exist.

Add a get-current-version action that reads the version from Cargo.toml via cargo metadata, keeping PACKIT_PROJECT_VERSION consistent with the archives that create-archives.sh produces.

Assisted-by: OpenCode (Claude Opus 4.6)

Packit defaults to `git describe` for the project version. So when
cutting a release, on PRs where we're bumping the chunkah version in
`Cargo.toml`, we get a mismatch: `create-archives.sh` reads the version
from `Cargo.toml` (e.g. 0.3.0), but `PACKIT_PROJECT_VERSION` resolved to
0.2.0 from the last tag, so `fix-spec-file` referenced a vendor tarball
that didn't exist.

Add a `get-current-version` action that reads the version from
`Cargo.toml` via `cargo metadata`, keeping `PACKIT_PROJECT_VERSION`
consistent with the archives that `create-archives.sh` produces.

Assisted-by: OpenCode (Claude Opus 4.6)
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a get-current-version action in the Packit configuration to ensure the project version is consistently read from Cargo.toml during builds. This correctly fixes an issue with version mismatches in pull requests. My review includes a suggestion to address code duplication. The command to get the version is now present in two places, and I recommend refactoring it into a shared script to improve maintainability.

Comment thread .packit.yaml
@jlebon jlebon merged commit b64a38b into main Mar 11, 2026
10 checks passed
@jlebon jlebon deleted the packit-fix branch March 11, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant