-
Notifications
You must be signed in to change notification settings - Fork 9
Filter and sort releases list, then show the latest ones for 7.x and 8.x #47
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
<div class="container herounit"> | ||
|
||
<div class="flex flex--vertical content"> | ||
|
||
<p>Cylc is a <b>general purpose workflow engine</b> that <b>orchestrates | ||
cycling workflows very efficiently</b>. It was designed | ||
for production weather, climate, and environmental | ||
|
@@ -146,7 +146,7 @@ <h3 class="flex">Cylc Does Cycling Properly</h3> | |
|
||
<h3>Why Another Workflow Engine?</h3> | ||
|
||
<p><b>Production Ready:</b> | ||
<p><b>Production Ready:</b> | ||
Cylc is not just a research tool. It has been used 24/7 since 2010 | ||
for production weather forecasting - which is notorious for the size | ||
and complexity of its application workflows.</p> | ||
|
@@ -168,12 +168,12 @@ <h3>Why Another Workflow Engine?</h3> | |
resource and configurable internal constraints.</p>--> | ||
<br/> | ||
|
||
<p><b>Open Source:</b> | ||
<p><b>Open Source:</b> | ||
Cylc is available on the GPLv3 license and is actively and openly | ||
<a href="https://github.com/cylc">developed on GitHub</a>.</p> | ||
<br/> | ||
|
||
<p><b>Distributed Architecture:</b> | ||
<p><b>Distributed Architecture:</b> | ||
There are no central workflow or database servers to manage, so | ||
Cylc has low admin overhead and a small security footprint. Each | ||
workflow gets its own ad hoc server program, which runs as the | ||
|
@@ -185,11 +185,11 @@ <h3>Why Another Workflow Engine?</h3> | |
doesn't even have to be running at the time.</p> | ||
<br/> | ||
|
||
<p><b>Distributed Workflows:</b> | ||
<p><b>Distributed Workflows:</b> | ||
Cylc easily manages task jobs on multiple remote hosts.</p> | ||
<br/> | ||
<p><b>Workflow Configuration:</b> | ||
|
||
<p><b>Workflow Configuration:</b> | ||
A human-readable config file, so modest workflows are easy to | ||
write, even for non-programmers. This is <b>not</b> <i>"just a | ||
static config file"</i> however: efficient programmatic | ||
|
@@ -209,7 +209,7 @@ <h3>Why Another Workflow Engine?</h3> | |
Cylc is built to transparently use a pool of host VMs, with | ||
load balancing at start-up, and it scales arbitrarily well with the | ||
number of host VMs. Running workflows can self-migrate to another | ||
host at maintenance time. </p> | ||
host at maintenance time. </p> | ||
<br/> | ||
|
||
<p><b>Powerful UIs:</b> | ||
|
@@ -529,29 +529,51 @@ <h3>Why Another Workflow Engine?</h3> | |
} | ||
|
||
/** | ||
* @param {Array} releases - The list of releases. | ||
* @param release {{ | ||
* name: String, | ||
* published_at: String, | ||
* tag_name: String | ||
* }} | ||
* @return {string} - Release date formatted as M/D/Y (e.g. 5/14/2020). | ||
*/ | ||
function getReleaseDate (release) { | ||
return new Date(release.published_at).toLocaleString().split(',')[0] | ||
} | ||
|
||
/** | ||
* @param {[ | ||
* { | ||
* name: String, | ||
* published_at: String, | ||
* tag_name: String | ||
* } | ||
* ]} releases - The list of releases. | ||
*/ | ||
function showReleases(releases) { | ||
// we only want to iterate over 15 releases... | ||
const min = Math.min(releases.length, 15); | ||
let foundCylc8Latest = false; | ||
let foundCylc7Latest = false; | ||
for (let i = 0; i < min; ++i) { | ||
const release = releases[i]; | ||
const name = release.name; | ||
const publishedAt = new Date(release.published_at).toLocaleString().split(',')[0]; | ||
const link = TAGS_URL + release.tag_name; | ||
// display latest release metadata | ||
if (name.startsWith("cylc-7.9")) { | ||
populateLatestReleaseInformation("cylc7", name, link, publishedAt); | ||
foundCylc7Latest = true; | ||
} else if (name.startsWith("cylc-flow-8")) { | ||
populateLatestReleaseInformation("cylc8", name, link, publishedAt); | ||
foundCylc8Latest = true; | ||
} | ||
if (foundCylc7Latest === true && foundCylc8Latest === true) { | ||
break; | ||
} | ||
// show latest Cylc 7 release | ||
const latestCylc7 = releases | ||
.filter(release => release.name.startsWith("cylc-7.9")) | ||
.sort((left, right) => new Date(left.published_at) - new Date(right.published_at)) | ||
.pop() | ||
if (latestCylc7) { | ||
populateLatestReleaseInformation( | ||
"cylc7", | ||
latestCylc7.name, | ||
`${TAGS_URL}${latestCylc7.tag_name}`, | ||
getReleaseDate(latestCylc7)) | ||
} | ||
|
||
// show latest Cylc 8 release | ||
const latestCylc8 = releases | ||
.filter(release => release.name.startsWith("cylc-flow-8")) | ||
.sort((left, right) => new Date(left.published_at) - new Date(right.published_at)) | ||
.pop() | ||
if (latestCylc8) { | ||
populateLatestReleaseInformation( | ||
"cylc8", | ||
latestCylc8.name, | ||
`${TAGS_URL}${latestCylc8.tag_name}`, | ||
getReleaseDate(latestCylc8)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Iterating arrays is cheap, so we just iterate twice, filtering by the release name, sorting by date asc, and getting the last item with If not undefined, then we use the old code to populate the HTML elements in the UI. |
||
} | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Changes above were added automatically by the IDE, but I thought it was OK. Removing extra spaces.