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

Add check version functionality #296

Merged
merged 2 commits into from
Jan 7, 2020
Merged

Conversation

bnkai
Copy link
Collaborator

@bnkai bnkai commented Dec 29, 2019

Adds initial support for new version checking. Mentioned also in #288
As it is now it uses the github api to get the shorthash commits from the repo tags.
It matches the current version ( v0.0.0-alpha or 'v0.0.0-alpha_dev' ) to the respective repo tags and gets the related commit hash from there.If it's different than the local that means that a new release build is available.
It first prints a message in the console when the app is started and you can see it also when you open the about tab from the settings.An extra button is also available for manual checking.

for dev testing the build , since version is added through TRAVIS you need to add it to the ldflags in the Makefile
-X 'github.com/stashapp/stash/pkg/api.version=v0.0.0-alpha_dev'
or
-X 'github.com/stashapp/stash/pkg/api.version=v0.0.0-alpha'

console

ui

@Leopere
Copy link
Collaborator

Leopere commented Dec 29, 2019

Eventually, I really would like to update automagically by default. Potentially allow people to disable the update mechanism via some command line launch argument or something not in the UI.

@WithoutPants
Copy link
Collaborator

Reviewed but not yet tested.

Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

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

Query and minor changes.

pkg/api/check_version.go Outdated Show resolved Hide resolved
pkg/api/check_version.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@WithoutPants
Copy link
Collaborator

Since we are getting the URL anyway, is there any reason we can't or shouldn't include a direct link to the latest download in the about page?

@bnkai
Copy link
Collaborator Author

bnkai commented Dec 30, 2019

Since we are getting the URL anyway, is there any reason we can't or shouldn't include a direct link to the latest download in the about page?

The API endpoint i am quering is this one tags.
It only has the versions and the URL of the zipfile , tarball source code no releases.
There is also the releases one that can be queried , it is more complex to parse though.
I'll have a look at it , switching to WIP till i settle this.

@bnkai bnkai changed the title Add check version functionality [W.I.P.] Add check version functionality Dec 30, 2019
@bnkai bnkai changed the title [W.I.P.] Add check version functionality [WIP] Add check version functionality Dec 30, 2019
@ueaslsef
Copy link
Contributor

The download path should be rather straight forward: https://github.com/stashapp/stash/releases/download/$version/stash-$platform. Maybe we could cheat and skip the releases-api parsing all together and just use this until we found a better way? It could even be a static string inserted by the ci on build time.

@bnkai
Copy link
Collaborator Author

bnkai commented Dec 30, 2019

@ueaslsef since we are doing it we might as well go all the way ..
The releases API has extra stuff also like times downloaded or date released. Do we want any of that ?

@bnkai bnkai changed the title [WIP] Add check version functionality Add check version functionality Dec 31, 2019
@bnkai
Copy link
Collaborator Author

bnkai commented Dec 31, 2019

squashed and rebased , also fixed a merge conflict due to latest commits.
this is the latest version with the proper release added as download link.
releases

@Leopere Leopere added the feature Pull requests that add a new feature label Jan 3, 2020
Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

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

Post-test review.

I'm thinking that the latest version section should only be shown if the version tag is set. As it is, when no version is set (ie local build), it shows an empty Latest Version Build Hash and a button that does basically nothing.

pkg/api/check_version.go Outdated Show resolved Hide resolved
ui/v2/src/components/Settings/SettingsAboutPanel.tsx Outdated Show resolved Hide resolved
pkg/api/check_version.go Outdated Show resolved Hide resolved
pkg/api/check_version.go Outdated Show resolved Hide resolved
ui/v2/src/components/Settings/SettingsAboutPanel.tsx Outdated Show resolved Hide resolved
ui/v2/src/components/Settings/SettingsAboutPanel.tsx Outdated Show resolved Hide resolved
ui/v2/src/components/Settings/SettingsAboutPanel.tsx Outdated Show resolved Hide resolved
 * add backend support
 * add ui support
 * minor fixes
 * workaround query refetch not working after network error
 * revert changes to Makefile after testing is complete
 * cosmetic fixes
 * switch to Releases Github API endpoint, add latest Release URL to UI
 * cosmetic fixes
 * latest version is only shown in UI when version is available and data is ready
 * cosmetic fix
 * resolve conflict , squash rebase
Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

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

Looks good.

@Leopere Leopere merged commit 87f0b66 into stashapp:develop Jan 7, 2020
ghost pushed a commit to InfiniteStash/stash that referenced this pull request Jan 23, 2020
ghost pushed a commit to InfiniteStash/stash that referenced this pull request Feb 2, 2020
@WithoutPants WithoutPants mentioned this pull request Feb 4, 2020
10 tasks
ghost pushed a commit to InfiniteStash/stash that referenced this pull request Feb 8, 2020
ghost pushed a commit to InfiniteStash/stash that referenced this pull request Mar 1, 2020
@bnkai bnkai deleted the check_version branch June 12, 2020 12:49
Tweeticoats pushed a commit to Tweeticoats/stash that referenced this pull request Feb 1, 2021
* Add check version functionality
 * add backend support
 * add ui support
 * minor fixes
 * cosmetic fixes
 * workaround query refetch not working after network error
 * revert changes to Makefile after testing is complete
 * switch to Releases Github API endpoint, add latest Release URL to UI
 * latest version is only shown in UI when version is available and data is ready
 * resolve conflict , squash rebase
Tweeticoats pushed a commit to Tweeticoats/stash that referenced this pull request Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull requests that add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants