Package: hcloud-cli
Version: 1.30.3-1+b5
Severity: normal

Dear Maintainer,

The hcloud-cli distributed by debian does not have its version set.

This leads to 2 problems:
- the 'hcloud version' command does not return the expected version info:

  expected output: hcloud 1.41.1
  current output: hcloud was not built properly

- the user agent used to call the Hetzner Cloud API does not include the
  version:

  expected user agent: hcloud-cli/v1.41.1 hcloud-go/2.5.1
  current user againt: hcloud-cli/was not built properly hcloud-go/2.5.1

The way the version is handled upstream has recently changed, and it
should mitigate part of this issue:
https://github.com/hetznercloud/cli/commit/af9dec448dfaf5331d5200d96722e5c648c25624#diff-8aa632a6f4ad2a3a7fef52661816aa3977f23c0673ef29633c01116fee6745c6

To fully solve this issue, I suggest that the debian build process updates
the relevant version variables using the linker flags, as we currenlty do in the
upstream build process:

https://github.com/hetznercloud/cli/blob/e1bd800db671e9deb68a86bd5ff810211f56a7d5/.goreleaser.yml#L11-L12

The linker flags below could be used in the debian package build command:

# Set the version to the debian version (maybe adding a local debian build 
number?)
-X 
github.com/hetznercloud/cli/internal/version.version="$(DEB_VERSION_UPSTREAM)+debian.1"
# Remove the -dev suffix, this is not a dev/pre relesease
-X github.com/hetznercloud/cli/internal/version.versionPrerelease=""

Thanks for considering this bug.
Cheers,

Jonas

-- System Information:
Debian Release: 12.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-17-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages hcloud-cli depends on:
ii  libc6  2.36-9+deb12u3

hcloud-cli recommends no packages.

hcloud-cli suggests no packages.

-- no debconf information

Reply via email to