From 11e7a388233d19cc5b5fab921bfdd2bf37ca09cc Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 11 Oct 2022 11:39:33 -0400 Subject: [PATCH] Release 6.1.11 (#6397) * Release 6.1.11 Signed-off-by: Sebastian Malton * Add release guide (#6374) Signed-off-by: Sebastian Malton Signed-off-by: Sebastian Malton * Fix crash when opening pod details (#6376) Signed-off-by: Sebastian Malton Signed-off-by: Sebastian Malton * Fix ReactiveDuration to update as frequently as necessary (#6375) - When used in non compact mode (eg KubeObjectMeta's age) the seconds can be displayed but previously between 10m and 180m of age, the display would only update every minute Signed-off-by: Sebastian Malton Signed-off-by: Sebastian Malton Signed-off-by: Sebastian Malton --- RELEASE_GUIDE.md | 19 ++++++++++++++++ package.json | 2 +- .../components/duration/reactive-duration.tsx | 22 ++++++++++++++----- .../kube-object-meta/kube-object-meta.tsx | 8 +------ src/renderer/components/menu/menu.tsx | 18 +++++++-------- 5 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 RELEASE_GUIDE.md diff --git a/RELEASE_GUIDE.md b/RELEASE_GUIDE.md new file mode 100644 index 0000000000..559385f025 --- /dev/null +++ b/RELEASE_GUIDE.md @@ -0,0 +1,19 @@ +# Release Guide + +Releases for this repository are made via running the `create-release-pr` script defined in the `package.json`. +All releases will be made by creating a PR which bumps the version field in the `package.json` and, if necessary, cherry pick the relavent commits from master. + +## Prerequisites + +- `yarn` +- Running `yarn` (to install all dependencies) +- `gh` (Github's CLI) with a version at least 2.15.0 + +## Steps + +1. If you are making a minor or major release (or prereleases for one) make sure you are on the `master` branch. +1. If you are making a patch release (or a prerelease for one) make sure you are on the `release/v.` branch. +1. Run `yarn create-release-pr `. If you are making a subsequent prerelease release, provide the `--check-commits` flag. +1. If you are checking the commits, type `y` to pick a commit, and `n` to skip it. You will want to skip the commits that were part of previous prerelease releases. +1. Once the PR is created, approved, and then merged the `Release Open Lens` workflow will create a tag and release for you. +1. If you are making a major or minor release, create a `release/v.` branch and push it to `origin` so that future patch releases can be made from it. diff --git a/package.json b/package.json index 43ba076e91..bea1f97e0b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "OpenLens", "description": "OpenLens - Open Source IDE for Kubernetes", "homepage": "https://github.com/lensapp/lens", - "version": "6.1.10", + "version": "6.1.11", "main": "static/build/main.js", "copyright": "© 2022 OpenLens Authors", "license": "MIT", diff --git a/src/renderer/components/duration/reactive-duration.tsx b/src/renderer/components/duration/reactive-duration.tsx index ce38b82509..42a6b0949b 100644 --- a/src/renderer/components/duration/reactive-duration.tsx +++ b/src/renderer/components/duration/reactive-duration.tsx @@ -18,19 +18,29 @@ export interface ReactiveDurationProps { compact?: boolean; } +const everySecond = 1000; +const everyMinute = 60 * 1000; + /** - * This function computes a resonable update + * This function computes a resonable update interval, matching `formatDuration`'s rules on when to display seconds */ -function computeUpdateInterval(creationTimestampEpoch: number): number { +function computeUpdateInterval(creationTimestampEpoch: number, compact: boolean): number { const seconds = Math.floor((Date.now() - creationTimestampEpoch) / 1000); const minutes = Math.floor(seconds / 60); if (minutes < 10) { - // Update every second - return 1000; + return everySecond; } - return 60 * 1000; + if (compact) { + return everyMinute; + } + + if (minutes < (60 * 3)) { + return everySecond; + } + + return everyMinute; } export const ReactiveDuration = observer(({ timestamp, compact = true }: ReactiveDurationProps) => { @@ -42,7 +52,7 @@ export const ReactiveDuration = observer(({ timestamp, compact = true }: Reactiv return ( <> - {formatDuration(reactiveNow(computeUpdateInterval(timestampSeconds)) - timestampSeconds, compact)} + {formatDuration(reactiveNow(computeUpdateInterval(timestampSeconds, compact)) - timestampSeconds, compact)} ); }); diff --git a/src/renderer/components/kube-object-meta/kube-object-meta.tsx b/src/renderer/components/kube-object-meta/kube-object-meta.tsx index 20852d95ba..f339877eb2 100644 --- a/src/renderer/components/kube-object-meta/kube-object-meta.tsx +++ b/src/renderer/components/kube-object-meta/kube-object-meta.tsx @@ -62,13 +62,7 @@ const NonInjectedKubeObjectMeta = observer(({