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

feat(GUI): add webview api version parameter #1558

Merged
merged 3 commits into from
Jul 4, 2017
Merged

Conversation

Shou
Copy link
Contributor

@Shou Shou commented Jun 28, 2017

We add the API version sent to the banner via a GET search parameter,
allowing for more intricate control over what data needs or can be sent.

Changelog-Entry: Add Webview API version parameter.

* @private
* @type {String}
*/
const API_VERSION_PARAM = 'api-version';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a big comment in the @description section stating that changing this will break compatibility with the HTML banner and therefore we should only change it if absolutely necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you could also explain that the HTML banner can use this version-number to determine which features the safe-webview supports (independent of the Etcher version-number).

(perhaps it's just me, but 'API' feels like the wrong term for this)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ping @Shou

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, you addressed it right below, sorry!

Copy link
Contributor

@lurch lurch left a comment

Choose a reason for hiding this comment

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

LGTM

* @private
* @type {String}
*/
const API_VERSION = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we start off at 2, and treat API_VERSION 1 as the version from before the api-version key was added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jviotti mentioned that we should just treat no given API_VERSION as such, which we can call the the "zeroth" API version I guess.

@@ -69,6 +85,7 @@ class SafeWebview extends react.PureComponent {

// We set the version GET parameter here.
url.searchParams.set(VERSION_PARAM, packageJSON.version);
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps the VERSION_PARAM constant should now be renamed to ETCHER_VERSION_PARAM ?
And I guess the comment above could be changed to // We set the version GET parameters here. ;)

* @private
* @type {String}
*/
const API_VERSION_PARAM = 'api-version';
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you could also explain that the HTML banner can use this version-number to determine which features the safe-webview supports (independent of the Etcher version-number).

(perhaps it's just me, but 'API' feels like the wrong term for this)

@Shou
Copy link
Contributor Author

Shou commented Jun 29, 2017

Once the tests pass we should be good to go.

@@ -46,6 +46,28 @@ const VERSION_PARAM = 'etcher-version';
const ELECTRON_SESSION = 'persist:success-banner';

/**
* @summary API version search parameter key
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit, but could we hyphenate this as search-parameter ? To stop people thinking that "version search" is a thing ;)
And could we update the @summary for ETCHER_VERSION_PARAM so that the two read similarly? (and given their similarity, perhaps ETCHER_VERSION_PARAM and API_VERSION_PARAM should be moved next to each other in the source-code?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@lurch
Copy link
Contributor

lurch commented Jun 29, 2017

Looks like the Travis builds have been broken by #1553 ?

@lurch
Copy link
Contributor

lurch commented Jun 30, 2017

@Shou Hopefully if you rebase this to master, the Travis tests should work now? :)

@Shou
Copy link
Contributor Author

Shou commented Jul 3, 2017

@lurch doesn't look that way, unfortunately.

@lurch
Copy link
Contributor

lurch commented Jul 3, 2017

The TravisCI logfiles (even in 'raw' mode) are still dying in a seemingly random place 😢
Ping @jhermsmeier Did you manage to get anywhere with this?

@jhermsmeier
Copy link
Contributor

jhermsmeier commented Jul 3, 2017

@lurch didn't get it last Friday, but have just kicked off https://travis-ci.org/resin-io/etcher/builds/249631499, with silenced output – which will hopefully get us some insight as to what's happening there

@lurch
Copy link
Contributor

lurch commented Jul 3, 2017

@Shou Could you try rebasing again? Looks like Jonas and Juanchi (the J-brothers?) have fixed it :)

Shou added 3 commits July 4, 2017 09:06
We add the API version sent to the banner via a GET search parameter,
allowing for more intricate control over what data needs or can be sent.

Changelog-Entry: Add Webview API version parameter.
@Shou
Copy link
Contributor Author

Shou commented Jul 4, 2017

Awesome, it's all pristine green now.

@jviotti jviotti merged commit b18fa1f into master Jul 4, 2017
@jviotti jviotti deleted the webview-api-version branch July 4, 2017 17:11
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.

4 participants