Skip to content

Conversation

@MatteoPologruto
Copy link
Contributor

@MatteoPologruto MatteoPologruto commented Nov 4, 2025

Motivation

Users should know if a new version of the tool is available.

Change description

A message is printed if a new version of the tool is available when checking the current version:

$ ./build/arduino-flasher-cli version
Arduino Flasher CLI 0.0.0-d6bef23


A new release of Arduino Flasher CLI is available: 0.0.0-d6bef23 → 0.3.0
https://github.com/arduino/arduino-flasher-cli/releases/latest

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@MatteoPologruto MatteoPologruto self-assigned this Nov 4, 2025
@MatteoPologruto MatteoPologruto added the enhancement New feature or request label Nov 4, 2025
@MatteoPologruto MatteoPologruto marked this pull request as ready for review November 4, 2025 16:57
@MatteoPologruto MatteoPologruto linked an issue Nov 4, 2025 that may be closed by this pull request
@MatteoPologruto MatteoPologruto requested a review from a team November 4, 2025 16:57
Copy link
Contributor

@dido18 dido18 left a comment

Choose a reason for hiding this comment

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

I would display a notification about a new version being available before every command, not only when running the version command.

The update check should be non-blocking — if an error occurs during the check, a general warning should be shown without preventing the command from running.

Co-authored-by: Per Tillisch <accounts@perglass.com>
type: go
summary: Package yaml implements YAML support for the Go language.
homepage: https://pkg.go.dev/gopkg.in/yaml.v3
license: other
Copy link
Contributor

Choose a reason for hiding this comment

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

This is strange; the license isn't discovered, but the CI passes anyway. We should verify that everithing works as expected

"github.com/arduino/arduino-flasher-cli/updater"
)

type FlasherRelease struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

This struct can be moved inline in the function; It is not needed anywhere else.

Comment on lines +71 to +74
color.YellowString(i18n.Tr("A new release of Arduino Flasher CLI is available:")),
color.CyanString(currentVersion.String()),
color.CyanString(latestVersion.String()),
color.YellowString("https://www.arduino.cc/en/software/#flasher-tool"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Colored output is fancy, but I think we can omit it for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep them, but yeah, that stuff should be moved to the Cobra function

color.CyanString(currentVersion.String()),
color.CyanString(latestVersion.String()),
color.YellowString("https://www.arduino.cc/en/software/#flasher-tool"))
feedback.Print(msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the feedback print from here and move into the main.go logic.

latest, err := checkForUpdate(current semver.Version)
if err != nil{
   log.Warn(...)
}else{
   feedback.Print("A new release of Arduino Flasher CLI is available:"....)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

For warning, we should use feedback.Warn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check if a new version of the arduino-flasher-cli is available

4 participants