From 4471654a139b3771f578f8e40fdb45abcc5bebfc Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Tue, 19 May 2020 09:40:46 +1200 Subject: [PATCH] Filter and sort releases list, then show the latest ones for 7.x and 8.x --- _layouts/default.html | 80 +++++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 29 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index faf5855..e13da0f 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -41,7 +41,7 @@
- +

Cylc is a general purpose workflow engine that orchestrates cycling workflows very efficiently. It was designed for production weather, climate, and environmental @@ -146,7 +146,7 @@

Cylc Does Cycling Properly

Why Another Workflow Engine?

-

Production Ready: +

Production Ready: 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.

@@ -168,12 +168,12 @@

Why Another Workflow Engine?

resource and configurable internal constraints.

-->
-

Open Source: +

Open Source: Cylc is available on the GPLv3 license and is actively and openly developed on GitHub.


-

Distributed Architecture: +

Distributed Architecture: 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 @@

Why Another Workflow Engine?

doesn't even have to be running at the time.


-

Distributed Workflows: +

Distributed Workflows: Cylc easily manages task jobs on multiple remote hosts.


- -

Workflow Configuration: + +

Workflow Configuration: A human-readable config file, so modest workflows are easy to write, even for non-programmers. This is not "just a static config file" however: efficient programmatic @@ -209,7 +209,7 @@

Why Another Workflow Engine?

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.

+ host at maintenance time.


Powerful UIs: @@ -529,29 +529,51 @@

Why Another Workflow Engine?

} /** - * @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)) } }