Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change: Incompatible name format in latest release (Frodo CLI 1.0.0) affects binaries since v0.16.2-0 #266

Closed
brain-hol opened this issue Jul 3, 2023 · 5 comments · Fixed by #268
Assignees
Labels
bug Something isn't working

Comments

@brain-hol
Copy link

Frodo CLI version

# frodo -v
You seem to be running the binary package
Installed versions:
cli: v1.0.0
lib: v1.1.0
node: v18.5.0

Describe the issue

The latest version of Frodo CLI (1.0.0) was released with the name Frodo CLI 1.0.0 which does not adhere to the Semantic Versioning (SemVer) standard. This naming inconsistency breaks compatibility with all versions of Frodo CLI since v0.16.2-0 (specifically commit 648697e) that check for remote versions.

Here's the output of all commands since this breaking issue occurred:

# frodo
ERROR: exception running frodo - Error: Invalid argument not valid semver ('Frodo CLI 1.0.0' received)

Reason for Error

When running Frodo, the following line is executed to check the version being used against the remote version:

compareVersions(getCliVersion(), versionObject.github) == -1) ||

This line subsequently utilizes the compare-versions library to parse the SemVer and perform a comparison.

To fetch the latest version, frodo-cli (or more accurately, frodo-lib) makes a GET request to https://api.github.com/repos/rockcarver/frodo-cli/releases. It then filters the response to find only non-prerelease releases:

const r = data.find((rel) => rel.prerelease == false);

Running this request manually provides the list of non-prerelease versions that the endpoint returns:

"Frodo CLI 1.0.0"
"0.24.5"
"0.24.4"
"0.24.3"
"0.24.2"
"0.23.0"

As shown above, all previous non-prerelease versions were valid SemVer, but the latest release, Frodo CLI 1.0.0, deviates from the standard. Consequently, the compare-versions library throws an exception that frodo-cli fails to catch, resulting in a process crash.

To resolve this issue, the latest version should adhere to the SemVer standard, allowing for proper comparison and preventing errors in the frodo command execution.

@brain-hol brain-hol added the bug Something isn't working label Jul 3, 2023
@brain-hol brain-hol changed the title Breaking Change: Incompatible Name Format in Latest Release (Frodo CLI 1.0.0) affects Binaries since v0.16.2-0 Breaking change: Incompatible name format in latest release (Frodo CLI 1.0.0) affects binaries since v0.16.2-0 Jul 3, 2023
@hfranklin
Copy link
Contributor

@vscheuber it looks like the release names were changed in the pipeline on the last GitHub release and that is causing this issue. The question is if we should change the release naming back or if we should move to using the release tag rather than the release name. Do you have a preference?

@vscheuber
Copy link
Contributor

vscheuber commented Jul 3, 2023

@hfranklin Yeah, I just completed a fire-drill chasing down this issue. This appears to be unrelated to our pipeline changes (our release naming did not change, I validated that) but it appears that the name tag has changed format a few weeks ago (before we ever merged the pipeline changes) but since we didn't have a full binary release, we didn't notice until I pushed out the 1.0.0 release.

I have a full fix ready to go, which uses the tag_name instead of the name element of the github release document to determine the version. This seems a lot safer than the name, which might be muddied with more human readable text going forward.

@vscheuber vscheuber self-assigned this Jul 3, 2023
vscheuber added a commit to vscheuber/frodo-cli that referenced this issue Jul 3, 2023
@vscheuber vscheuber mentioned this issue Jul 3, 2023
@rjeghanathan
Copy link

rjeghanathan commented Jul 11, 2023

Anyone still facing the issue? I am on a macbook pro 16 intel and using homebrew to install frodo and get the below exception while running frodo:
ERROR: exception running frodo - Error: Invalid argument not valid semver ('Frodo CLI 1.0.1' received)
Error: Invalid argument not valid semver ('Frodo CLI 1.0.1' received)
at validateAndParse (/snapshot/frodo-cli-20230711-19907-f6y6t5/node_modules/compare-versions/lib/umd/index.js:126:19)
at compareVersions (/snapshot/frodo-cli-20230711-19907-f6y6t5/node_modules/compare-versions/lib/umd/index.js:17:20)
at getVersions (/snapshot/frodo-cli-20230711-19907-f6y6t5/cjs/utils/Version.js:122:91)
at process.runNextTicks [as _tickCallback] (node:internal/process/task_queues:60:5)
at Function.runMain (pkg/prelude/bootstrap.js:1980:13)
at node:internal/main/run_main_module:17:47
at async /snapshot/frodo-cli-20230711-19907-f6y6t5/cjs/app.js:34:61

@vscheuber
Copy link
Contributor

@rjeghanathan and others still seeing this issue, can you please follow these steps and let us know if they solve your issue:

rm ~/.frodo/Versions.json
brew unlink frodo-cli
brew untap rockcarver/frodo-cli
brew tap rockcarver/frodo-cli
brew install frodo-cli

@rjeghanathan
Copy link

thank you @vscheuber That helped with the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants