#81 coreos: Add stable stream
Merged by codeblock. Opened by rfairley.
fedora-web/ rfairley/websites rfairley-add-stable-stream  into  master

Download 81.patch

Changes towards adding an option through a dropdown menu to select the stable stream and fetch the metadata accordingly, based on @abai's work in https://pagure.io/fedora-web/websites/pull-request/78.

WIP - testing that fetch failures are handled properly, and will try to split my first commit (2edb366) up to make review easier.

To fully make the downloads page ready for the stable release on Jan 14th, also need to update the description and title of the page.

@rfairley le us know once this moves out of WIP for review!

Just tried the commits locally, worked really well. Thanks for the help @rfairley !
The next step would be updating the description and title.
After this PR is merged, I can help with the styling of the page.

This should be good to go. Before when testing, trying to fetch with a nonexistent URL I found would result in rendering the title of each section with empty body (showing no images) e.g. Cloud Launchable, whereas I was expecting only the text Loading... to be rendered.

This may be the intended operation - I was going to try to verify this in the code, but I think as this is, it is acceptable. Switching to a URL where the metadata exists through the dropdown menu will reloads the page with the page with the correct images in the case where the metadata URL does exist.

Updated the title - this is good to merge from me.

Just needs to be rebased - working on this.

rebased onto 4a865acc2a318eeb27ce50302d35fc2544544eba

Now rebased, showing the aliyun artifacts as well.

Switched the default stream back to testing - we will switch the default to stable as a final step at the end of the release.

Page looks as follows: https://rfairley.fedorapeople.org/Screenshot_2020-01-13%20Get%20Fedora.png

(stream is switched to stable in the screenshot, but the default is testing).

This should be testing, right?

Is the gray background in the tab area expected?

@rfairley The Loading is not shown because the async call to fetch the metadata would return and loading will be set to false (https://pagure.io/fedora-web/websites/blob/master/f/sites/static/js/coreos-download.js#_196). Since this.streamData is {} instead of null, the render function will re-render the page with dropdowns and tabs.

Change https://pagure.io/fedora-web/websites/blob/master/f/sites/static/js/coreos-download.js#_197 to this.streamData = Object.entries(streamData).length === 0 && streamData.constructor === Object ? null : streamData; seems to fix the issue (i.e. make streamData remain null instead of updating it to empty object)

@jlebon The gray color comes from https://pagure.io/fedora-websites/issue/964#comment-576026. Originally we would want to move descriptions and tabs into the gray area with three streams: stable, testing, and next. Though for now I think it's good to make the background white to make it look cleaner and add more styles to the page when we have more streams..

EDIT: probably should remove the jumbotron in https://pagure.io/fedora-web/websites/pull-request/81#_2__205 so that the background is consistent

This should be testing, right?

Yes - that should be testing - thanks for catching.

7 new commits added

  • coreos: Remove jumbotron class from stream select area
  • coreos: fix returned streamData during refreshStream
  • coreos: Show last modified only if metadata loaded
  • coreos: Add 'stable' option in streams dropdown
  • coreos-download: add dropdown list for streams
  • coreos-download: use jumbotron instead of container for tabs
  • coreos-download: add icons and change style for buttons

7 new commits added

  • coreos: Remove jumbotron class from stream select area
  • coreos: fix returned streamData during refreshStream
  • coreos: Show last modified only if metadata loaded
  • coreos: Add 'stable' option in streams dropdown
  • coreos-download: add dropdown list for streams
  • coreos-download: use jumbotron instead of container for tabs
  • coreos-download: add icons and change style for buttons

@rfairley The Loading is not shown because the async call to fetch the metadata would return and loading will be set to false (https://pagure.io/fedora-web/websites/blob/master/f/sites/static/js/coreos-download.js#_196). Since this.streamData is {} instead of null, the render function will re-render the page with dropdowns and tabs.

Thank you for debugging this!

Change https://pagure.io/fedora-web/websites/blob/master/f/sites/static/js/coreos-download.js#_197 to this.streamData = Object.entries(streamData).length === 0 && streamData.constructor === Object ? null : streamData; seems to fix the issue (i.e. make streamData remain null instead of updating it to empty object)

Thanks, I've added this, and looks to work. I added a commit for this; added you as a co-author.

@jlebon The gray color comes from https://pagure.io/fedora-websites/issue/964#comment-576026. Originally we would want to move descriptions and tabs into the gray area with three streams: stable, testing, and next. Though for now I think it's good to make the background white to make it look cleaner and add more styles to the page when we have more streams..
EDIT: probably should remove the jumbotron in https://pagure.io/fedora-web/websites/pull-request/81#_2__205 so that the background is consistent

Removed the jumbrotron class from the dropdown area - now has matching color with the rest of the theme.

7 new commits added

  • coreos: remove jumbotron class from stream select area
  • coreos: fix returned streamData during refreshStream
  • coreos: show last modified only if metadata loaded
  • coreos: add 'stable' option in streams dropdown
  • coreos-download: add dropdown list for streams
  • coreos-download: use jumbotron instead of container for tabs
  • coreos-download: add icons and change style for buttons

Np! Thanks for the help :smile:
Tested locally, LGTM!

^ minor edit to make the commit messages have consistent lower case.

Page now renders like so:

https://rfairley.fedorapeople.org/Screenshot_2020-01-13%20Get%20Fedora(1).png
https://rfairley.fedorapeople.org/Screenshot_2020-01-13%20Get%20Fedora(2).png (switched to stable stream in the dropdown here)

Edit: the above URLs will need to be copy/pasted in, including the .png extension

This should be good to merge now.

Let's do the final edits (changing the page description / title) in a separate PR.

Pull-Request has been merged by codeblock

Metadata