Skip to content

Conversation

pau-hedgehog
Copy link
Contributor

@pau-hedgehog pau-hedgehog commented Jul 8, 2025

When no fab.yaml is found, the versions command shows the release versions instead of an error:

pau@fedora:~/fabricator$ bin/hhfab versions
16:20:32 INF Hedgehog Fabricator version=v0.40.0-33-g4f106419-dirty-Im1446
16:20:32 ERR printing versions: config "fab.yaml": does not exist

VS:

pau@fedora:~/fabricator$ bin/hhfab versions
17:00:47 INF Hedgehog Fabricator version=v0.40.0-26-g1ed17d84-dirty-N51656
17:00:47 INF No configuration found file=fab.yaml action="Showing release versions"
fabric:
  agent: v0.82.0
  api: v0.82.0
  boot: v0.82.0
  controller: v0.82.0
  ctl: v0.82.0
  dhcpd: v0.82.0
  nos:
    sonic-bcm-base: v4.5.0
    sonic-bcm-campus: v4.5.0
    sonic-bcm-vs: v4.5.0
  proxy: 1.9.1
  proxyChart: v0.82.0
fabricator:
  api: v0.40.0-26-g1ed17d84-dirty-N51656
  controlISORoot: v4152.2.3-hh1
  controller: v0.40.0-26-g1ed17d84-dirty-N51656
  ctl: v0.40.0-26-g1ed17d84-dirty-N51656
  flatcar: v4152.2.3
  nodeConfig: v0.40.0-26-g1ed17d84-dirty-N51656
  pause: "3.6"
...

@pau-hedgehog pau-hedgehog self-assigned this Jul 8, 2025
@pau-hedgehog pau-hedgehog force-pushed the pau/hhfab_versions branch 2 times, most recently from 8a003bb to 3785e41 Compare July 8, 2025 21:18
@pau-hedgehog
Copy link
Contributor Author

I'm removing the skip-vlab label because I added the hhfab versions in the CI workflow to keep track of the versions tested

@pau-hedgehog pau-hedgehog force-pushed the pau/hhfab_versions branch 2 times, most recently from 4a2bd42 to fc41208 Compare July 9, 2025 14:58
@pau-hedgehog pau-hedgehog marked this pull request as ready for review July 9, 2025 14:58
@pau-hedgehog pau-hedgehog requested review from a team as code owners July 9, 2025 14:58
@pau-hedgehog pau-hedgehog requested a review from Frostman July 10, 2025 13:10
@Frostman Frostman requested a review from Copilot July 11, 2025 19:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

OUTDATED -- Pull Request Overview

This PR enhances the versions command to:

  • Fallback to printing built-in release versions when no fab.yaml is found
  • Introduce a --live flag to fetch versions from a running Fabricator in-cluster
  • Update CI workflows to invoke bin/hhfab versions and remove the old Versions in cmdconfig.go

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pkg/hhfab/cmdversions.go New command implementation handling missing config and live fetch
pkg/hhfab/cmdconfig.go Remove deprecated Versions function
cmd/hhfab/main.go Add --live flag to the versions command
.github/workflows/ci.yaml Invoke bin/hhfab versions in multiple CI steps
Comments suppressed due to low confidence (2)

pkg/hhfab/cmdversions.go:96

  • Add unit tests for formatVersions and compareVersionMaps to verify correct YAML output in both override and no-override scenarios.
func formatVersions(releaseVersions, overriddenVersions fabapi.Versions) (string, error) {

pkg/hhfab/cmdversions.go:21

  • [nitpick] Add a Go doc comment for the exported Versions function explaining its parameters and behavior (missing config vs live cluster).
func Versions(ctx context.Context, workDir, cacheDir string, hMode HydrateMode, live bool) error {

@pau-hedgehog
Copy link
Contributor Author

pau-hedgehog commented Sep 19, 2025

@Frostman , I'm dropping the --live code as hhfab is not available for prod deployments and makes little sense when you can just query:

kubectl -n fab get fabricators default -o jsonpath='{.status.versions}' | jq

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Pau Capdevila <pau@githedgehog.com>
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Frostman Frostman merged commit 3b6ffba into master Oct 9, 2025
28 checks passed
@Frostman Frostman deleted the pau/hhfab_versions branch October 9, 2025 20:29
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.

2 participants