-
-
Notifications
You must be signed in to change notification settings - Fork 437
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 different release channels for autoupdater #2362
Conversation
Just a thought to go with;
|
updateNotificationCheckBox.setText(tr("Notify when new client features are available")); | ||
clearDownloadedPicsButton.setText(tr("Reset/clear downloaded pictures")); | ||
updateReleaseChannelLabel.setText(tr("Update channel")); | ||
updateNotificationCheckBox.setText(tr("Notify when a new version is available")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any logic for automatic update checks yet?! First time I hear about that. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really; it still works that when you connect to a server and it tells you that you are missing some feature, we suppose that probably a new version supporting that feature is out.
I't just that imho the old text, even if formally correct, made no sense at all to an average user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the wording is still misleading...
Maybe add a "on connect" and rephrase a bit?
"On connect, notify everytime a feature supported by the server is missing in my client"
or "repeatedly" instead everytime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to change the sentence, but it's so long that it forces the settings window to be wider. So the candidates are:
# original wording
Notify when new client features are available
# short, misleading wording
Notify when a new version is available
# Precise but too long wording
On connect, notify everytime a feature supported by the server is missing in my client
# Other attempts
Notify if a feature supported by the server is missing in my client
Notify if the server reports that a feature is missing in my client
Others?
EDIT: i found out a way to make the sentence can take up more space in the window without affecting its size, so even the longer version is viable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notify if a feature supported by the server is missing in my client
I really like this one but I don't have strong feelings - use your judgement
Can you show a picture, please? I want to throw in #2359 again. |
That could work, unless if the user want to switch back from a development version to a stable version; just checking for HEAD != version string could be a simple workaround.
Please, let me fix this once before we break it again ;) |
I like the option with the dev/release channels; Looks good. If you're on a dev channel, will it allow you to go back to release and download the latest release with a notification or will you have to hit "download anyway?" Having a JSON file tell which is the releases could be done, and we can host it on the /latest/release portion of the client as an uploaded file (github.com/cockatrice/cockatrice/releases/latest) |
I don't think we need to do a manual releases file, we should be able to
get the information from the releases page on github, or via the releases
api.
…On Mon, Jan 16, 2017 at 4:04 PM Zach H ***@***.***> wrote:
I like the option with the dev/release channels; Looks good. If you're on
a dev channel, will it allow you to go back to release and download the
latest release with a notification or will you have to hit "download
anyway?"
Having a JSON file tell which is the releases could be done, and we can
host it on the /latest/release portion of the client as an uploaded file (
github.com/cockatrice/cockatrice/releases/latest)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2362 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA5NH3A1Rbse3N9q-T1T7i-pJM63wXxks5rS9togaJpZM4Lj7ek>
.
|
How can we link the release information from github to the downloadable files from bintray? |
We could use a git tag with a specific structure. We talked about using
semver in another ticket, if we put that info into the git tags it would be
enough to determine new releases.
…On Wed, Jan 18, 2017 at 10:33 AM ctrlaltca ***@***.***> wrote:
I don't think we need to do a manual releases file, we should be able to
get the information from the releases page on github, or via the releases
api.
How can we link the release information from github to the downloadable
files from bintray?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2362 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA5NGYrhW5Z3BRUAivhtwaTZ-o_i0Iwks5rTjDVgaJpZM4Lj7ek>
.
|
Regarding the release notes there is a |
Compiled and tinkered a bit. Any chance you could throw some info in the debug log when the update gets checked with some type of usable info? Like maybe current version, versions found and results? Something like that. |
So, for stable releases:
For development releases:
Is this what you mean? If we want to take this route i'll start working on it
Probably someone copypasted them manually. Bintray can be configured to fetch data from github, but imho we'd better redirect people on github, since all the informations are already here.
Sure, i will add some debug! |
Yes, that's exactly what I mean |
Link within the Edit: It would be better to have (additionally) a beta and/or release candidate channel, which both make way more sense to the users and the project in general. |
Any word on what we should do with this @Daenyth ? |
I'm still (slowly) working on implementing the changes |
Still work in progress, but updates for the development version are now implemented as discussed in #2362 (comment) |
757863e
to
fc5a028
Compare
Both updates for the stable channel and the development channel have been implemented, and debug messages added as requested. This can be tested by reviewers. On the stable channel it always download the last stable release available on bintray, since there's no way to actually link these files to the release on github, since both the release and the files are created manually; you may think of naming it the same and use this as a link, but this is fragile and a big con is the fact that on bintray the release can't be modified after the creation. We would risk to end up with the same problem of the last 2 releases where a not-matching date broke the update procedure. |
Tinkered around some more. Curious about something. When running the most recent commit level with this PR rolled in and using the stable release option I have a popup that shows an update is available and lists the current stable release version that has been published. Is this by design? What I mean by this is since I am running a newer client than what is available in the stable version are we expecting the client to say "hey there is a more recent stable version than what your running (since your not running a stable release)" or are we wanting it to say "hey this client is newer than the stable release available, do you want to install the stable release?" Just want to make sure 1, the logic isnt actually failing to identify the correct versions and not informing people of updates when there is none and 2, expected behavior. |
This PR is not using the "release date" to compare the current running version with the last version available for download, since we can't really control that information on bintray. This was the problem that caused the "update loop" in the two last releases. |
@ctrlaltca What's the status of this at the moment? Are you waiting for code review, waiting for manual testing, or still making changes? I'd love to help push this through so if it's code review let me know and I'll get to it as I have time |
@Daenyth Waiting for review/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have minor feedback points - once they are addressed and this is tested manually please go ahead and merge unless you think you need more specific feedback from me.
publishDate = release->getPublishDate().toString(Qt::DefaultLocaleLongDate); | ||
|
||
QMessageBox::StandardButton reply; | ||
reply = QMessageBox::question(this, "Update Available", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this is mixing UI and business logic together. An alternate approach might be to have the release updater not use any UI components but instead provide a function of UpdateCheckResult checkForUpdates()
where UpdateCheckResult
can be a tagged union with success+download_url, success-but-no-url-for-your-OS, you-are-up-to-date, or error-updating+the_error.
Does that make sense?
That would allow us to unit test in isolation from the UI.
Anyway I'm not going to block the PR on that change, but I'd like to hear your thoughts on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it seems like tagged unions are a goddamn PITA in cpp: http://en.cppreference.com/w/cpp/language/union
Thoughts on rust? I do have some docs on incorporating rust into a cpp app. I'd be perfectly willing to start extracting all the core bits to safer rust libraries and leave the Qt parts for just UI calling functions exposed from rust FFI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The business logic is mostly implemented in releasechannel.cpp, but these last checks ust be made in the UI since it's good to have the QMessageBox instanciated with a valid parent widget.
basically we are calling settingsCache->getUpdateReleaseChannel()->checkForUpdates();
to start the check for updates and then waiting on the DlgUpdate::finishedUpdateCheck()
slot for the result. It must be an async call anyway since the network is involved, so we cant just call a method and get the result directly.
cockatrice/src/releasechannel.cpp
Outdated
#define DEVMANUALDOWNLOAD_URL "https://bintray.com/cockatrice/Cockatrice/Cockatrice-git/_latestVersion#files" | ||
#define GIT_SHORT_HASH_LEN 7 | ||
|
||
ReleaseChannel::ReleaseChannel(int _index, QString _name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the last 2 fields may want to be an UpdateResponse type object instead of the checker class itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved them inside the Release channels in the last update.
cockatrice/src/releasechannel.cpp
Outdated
|
||
if(!(resultMap.contains("object") && | ||
resultMap["object"].toMap().contains("sha"))) { | ||
qDebug() << "Invalid received from the tag update server"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it easy to include the contents of resultMap
here? Might help. Also probably should be qWarning
at least
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
cockatrice/src/releasechannel.cpp
Outdated
void DevReleaseChannel::checkForUpdates() | ||
{ | ||
qDebug() << "Searching for updates on the dev channel: " << DEVRELEASE_URL; | ||
response = netMan->get(QNetworkRequest(QString(DEVRELEASE_URL))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is almost identical to the other class - it seems like url and log message are the only difference. Might be good to make it a method of the base interface they both extend and take the urls as parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Done
cockatrice/src/releasechannel.cpp
Outdated
QString tmp = QString(reply->readAll()); | ||
reply->deleteLater(); | ||
|
||
// Errors are incapsulated in an object, check for them first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encapsulated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the comment altogether, it was a leftover from a copypaste
cockatrice/src/settingscache.cpp
Outdated
@@ -162,7 +164,16 @@ SettingsCache::SettingsCache() | |||
if(!QFile(settingsPath+"global.ini").exists()) | |||
translateLegacySettings(); | |||
|
|||
// updates | |||
dummy = QT_TRANSLATE_NOOP("i18n", "Stable releases"); | |||
dummy = QT_TRANSLATE_NOOP("i18n", "Development snapshots"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's that do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was used to force qt's l'update to find and extract these translatable strings.
I moved the strings inside the *ReleaseChannel classes and removed this trick.
@@ -23,7 +23,9 @@ SET(oracle_SOURCES | |||
../cockatrice/src/settings/layoutssettings.cpp | |||
../cockatrice/src/thememanager.cpp | |||
../cockatrice/src/qt-json/json.cpp | |||
) | |||
../cockatrice/src/releasechannel.cpp | |||
${VERSION_STRING_CPP} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version cpp wasn't here already? How silly. We should probably make cockatrice's about menu reusable and call the same code from cockatrice and oracle. Not in this pr though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not included in oracle yet; now it's a dependency since oracle uses cockatrice's settingscache.
cockatrice/src/dlg_update.cpp
Outdated
tr("Cockatrice was not built with SSL support, so cannot download updates! " | ||
"Please visit the download page and update manually.")); | ||
QMessageBox::critical(this, tr("Error"), | ||
tr("Cockatrice was not built with SSL support, so cannot download updates! " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Cockatrice was not build with SSL support, so you cannot download updates automatically! Please visit the download page to update manually."
foreach(QVariant file, resultList) | ||
{ | ||
QVariantMap map = file.toMap(); | ||
// TODO: map github version to bintray version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any word on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explained in the 2nd paragraph of #2362 (comment)
Unfortunately i've not found a "perfect solution" yet, even though it's working anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good for now, if we have to change uploads what will we do though? Have to publish a new revision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Publish a new revision to make cockatrice "find" the update.
Then, it will always download the "latest" stable release available on bintray.
cockatrice/src/releasechannel.h
Outdated
~ReleaseChannel(); | ||
protected: | ||
int index; | ||
QString name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After my review, as long as the small nitty gritty stuff is fixed up, I'm good to see this go in. Glad to finally have something like this after all the years :)
Builds seem to be failing @ctrlaltca |
Seems likely to be aws-related given that it's a connection error |
AWS has been facing a lot of issues today, most notably S3 being nearly fully out of operation for a few hours. That said, the error seems to be with a failing |
Fetch releases from github and find corresponding installers on bintray
I've squashed down commits and pushed to the PR to force the builds to run again. |
I'll be looking into publishing a release on ~ March 14th (Pi Day :D) |
Looks like the travis-ci build didn't trigger.. anyway it worked on the very same commit for my branch: https://travis-ci.org/ctrlaltca/Cockatrice/builds/206512853 |
Fix #1784
This is an initial implementation of #2321.
Currently two release channels are implemented: "stable releases" and "development snapshot", respectively pointing to our stable releases and git builds on bintray.
Users can choose their preferred release channel from the settings:
![schermata 2017-01-15 alle 15 20 20](https://cloud.githubusercontent.com/assets/1631111/21963189/3e1869be-db36-11e6-94a7-07e69f86b6a2.png)
Their choice is reflected in the update dialog:
![schermata 2017-01-15 alle 15 20 38](https://cloud.githubusercontent.com/assets/1631111/21963190/3e3138a4-db36-11e6-8ac1-86161bec17f8.png)
Also, remove the wrong commit hash from update dialog and show version name instead (fix #2247);
Still to be fixed / reworked, but maybe in another PR: don't use release date to determine if a newer version is available (aka avoid #2338)