Skip to content

refactor: check for new version in upstream build only#1303

Merged
craicoverflow merged 3 commits intoredhat-developer:mainfrom
craicoverflow:download-source
Nov 9, 2021
Merged

refactor: check for new version in upstream build only#1303
craicoverflow merged 3 commits intoredhat-developer:mainfrom
craicoverflow:download-source

Conversation

@craicoverflow
Copy link
Copy Markdown
Contributor

@craicoverflow craicoverflow commented Nov 9, 2021

This is a stop-gap solution to #1290 by ensuring that version checking and printiing will only occur for the upstream CLI, when the BuildSource build variable is "github".

@wtrocki
Copy link
Copy Markdown
Collaborator

wtrocki commented Nov 9, 2021

That change gives nice context for what #1290 was needed.
Yes. Automatic updates should be github oriented for now as downstream will use package managers like brew for that purpose.

@wtrocki
Copy link
Copy Markdown
Collaborator

wtrocki commented Nov 9, 2021

Build it by default as dev. Build it as github and with some other random flag. It seems to work

if BuildSource != string(githubBuildSource) {
return
}
fmt.Println("Checking for a new version")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i18n?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had that in for testing, needs to go.

Comment on lines +84 to +87
// prefix version with a v to correspond with Git tag
if !strings.HasPrefix(version, "v") {
version = "v" + version
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Turns out version checks had not been working because of differences in Git tag and version.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Any way I can verify this locally?

It looks like good fix

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BUILD_SOURCE=github RHOAS_VERSION=0.30.0 make binary
rhoas version

@craicoverflow craicoverflow requested a review from wtrocki November 9, 2021 16:36
@wtrocki
Copy link
Copy Markdown
Collaborator

wtrocki commented Nov 9, 2021

All good!

@craicoverflow craicoverflow merged commit eb27c0f into redhat-developer:main Nov 9, 2021
@craicoverflow craicoverflow deleted the download-source branch November 9, 2021 17:13
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