1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Release 6.4.0-beta.17 (#7237)

* Various improvements to release-tool (#7232)

* Various improvements to release-tool

- Pass more IO from script to user to provide better UX
- Interactive versioning using lerna directly
- Remove all CMD args in favour of interactive

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Remove some more unnecessary console logs

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Resolve comments

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix repoRoot issue

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* De-spagetti-ify release-tool

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix bugs related to picking PRs

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix name

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Improve display after picking PRs

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Rename pickWhichPRsToUse

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Add line describing what to do

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix not displaying output after cherry-pick fails

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Roman <ixrock@gmail.com>
Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix ApiManager not handling duplicate apiBases of KubeApis (#7235)

* Add failing unit test

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix failing unit test

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Allow extensions to opt-out of KubeApi auto registering (#7217)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Remove all references to slack (#7233)

* Remove all references to slack

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix readme

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Cleanup migration

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Remove existing slack link from weblink store

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix type error and wording on ErrorBoundary

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Don't export forumsUrl to extension API

- Also just remove slack URL

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Update snapshots again

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Update snapshots again v3

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Revert remove slackUrl

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix filtering

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix readme

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* More of a fix

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Try again

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Slightly better for now

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* "Release 6.4.0-beta.17"

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Roman <ixrock@gmail.com>
This commit is contained in:
Sebastian Malton 2023-02-24 14:45:17 -08:00 committed by GitHub
parent 9959d6d4db
commit b74cc14b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 500 additions and 423 deletions

View File

@ -1,7 +1,7 @@
# Lens Desktop Core ("OpenLens") # Lens Desktop Core ("OpenLens")
[![Build Status](https://github.com/lensapp/lens/actions/workflows/test.yml/badge.svg)](https://github.com/lensapp/lens/actions/workflows/test.yml) [![Build Status](https://github.com/lensapp/lens/actions/workflows/test.yml/badge.svg)](https://github.com/lensapp/lens/actions/workflows/test.yml)
[![Chat on Slack](https://img.shields.io/badge/chat-on%20slack-blue.svg?logo=slack&longCache=true&style=flat)](https://k8slens.dev/slack.html) <img src="https://upload.wikimedia.org/wikipedia/commons/1/17/Discourse_icon.svg" width=25>[Explore our Forums](https://forums.k8slens.dev)
## The Repository ## The Repository

View File

@ -7,15 +7,15 @@ To install your first extension you should goto the [extension page](lens://app/
This documentation describes: This documentation describes:
* How to build, run, test, and publish an extension. - How to build, run, test, and publish an extension.
* How to take full advantage of the Lens Extension API. - How to take full advantage of the Lens Extension API.
* Where to find [guides](extensions/guides/README.md) and [code samples](https://github.com/lensapp/lens-extension-samples) to help get you started. - Where to find [guides](extensions/guides/README.md) and [code samples](https://github.com/lensapp/lens-extension-samples) to help get you started.
## What Extensions Can Do ## What Extensions Can Do
Here are some examples of what you can achieve with the Extension API: Here are some examples of what you can achieve with the Extension API:
* Add custom components & views in the UI - Extending the Lens Workbench - Add custom components & views in the UI - Extending the Lens Workbench
For an overview of the Lens Extension API, refer to the [Common Capabilities](extensions/capabilities/common-capabilities.md) page. [Extension Guides Overview](extensions/guides/README.md) also includes a list of code samples and guides that illustrate various ways of using the Lens Extension API. For an overview of the Lens Extension API, refer to the [Common Capabilities](extensions/capabilities/common-capabilities.md) page. [Extension Guides Overview](extensions/guides/README.md) also includes a list of code samples and guides that illustrate various ways of using the Lens Extension API.
@ -23,11 +23,11 @@ For an overview of the Lens Extension API, refer to the [Common Capabilities](ex
Here is what each section of the Lens Extension API docs can help you with: Here is what each section of the Lens Extension API docs can help you with:
* **Getting Started** teaches fundamental concepts for building extensions with the Hello World sample. - **Getting Started** teaches fundamental concepts for building extensions with the Hello World sample.
* **Extension Capabilities** dissects Lens's Extension API into smaller categories and points you to more detailed topics. - **Extension Capabilities** dissects Lens's Extension API into smaller categories and points you to more detailed topics.
* **Extension Guides** includes guides and code samples that explain specific usages of Lens Extension API. - **Extension Guides** includes guides and code samples that explain specific usages of Lens Extension API.
* **Testing and Publishing** includes in-depth guides on various extension development topics, such as testing and publishing extensions. - **Testing and Publishing** includes in-depth guides on various extension development topics, such as testing and publishing extensions.
* **API Reference** contains exhaustive references for the Lens Extension API, Contribution Points, and many other topics. - **API Reference** contains exhaustive references for the Lens Extension API, Contribution Points, and many other topics.
## What's New ## What's New
@ -45,7 +45,7 @@ See the [Lens v4 to v5 extension migration notes](extensions/extension-migration
## Looking for Help ## Looking for Help
If you have questions for extension development, try asking on the [Lens Dev Slack](http://k8slens.slack.com/). It's a public chatroom for Lens developers, where Lens team members chime in from time to time. If you have questions for extension development, try asking on the [Lens Forums](http://forums.k8slens.dev/). It's a public chatroom for Lens developers, where Lens team members chime in from time to time.
To provide feedback on the documentation or issues with the Lens Extension API, create new issues at [lensapp/lens](https://github.com/lensapp/lens/issues). Please use the labels `area/documentation` and/or `area/extension`. To provide feedback on the documentation or issues with the Lens Extension API, create new issues at [lensapp/lens](https://github.com/lensapp/lens/issues). Please use the labels `area/documentation` and/or `area/extension`.

View File

@ -4,7 +4,7 @@
"packages": [ "packages": [
"packages/*" "packages/*"
], ],
"version": "6.4.0-beta.16", "version": "6.4.0-beta.17",
"npmClient": "yarn", "npmClient": "yarn",
"npmClientArgs": [ "npmClientArgs": [
"--network-timeout=100000" "--network-timeout=100000"

View File

@ -34,9 +34,9 @@ nav:
- Publishing Extensions: extensions/testing-and-publishing/publishing.md - Publishing Extensions: extensions/testing-and-publishing/publishing.md
- API Reference: extensions/api/README.md - API Reference: extensions/api/README.md
theme: theme:
name: 'material' name: "material"
highlightjs: true highlightjs: true
language: 'en' language: "en"
custom_dir: docs/custom_theme custom_dir: docs/custom_theme
favicon: img/favicon.ico favicon: img/favicon.ico
logo: img/lens-logo-icon.svg logo: img/lens-logo-icon.svg
@ -79,9 +79,9 @@ extra:
- icon: fontawesome/brands/twitter - icon: fontawesome/brands/twitter
link: https://twitter.com/k8slens link: https://twitter.com/k8slens
name: Lens on Twitter name: Lens on Twitter
- icon: fontawesome/brands/slack - icon: fontawesome/brands/discourse
link: http://k8slens.slack.com/ link: https://forums.k8slens.dev/
name: Lens on Slack name: Lens Forums
- icon: fontawesome/solid/link - icon: fontawesome/solid/link
link: https://k8slens.dev/ link: https://k8slens.dev/
name: Lens Website name: Lens Website

View File

@ -3,7 +3,7 @@
"productName": "", "productName": "",
"description": "Lens Desktop Core", "description": "Lens Desktop Core",
"homepage": "https://github.com/lensapp/lens", "homepage": "https://github.com/lensapp/lens",
"version": "6.4.0-beta.16", "version": "6.4.0-beta.17",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/lensapp/lens.git" "url": "git+https://github.com/lensapp/lens.git"

View File

@ -19,6 +19,9 @@ import { KubeObject } from "../kube-object";
import { KubeObjectStore } from "../kube-object.store"; import { KubeObjectStore } from "../kube-object.store";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable"; import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
// eslint-disable-next-line no-restricted-imports
import { KubeApi as ExternalKubeApi } from "../../../extensions/common-api/k8s-api";
class TestApi extends KubeApi<KubeObject> { class TestApi extends KubeApi<KubeObject> {
protected async checkPreferredVersion() { protected async checkPreferredVersion() {
return; return;
@ -54,7 +57,7 @@ describe("ApiManager", () => {
}); });
describe("registerApi", () => { describe("registerApi", () => {
it("re-register store if apiBase changed", async () => { it("re-register store if apiBase changed", () => {
const apiBase = "apis/v1/foo"; const apiBase = "apis/v1/foo";
const fallbackApiBase = "/apis/extensions/v1beta1/foo"; const fallbackApiBase = "/apis/extensions/v1beta1/foo";
const kubeApi = new TestApi({ const kubeApi = new TestApi({
@ -72,21 +75,48 @@ describe("ApiManager", () => {
logger: di.inject(loggerInjectable), logger: di.inject(loggerInjectable),
}, kubeApi); }, kubeApi);
apiManager.registerApi(apiBase, kubeApi); apiManager.registerApi(kubeApi);
// Define to use test api for ingress store // Define to use test api for ingress store
Object.defineProperty(kubeStore, "api", { value: kubeApi }); Object.defineProperty(kubeStore, "api", { value: kubeApi });
apiManager.registerStore(kubeStore, [kubeApi]); apiManager.registerStore(kubeStore);
// Test that store is returned with original apiBase // Test that store is returned with original apiBase
expect(apiManager.getStore(kubeApi)).toBe(kubeStore); expect(apiManager.getStore(kubeApi)).toBe(kubeStore);
// Change apiBase similar as checkPreferredVersion does // Change apiBase similar as checkPreferredVersion does
Object.defineProperty(kubeApi, "apiBase", { value: fallbackApiBase }); Object.defineProperty(kubeApi, "apiBase", { value: fallbackApiBase });
apiManager.registerApi(fallbackApiBase, kubeApi); apiManager.registerApi(kubeApi);
// Test that store is returned with new apiBase // Test that store is returned with new apiBase
expect(apiManager.getStore(kubeApi)).toBe(kubeStore); expect(apiManager.getStore(kubeApi)).toBe(kubeStore);
}); });
}); });
describe("technical tests for autorun", () => {
it("given two extensions register apis with the same apibase, settle into using the second", () => {
const apiBase = "/apis/aquasecurity.github.io/v1alpha1/vulnerabilityreports";
const firstApi = Object.assign(new ExternalKubeApi({
objectConstructor: KubeObject,
apiBase,
kind: "VulnerabilityReport",
}), {
myField: 1,
});
const secondApi = Object.assign(new ExternalKubeApi({
objectConstructor: KubeObject,
apiBase,
kind: "VulnerabilityReport",
}), {
myField: 2,
});
void firstApi;
void secondApi;
expect(apiManager.getApi(apiBase)).toMatchObject({
myField: 2,
});
});
});
}); });

View File

@ -41,19 +41,22 @@ export class ApiManager {
const apis = chain(this.dependencies.apis.get().values()) const apis = chain(this.dependencies.apis.get().values())
.concat(this.externalApis.values()); .concat(this.externalApis.values());
const removedApis = new Set(this.apis.values()); const removedApis = new Set(this.apis.values());
const newState = new Map(this.apis);
for (const api of apis) { for (const api of apis) {
removedApis.delete(api); removedApis.delete(api);
this.apis.set(api.apiBase, api); newState.set(api.apiBase, api);
} }
for (const api of removedApis) { for (const api of removedApis) {
for (const [apiBase, storedApi] of this.apis) { for (const [apiBase, storedApi] of newState) {
if (storedApi === api) { if (storedApi === api) {
this.apis.delete(apiBase); newState.delete(apiBase);
} }
} }
} }
this.apis.replace(newState);
}); });
} }

View File

@ -18,6 +18,6 @@ export const apiKubePrefix = "/api-kube"; // k8s cluster apis
// Links // Links
export const issuesTrackerUrl = "https://github.com/lensapp/lens/issues" as string; export const issuesTrackerUrl = "https://github.com/lensapp/lens/issues" as string;
export const slackUrl = "https://k8slens.dev/slack.html" as string;
export const supportUrl = "https://docs.k8slens.dev/support/" as string; export const supportUrl = "https://docs.k8slens.dev/support/" as string;
export const docsUrl = "https://docs.k8slens.dev" as string; export const docsUrl = "https://docs.k8slens.dev" as string;
export const forumsUrl = "https://forums.k8slens.dev" as string;

View File

@ -11,7 +11,7 @@ import isWindowsInjectable from "../../common/vars/is-windows.injectable";
import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api"; import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
import { getLegacyGlobalDiForExtensionApi } from "../as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; import { getLegacyGlobalDiForExtensionApi } from "../as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
import getEnabledExtensionsInjectable from "./get-enabled-extensions/get-enabled-extensions.injectable"; import getEnabledExtensionsInjectable from "./get-enabled-extensions/get-enabled-extensions.injectable";
import { slackUrl, issuesTrackerUrl } from "../../common/vars"; import { issuesTrackerUrl } from "../../common/vars";
import { buildVersionInjectionToken } from "../../common/vars/build-semantic-version.injectable"; import { buildVersionInjectionToken } from "../../common/vars/build-semantic-version.injectable";
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api"; import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
import userStoreInjectable from "../../common/user-store/user-store.injectable"; import userStoreInjectable from "../../common/user-store/user-store.injectable";
@ -53,6 +53,9 @@ export const App = {
return di.inject(isLinuxInjectable); return di.inject(isLinuxInjectable);
}, },
slackUrl, /**
* @deprecated This value is now `""` and is left here for backwards compatability.
*/
slackUrl: "",
issuesTrackerUrl, issuesTrackerUrl,
} as const; } as const;

View File

@ -47,17 +47,29 @@ const getKubeApiDeps = (): KubeApiDependencies => {
}; };
}; };
export interface ExternalKubeApiOptions {
/**
* If `true` then on creation of the `KubeApi`instance a call to `apiManager.registerApi` will be
* made. This is `true` by default to maintain backwards compatability.
*
* Setting this to `false` might make `KubeObject`'s details drawer stop working.
*
* @default true
*/
autoRegister?: boolean;
}
// NOTE: this is done to preserve `instanceOf` behaviour // NOTE: this is done to preserve `instanceOf` behaviour
function KubeApiCstr< function KubeApiCstr<
Object extends KubeObject = KubeObject, Object extends KubeObject = KubeObject,
Data extends KubeJsonApiDataFor<Object> = KubeJsonApiDataFor<Object>, Data extends KubeJsonApiDataFor<Object> = KubeJsonApiDataFor<Object>,
>(opts: KubeApiOptions<Object, Data>) { >({ autoRegister = true, ...opts }: KubeApiOptions<Object, Data> & ExternalKubeApiOptions) {
const api = new InternalKubeApi(getKubeApiDeps(), opts); const api = new InternalKubeApi(getKubeApiDeps(), opts);
const di = getLegacyGlobalDiForExtensionApi(); const di = getLegacyGlobalDiForExtensionApi();
const storesAndApisCanBeCreated = di.inject(storesAndApisCanBeCreatedInjectionToken); const storesAndApisCanBeCreated = di.inject(storesAndApisCanBeCreatedInjectionToken);
if (storesAndApisCanBeCreated) { if (storesAndApisCanBeCreated && autoRegister) {
apiManager.registerApi(api); apiManager.registerApi(api);
} }
@ -72,7 +84,7 @@ export type KubeApi<
export const KubeApi = KubeApiCstr as unknown as new< export const KubeApi = KubeApiCstr as unknown as new<
Object extends KubeObject = KubeObject, Object extends KubeObject = KubeObject,
Data extends KubeJsonApiDataFor<Object> = KubeJsonApiDataFor<Object>, Data extends KubeJsonApiDataFor<Object> = KubeJsonApiDataFor<Object>,
>(opts: KubeApiOptions<Object, Data>) => InternalKubeApi<Object, Data>; >(opts: KubeApiOptions<Object, Data> & ExternalKubeApiOptions) => InternalKubeApi<Object, Data>;
/** /**
* @deprecated Switch to using `Common.createResourceStack` instead * @deprecated Switch to using `Common.createResourceStack` instead

View File

@ -107,11 +107,11 @@ exports[`extension special characters in page registrations renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -107,11 +107,11 @@ exports[`navigate to extension page renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -107,11 +107,11 @@ exports[`add-cluster - navigation using application menu renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`installing update when started renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -393,11 +393,11 @@ exports[`installing update when started when user checks for updates renders 1`]
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -678,11 +678,11 @@ exports[`installing update when started when user checks for updates when new up
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -988,11 +988,11 @@ exports[`installing update when started when user checks for updates when new up
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -1298,11 +1298,11 @@ exports[`installing update when started when user checks for updates when new up
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -1583,11 +1583,11 @@ exports[`installing update when started when user checks for updates when no new
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -133,11 +133,11 @@ exports[`encourage user to update when sufficient time passed since update was d
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -418,11 +418,11 @@ exports[`encourage user to update when sufficient time passed since update was d
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`installing update using tray when started renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -393,11 +393,11 @@ exports[`installing update using tray when started when user checks for updates
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -678,11 +678,11 @@ exports[`installing update using tray when started when user checks for updates
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -988,11 +988,11 @@ exports[`installing update using tray when started when user checks for updates
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -1298,11 +1298,11 @@ exports[`installing update using tray when started when user checks for updates
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -1583,11 +1583,11 @@ exports[`installing update using tray when started when user checks for updates
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -133,11 +133,11 @@ exports[`force user to update when too long since update was downloaded when app
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -443,11 +443,11 @@ exports[`force user to update when too long since update was downloaded when app
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -800,11 +800,11 @@ exports[`force user to update when too long since update was downloaded when app
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`periodical checking of updates given updater is enabled and configurati
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`selection of update stability when started renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`opening catalog entity details panel renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -199,11 +199,11 @@ exports[`Command Pallet: keyboard shortcut tests when on linux renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -575,11 +575,11 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing ESC
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -951,11 +951,11 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing SHI
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -1339,11 +1339,11 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing SHI
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -1624,11 +1624,11 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -1909,11 +1909,11 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing ESC
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -2194,11 +2194,11 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing SHI
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -2491,11 +2491,11 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing SHI
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`Showing correct entity settings renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -107,11 +107,11 @@ exports[`extensions - navigation using application menu renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -107,11 +107,11 @@ exports[`preferences - navigation using application menu renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`show-about-using-tray renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`status-bar-items-originating-from-extensions when application starts wh
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -108,11 +108,11 @@ exports[`extendability-using-extension-api given an extension with a weakly type
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -402,11 +402,11 @@ exports[`extendability-using-extension-api given an extension with top-bar items
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -687,11 +687,11 @@ exports[`extendability-using-extension-api given an extension with top-bar items
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -972,11 +972,11 @@ exports[`extendability-using-extension-api renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -107,11 +107,11 @@ exports[`welcome - navigation using application menu renders 1`] = `
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>
@ -1142,11 +1142,11 @@ exports[`welcome - navigation using application menu when navigated somewhere el
If you have any questions or feedback, please join our If you have any questions or feedback, please join our
<a <a
class="link" class="link"
href="https://k8slens.dev/slack.html" href="https://forums.k8slens.dev"
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -10,8 +10,8 @@ export const lensWebsiteLinkName = "Lens Website";
export const lensDocumentationWeblinkId = "lens-documentation-link"; export const lensDocumentationWeblinkId = "lens-documentation-link";
export const lensDocumentationWeblinkName = "Lens Documentation"; export const lensDocumentationWeblinkName = "Lens Documentation";
export const lensSlackWeblinkId = "lens-slack-link"; export const lensForumsWeblinkId = "lens-forums-link";
export const lensSlackWeblinkName = "Lens Community Slack"; export const lensForumsWeblinkName = "Lens Forums";
export const lensTwitterWeblinkId = "lens-twitter-link"; export const lensTwitterWeblinkId = "lens-twitter-link";
export const lensTwitterWeblinkName = "Lens on Twitter"; export const lensTwitterWeblinkName = "Lens on Twitter";

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { docsUrl, slackUrl } from "../../../common/vars"; import { docsUrl, forumsUrl } from "../../../common/vars";
import type { WeblinkData } from "../../../common/weblinks-store/weblink-store"; import type { WeblinkData } from "../../../common/weblinks-store/weblink-store";
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { weblinkStoreMigrationInjectionToken } from "../../../common/weblinks-store/migration-token"; import { weblinkStoreMigrationInjectionToken } from "../../../common/weblinks-store/migration-token";
@ -20,7 +20,7 @@ const v514WeblinkStoreMigrationInjectable = getInjectable({
weblinks.push( weblinks.push(
{ id: "https://k8slens.dev", name: links.lensWebsiteLinkName, url: "https://k8slens.dev" }, { id: "https://k8slens.dev", name: links.lensWebsiteLinkName, url: "https://k8slens.dev" },
{ id: docsUrl, name: links.lensDocumentationWeblinkName, url: docsUrl }, { id: docsUrl, name: links.lensDocumentationWeblinkName, url: docsUrl },
{ id: slackUrl, name: links.lensSlackWeblinkName, url: slackUrl }, { id: forumsUrl, name: links.lensForumsWeblinkName, url: forumsUrl },
{ id: "https://twitter.com/k8slens", name: links.lensTwitterWeblinkName, url: "https://twitter.com/k8slens" }, { id: "https://twitter.com/k8slens", name: links.lensTwitterWeblinkName, url: "https://twitter.com/k8slens" },
{ id: "https://medium.com/k8slens", name: links.lensBlogWeblinkName, url: "https://medium.com/k8slens" }, { id: "https://medium.com/k8slens", name: links.lensBlogWeblinkName, url: "https://medium.com/k8slens" },
{ id: "https://kubernetes.io/docs/home/", name: links.kubernetesDocumentationWeblinkName, url: "https://kubernetes.io/docs/home/" }, { id: "https://kubernetes.io/docs/home/", name: links.kubernetesDocumentationWeblinkName, url: "https://kubernetes.io/docs/home/" },

View File

@ -16,40 +16,40 @@ const v545Beta1WeblinkStoreMigrationInjectable = getInjectable({
const weblinksRaw = store.get("weblinks"); const weblinksRaw = store.get("weblinks");
const weblinks = (Array.isArray(weblinksRaw) ? weblinksRaw : []) as WeblinkData[]; const weblinks = (Array.isArray(weblinksRaw) ? weblinksRaw : []) as WeblinkData[];
const lensWebsiteLink = weblinks.find(weblink => weblink.name === links.lensWebsiteLinkName); const lensWebsite = weblinks.find(weblink => weblink.name === links.lensWebsiteLinkName);
if (lensWebsiteLink) { if (lensWebsite) {
lensWebsiteLink.id = links.lensWebsiteWeblinkId; lensWebsite.id = links.lensWebsiteWeblinkId;
} }
const lensDocumentationWeblinkLink = weblinks.find(weblink => weblink.name === links.lensDocumentationWeblinkName); const lensDocumentationWeblink = weblinks.find(weblink => weblink.name === links.lensDocumentationWeblinkName);
if (lensDocumentationWeblinkLink) { if (lensDocumentationWeblink) {
lensDocumentationWeblinkLink.id = links.lensDocumentationWeblinkId; lensDocumentationWeblink.id = links.lensDocumentationWeblinkId;
} }
const lensSlackWeblinkLink = weblinks.find(weblink => weblink.name === links.lensSlackWeblinkName); const lensForumsWeblink = weblinks.find(weblink => weblink.name === links.lensForumsWeblinkName);
if (lensSlackWeblinkLink) { if (lensForumsWeblink) {
lensSlackWeblinkLink.id = links.lensSlackWeblinkId; lensForumsWeblink.id = links.lensForumsWeblinkId;
} }
const lensTwitterWeblinkLink = weblinks.find(weblink => weblink.name === links.lensTwitterWeblinkName); const lensTwitterWeblink = weblinks.find(weblink => weblink.name === links.lensTwitterWeblinkName);
if (lensTwitterWeblinkLink) { if (lensTwitterWeblink) {
lensTwitterWeblinkLink.id = links.lensTwitterWeblinkId; lensTwitterWeblink.id = links.lensTwitterWeblinkId;
} }
const lensBlogWeblinkLink = weblinks.find(weblink => weblink.name === links.lensBlogWeblinkName); const lensBlogWeblink = weblinks.find(weblink => weblink.name === links.lensBlogWeblinkName);
if (lensBlogWeblinkLink) { if (lensBlogWeblink) {
lensBlogWeblinkLink.id = links.lensBlogWeblinkId; lensBlogWeblink.id = links.lensBlogWeblinkId;
} }
const kubernetesDocumentationWeblinkLink = weblinks.find(weblink => weblink.name === links.kubernetesDocumentationWeblinkName); const kubernetesDocumentationWeblink = weblinks.find(weblink => weblink.name === links.kubernetesDocumentationWeblinkName);
if (kubernetesDocumentationWeblinkLink) { if (kubernetesDocumentationWeblink) {
kubernetesDocumentationWeblinkLink.id = links.kubernetesDocumentationWeblinkId; kubernetesDocumentationWeblink.id = links.kubernetesDocumentationWeblinkId;
} }
store.set("weblinks", weblinks); store.set("weblinks", weblinks);

View File

@ -3,12 +3,12 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { docsUrl, slackUrl } from "../../../common/vars"; import { docsUrl, forumsUrl } from "../../../common/vars";
import type { WeblinkData } from "../../../common/weblinks-store/weblink-store"; import type { WeblinkData } from "../../../common/weblinks-store/weblink-store";
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { weblinkStoreMigrationInjectionToken } from "../../../common/weblinks-store/migration-token"; import { weblinkStoreMigrationInjectionToken } from "../../../common/weblinks-store/migration-token";
import { applicationInformationToken } from "../../../common/vars/application-information-token"; import { applicationInformationToken } from "../../../common/vars/application-information-token";
import { lensDocumentationWeblinkId, lensSlackWeblinkId } from "../links"; import { lensDocumentationWeblinkId, lensForumsWeblinkId } from "../links";
const currentVersionWeblinkStoreMigrationInjectable = getInjectable({ const currentVersionWeblinkStoreMigrationInjectable = getInjectable({
id: "current-version-weblink-store-migration", id: "current-version-weblink-store-migration",
@ -20,10 +20,10 @@ const currentVersionWeblinkStoreMigrationInjectable = getInjectable({
run(store) { run(store) {
const weblinksRaw = store.get("weblinks"); const weblinksRaw = store.get("weblinks");
const weblinks = (Array.isArray(weblinksRaw) ? weblinksRaw : []) as WeblinkData[]; const weblinks = (Array.isArray(weblinksRaw) ? weblinksRaw : []) as WeblinkData[];
const slackWeblink = weblinks.find(weblink => weblink.id === lensSlackWeblinkId); const forumsWeblink = weblinks.find(weblink => weblink.id === lensForumsWeblinkId);
if (slackWeblink) { if (forumsWeblink) {
slackWeblink.url = slackUrl; forumsWeblink.url = forumsUrl;
} }
const docsWeblink = weblinks.find(weblink => weblink.id === lensDocumentationWeblinkId); const docsWeblink = weblinks.find(weblink => weblink.id === lensDocumentationWeblinkId);
@ -32,7 +32,9 @@ const currentVersionWeblinkStoreMigrationInjectable = getInjectable({
docsWeblink.url = docsUrl; docsWeblink.url = docsUrl;
} }
store.set("weblinks", weblinks); const removedSlackLink = weblinks.filter(weblink => weblink.id !== "lens-slack-link");
store.set("weblinks", removedSlackLink);
}, },
}; };
}, },

View File

@ -10,7 +10,7 @@ import type { IComputedValue } from "mobx";
import type { CarouselProps } from "react-material-ui-carousel"; import type { CarouselProps } from "react-material-ui-carousel";
import LegacyCarousel from "react-material-ui-carousel"; import LegacyCarousel from "react-material-ui-carousel";
import { Icon } from "../icon"; import { Icon } from "../icon";
import { slackUrl } from "../../../common/vars"; import { forumsUrl } from "../../../common/vars";
import { withInjectables } from "@ogre-tools/injectable-react"; import { withInjectables } from "@ogre-tools/injectable-react";
import welcomeMenuItemsInjectable from "./welcome-menu-items/welcome-menu-items.injectable"; import welcomeMenuItemsInjectable from "./welcome-menu-items/welcome-menu-items.injectable";
import type { WelcomeMenuRegistration } from "./welcome-menu-items/welcome-menu-registration"; import type { WelcomeMenuRegistration } from "./welcome-menu-items/welcome-menu-registration";
@ -93,12 +93,12 @@ const NonInjectedWelcome = observer(({
<br /> <br />
{"If you have any questions or feedback, please join our "} {"If you have any questions or feedback, please join our "}
<a <a
href={slackUrl} href={forumsUrl}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
className="link" className="link"
> >
Lens Community slack channel Lens Forums
</a> </a>
. .
</p> </p>

View File

@ -9,7 +9,7 @@ import type { ErrorInfo } from "react";
import React from "react"; import React from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { Button } from "../button"; import { Button } from "../button";
import { issuesTrackerUrl, slackUrl } from "../../../common/vars"; import { issuesTrackerUrl, forumsUrl } from "../../../common/vars";
import type { SingleOrMany } from "../../utils"; import type { SingleOrMany } from "../../utils";
import type { ObservableHistory } from "mobx-observable-history"; import type { ObservableHistory } from "mobx-observable-history";
import { withInjectables } from "@ogre-tools/injectable-react"; import { withInjectables } from "@ogre-tools/injectable-react";
@ -53,15 +53,15 @@ class NonInjectedErrorBoundary extends React.Component<ErrorBoundaryProps & Depe
</h5> </h5>
<p> <p>
{"To help us improve the product please report bugs to "} {"To help us improve the product please report bugs on"}
<a <a
href={slackUrl} href={forumsUrl}
rel="noreferrer" rel="noreferrer"
target="_blank" target="_blank"
> >
Slack Lens Forums
</a> </a>
{" community or "} {" or on our"}
<a <a
href={issuesTrackerUrl} href={issuesTrackerUrl}
rel="noreferrer" rel="noreferrer"

View File

@ -2,7 +2,7 @@
"name": "@k8slens/extensions", "name": "@k8slens/extensions",
"productName": "OpenLens extensions", "productName": "OpenLens extensions",
"description": "OpenLens - Open Source Kubernetes IDE: extensions", "description": "OpenLens - Open Source Kubernetes IDE: extensions",
"version": "6.4.0-beta.16", "version": "6.4.0-beta.17",
"copyright": "© 2022 OpenLens Authors", "copyright": "© 2022 OpenLens Authors",
"license": "MIT", "license": "MIT",
"main": "dist/extension-api.js", "main": "dist/extension-api.js",
@ -26,7 +26,7 @@
"prepare:dev": "yarn run build" "prepare:dev": "yarn run build"
}, },
"dependencies": { "dependencies": {
"@k8slens/core": "^6.4.0-beta.16" "@k8slens/core": "^6.4.0-beta.17"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^16.18.6", "@types/node": "^16.18.6",

View File

@ -4,7 +4,7 @@
"productName": "OpenLens", "productName": "OpenLens",
"description": "OpenLens - Open Source IDE for Kubernetes", "description": "OpenLens - Open Source IDE for Kubernetes",
"homepage": "https://github.com/lensapp/lens", "homepage": "https://github.com/lensapp/lens",
"version": "6.4.0-beta.16", "version": "6.4.0-beta.17",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/lensapp/lens.git" "url": "git+https://github.com/lensapp/lens.git"
@ -192,7 +192,7 @@
} }
}, },
"dependencies": { "dependencies": {
"@k8slens/core": "^6.4.0-beta.16", "@k8slens/core": "^6.4.0-beta.17",
"@k8slens/ensure-binaries": "^6.4.0-beta.16", "@k8slens/ensure-binaries": "^6.4.0-beta.16",
"@k8slens/generate-tray-icons": "^6.4.0-beta.16", "@k8slens/generate-tray-icons": "^6.4.0-beta.16",
"@ogre-tools/fp": "^12.0.1", "@ogre-tools/fp": "^12.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@k8slens/release-tool", "name": "@k8slens/release-tool",
"version": "6.4.0-beta.16", "version": "6.4.0-beta.17",
"description": "Release tool for lens monorepo", "description": "Release tool for lens monorepo",
"main": "dist/index.mjs", "main": "dist/index.mjs",
"license": "MIT", "license": "MIT",
@ -16,15 +16,14 @@
"devDependencies": { "devDependencies": {
"@swc/cli": "^0.1.61", "@swc/cli": "^0.1.61",
"@swc/core": "^1.3.35", "@swc/core": "^1.3.35",
"@types/command-line-args": "^5.2.0", "@types/inquirer": "^9.0.3",
"@types/fs-extra": "^11.0.1",
"@types/node": "^16.18.11", "@types/node": "^16.18.11",
"@types/semver": "^7.3.13", "@types/semver": "^7.3.13",
"command-line-args": "^5.2.1", "rimraf": "^4.1.2"
"fs-extra": "^11.1.0",
"semver": "^7.3.8"
}, },
"dependencies": { "dependencies": {
"rimraf": "^4.1.2" "chalk": "^5.2.0",
"inquirer": "^9.1.4",
"semver": "^7.3.8"
} }
} }

View File

@ -3,122 +3,22 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import assert from "assert";
import chalk from "chalk";
import child_process from "child_process"; import child_process from "child_process";
import commandLineArgs from "command-line-args"; import { readFile } from "fs/promises";
import fse from "fs-extra"; import inquirer from "inquirer";
import { basename } from "path"; import { createInterface, ReadLine } from "readline";
import { createInterface } from "readline";
import semver from "semver"; import semver from "semver";
import { promisify } from "util"; import { promisify } from "util";
const { type SemVer = semver.SemVer;
SemVer,
valid: semverValid, const { SemVer } = semver;
rcompare: semverRcompare,
lte: semverLte,
} = semver;
const exec = promisify(child_process.exec); const exec = promisify(child_process.exec);
const spawn = promisify(child_process.spawn);
const execFile = promisify(child_process.execFile); const execFile = promisify(child_process.execFile);
const options = commandLineArgs([
{
name: "type",
defaultOption: true,
},
{
name: "preid",
},
{
name: "check-commits",
type: Boolean,
},
]);
const validReleaseValues = [
"major",
"minor",
"patch",
];
const validPrereleaseValues = [
"premajor",
"preminor",
"prepatch",
"prerelease",
];
const validPreidValues = [
"alpha",
"beta",
];
const errorMessages = {
noReleaseType: `No release type provided. Valid options are: ${[...validReleaseValues, ...validPrereleaseValues].join(", ")}`,
invalidRelease: (invalid: string) => `Invalid release type was provided (value was "${invalid}"). Valid options are: ${[...validReleaseValues, ...validPrereleaseValues].join(", ")}`,
noPreid: `No preid was provided. Use '--preid' to specify. Valid options are: ${validPreidValues.join(", ")}`,
invalidPreid: (invalid: string) => `Invalid preid was provided (value was "${invalid}"). Valid options are: ${validPreidValues.join(", ")}`,
wrongCwd: "It looks like you are running this script from the 'scripts' directory. This script assumes it is run from the root of the git repo",
};
if (!options.type) {
console.error(errorMessages.noReleaseType);
process.exit(1);
}
if (validReleaseValues.includes(options.type)) {
// do nothing, is valid
} else if (validPrereleaseValues.includes(options.type)) {
if (!options.preid) {
console.error(errorMessages.noPreid);
process.exit(1);
}
if (!validPreidValues.includes(options.preid)) {
console.error(errorMessages.invalidPreid(options.preid));
process.exit(1);
}
} else {
console.error(errorMessages.invalidRelease(options.type));
process.exit(1);
}
if (basename(process.cwd()) === "scripts") {
console.error(errorMessages.wrongCwd);
}
const currentVersion = new SemVer((await fse.readJson("./lerna.json")).version);
console.log(`current version: ${currentVersion.format()}`);
const newVersion = currentVersion.inc(options.type, options.preid);
const newVersionMilestone = `${newVersion.major}.${newVersion.minor}.${newVersion.patch}`;
const prBranch = `release/v${newVersion.format()}`;
await exec(`yarn run bump-version --yes ${newVersion.format()} --force-publish`);
await exec(`git checkout -b ${prBranch}`);
await exec("git add lerna.json packages/*/package.json");
await exec(`git commit -sm "Release ${newVersion.format()}"`);
console.log(`new version: ${newVersion.format()}`);
console.log("fetching tags...");
await exec("git fetch --tags --force");
const actualTags = (await exec("git tag --list", { encoding: "utf-8" })).stdout.split(/\r?\n/).map(line => line.trim());
const [previousReleasedVersion] = actualTags
.map((value) => semverValid(value))
.filter((v): v is string => typeof v === "string")
.sort((l, r) => semverRcompare(l, r))
.filter(version => semverLte(version, currentVersion));
const getMergedPrsArgs = [
"gh",
"pr",
"list",
"--limit=500", // Should be big enough, if not we need to release more often ;)
"--state=merged",
"--base=master",
"--json mergeCommit,title,author,labels,number,milestone,mergedAt",
];
interface GithubPrData { interface GithubPrData {
author: { author: {
login: string; login: string;
@ -147,21 +47,97 @@ interface ExtendedGithubPrData extends Omit<GithubPrData, "mergedAt"> {
mergedAt: Date; mergedAt: Date;
} }
console.log("retreiving last 500 PRs to create release PR body..."); async function getCurrentBranch(): Promise<string> {
const mergedPrs = JSON.parse((await exec(getMergedPrsArgs.join(" "), { encoding: "utf-8" })).stdout) as GithubPrData[]; return (await exec("git branch --show-current")).stdout.trim();
const milestoneRelevantPrs = mergedPrs.filter(pr => pr.milestone?.title === newVersionMilestone); }
const relaventPrsQuery = await Promise.all(
milestoneRelevantPrs.map(async pr => ({ async function getAbsolutePathToRepoRoot(): Promise<string> {
pr, return (await exec("git rev-parse --show-toplevel")).stdout.trim();
stdout: (await exec(`git tag v${previousReleasedVersion} --no-contains ${pr.mergeCommit.oid}`)).stdout, }
})),
); async function fetchAllGitTags(): Promise<string[]> {
const relaventPrs = relaventPrsQuery await execFile("git", ["fetch", "--tags", "--force"]);
.filter(query => query.stdout)
.map(query => query.pr) const { stdout } = await exec("git tag --list", { encoding: "utf-8" });
.filter(pr => pr.labels.every(label => label.name !== "skip-changelog"))
.map(pr => ({ ...pr, mergedAt: new Date(pr.mergedAt) } as ExtendedGithubPrData)) return stdout
.sort((left, right) => { .split(/\r?\n/)
.map(line => line.trim());
}
async function bumpPackageVersions(): Promise<void> {
await spawn("npm", ["run", "bump-version"], {
stdio: "inherit",
});
}
function isDefined<T>(value: T | null | undefined): value is T {
return value != null;
}
function findClosestVersionTagLessThanVersion(tags: string[], version: SemVer): string {
const lessThanTags = tags
.map((value) => semver.parse(value))
.filter(isDefined)
.filter(version => !version.prerelease.includes("cron"))
.sort(semver.rcompare)
.filter(version => semver.lte(version, version));
assert(lessThanTags.length > 0, `Cannot find version tag less than ${version.format()}`);
return lessThanTags[0].format();
}
async function getCurrentVersionOfSubPackage(packageName: string): Promise<SemVer> {
const packageJson = JSON.parse(await readFile(`./packages/${packageName}/package.json`, "utf-8"));
return new SemVer(packageJson.version);
}
async function checkCurrentWorkingDirectory(): Promise<void> {
const repoRoot = await getAbsolutePathToRepoRoot();
if (process.cwd() !== repoRoot) {
console.error("It looks like you are running this script from the 'scripts' directory. This script assumes it is run from the root of the git repo");
process.exit(1);
}
}
function formatSemverForMilestone(version: SemVer): string {
return `${version.major}.${version.minor}.${version.patch}`;
}
async function createReleaseBranchAndCommit(prBase: string, version: SemVer, prBody: string): Promise<void> {
const prBranch = `release/v${version.format()}`;
await spawn("git", ["checkout", "-b", prBranch], {
stdio: "inherit",
});
await spawn("git", ["add", "lerna.json", "packages/*/package.json"], {
stdio: "inherit",
});
await spawn("git", ["commit", "-sm", `"Release ${version.format()}"`], {
stdio: "inherit",
});
await spawn("git", ["push", "--set-upstream", "origin", prBranch], {
stdio: "inherit",
});
await spawn("gh", [
"pr",
"create",
"--base", prBase,
"--title", `Release ${version.format()}`,
"--label", "skip-changelog",
"--label", "release",
"--milestone", formatSemverForMilestone(version),
"--body-file", prBody,
], {
stdio: "inherit"
});
}
function sortExtendedGithubPrData(left: ExtendedGithubPrData, right: ExtendedGithubPrData): number {
const leftAge = left.mergedAt.valueOf(); const leftAge = left.mergedAt.valueOf();
const rightAge = right.mergedAt.valueOf(); const rightAge = right.mergedAt.valueOf();
@ -174,141 +150,193 @@ const relaventPrs = relaventPrsQuery
} }
return -1; return -1;
}); }
const enhancementPrLabelName = "enhancement"; async function getRelevantPRs(milestone: string, previousReleasedVersion: string): Promise<ExtendedGithubPrData[]> {
const bugfixPrLabelName = "bug"; console.log("retreiving previous 500 PRs...");
const isEnhancementPr = (pr: ExtendedGithubPrData) => pr.labels.some(label => label.name === enhancementPrLabelName); const getMergedPrsArgs = [
const isBugfixPr = (pr: ExtendedGithubPrData) => pr.labels.some(label => label.name === bugfixPrLabelName); "gh",
"pr",
"list",
"--limit=500", // Should be big enough, if not we need to release more often ;)
"--state=merged",
"--base=master",
"--json mergeCommit,title,author,labels,number,milestone,mergedAt",
];
const prLines = { const mergedPrs = JSON.parse((await exec(getMergedPrsArgs.join(" "), { encoding: "utf-8" })).stdout) as GithubPrData[];
enhancement: [] as string[], const milestoneRelevantPrs = mergedPrs.filter(pr => pr.milestone?.title === milestone);
bugfix: [] as string[], const relaventPrsQuery = await Promise.all(
maintenence: [] as string[], milestoneRelevantPrs.map(async pr => ({
}; pr,
stdout: (await exec(`git tag v${previousReleasedVersion} --no-contains ${pr.mergeCommit.oid}`)).stdout,
})),
);
function getPrEntry(pr: ExtendedGithubPrData) { return relaventPrsQuery
.filter(query => query.stdout)
.map(query => query.pr)
.filter(pr => pr.labels.every(label => label.name !== "skip-changelog"))
.map(pr => ({ ...pr, mergedAt: new Date(pr.mergedAt) } as ExtendedGithubPrData))
.sort(sortExtendedGithubPrData);
}
function formatPrEntry(pr: ExtendedGithubPrData) {
return `- ${pr.title} (**[#${pr.number}](https://github.com/lensapp/lens/pull/${pr.number})**) https://github.com/${pr.author.login}`; return `- ${pr.title} (**[#${pr.number}](https://github.com/lensapp/lens/pull/${pr.number})**) https://github.com/${pr.author.login}`;
} }
const rl = createInterface(process.stdin); const isEnhancementPr = (pr: ExtendedGithubPrData) => pr.labels.some(label => label.name === "enhancement");
const prBase = newVersion.patch === 0 const isBugfixPr = (pr: ExtendedGithubPrData) => pr.labels.some(label => label.name === "bug");
? "master"
: `release/v${newVersion.major}.${newVersion.minor}`;
function askQuestion(question: string): Promise<boolean> { const cherrypickCommitWith = (rl: ReadLine) => async (commit: string) => {
return new Promise<boolean>(resolve => {
function _askQuestion() {
console.log(question);
rl.once("line", (answer) => {
const cleaned = answer.trim().toLowerCase();
if (cleaned === "y") {
resolve(true);
} else if (cleaned === "n") {
resolve(false);
} else {
_askQuestion();
}
});
}
_askQuestion();
});
}
async function handleRelaventPr(pr: ExtendedGithubPrData) {
if (options["check-commits"] && !(await askQuestion(`Would you like to use #${pr.number}: ${pr.title}? - Y/N`))) {
return;
}
if (prBase !== "master") {
try { try {
const promise = exec(`git cherry-pick ${pr.mergeCommit.oid}`); const cherryPick = child_process.spawn("git", ["cherry-pick", commit]);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion cherryPick.stdout.pipe(process.stdout);
promise.child.stdout!.pipe(process.stdout); cherryPick.stderr.pipe(process.stderr);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
promise.child.stderr!.pipe(process.stderr);
await promise; await new Promise<void>((resolve, reject) => {
const cleaners: (() => void)[] = [];
const cleanup = () => cleaners.forEach(cleaner => cleaner());
const onExit = (code: number | null) => {
if (code) {
reject(new Error(`git cherry-pick failed with exit code ${code}`));
cleanup();
}
resolve();
cleanup();
};
cherryPick.once("exit", onExit);
cleaners.push(() => cherryPick.off("exit", onExit));
const onError = (error: Error) => {
cleanup();
reject(error);
};
cherryPick.once("error", onError);
cleaners.push(() => cherryPick.off("error", onError));
});
} catch { } catch {
console.error(`Failed to cherry-pick ${pr.mergeCommit.oid}, please resolve conflicts and then press enter here:`); console.error(chalk.bold("Please resolve conflicts in a seperate terminal and then press enter here..."));
await new Promise<void>(resolve => rl.once("line", () => resolve())); await new Promise<void>(resolve => rl.once("line", () => resolve()));
} }
};
async function pickWhichPRsToUse(prs: ExtendedGithubPrData[]): Promise<ExtendedGithubPrData[]> {
const answers = await inquirer.prompt<{ commits: number[] }>({
type: "checkbox",
name: `commits`,
message: "Pick which commits to use...",
default: [],
choices: prs.map(pr => ({
checked: true,
key: pr.number,
name: `#${pr.number}: ${pr.title} (https://github.com/lensapp/lens/pull/${pr.number})`,
value: pr.number,
short: `#${pr.number}`,
})),
loop: false,
});
return prs.filter(pr => answers.commits.includes(pr.number));
} }
function formatChangelog(previousReleasedVersion: string, prs: ExtendedGithubPrData[]): string {
const enhancementPrLines: string[] = [];
const bugPrLines: string[] = [];
const maintenencePrLines: string[] = [];
for (const pr of prs) {
if (isEnhancementPr(pr)) { if (isEnhancementPr(pr)) {
prLines.enhancement.push(getPrEntry(pr)); enhancementPrLines.push(formatPrEntry(pr));
} else if (isBugfixPr(pr)) { } else if (isBugfixPr(pr)) {
prLines.bugfix.push(getPrEntry(pr)); bugPrLines.push(formatPrEntry(pr));
} else { } else {
prLines.maintenence.push(getPrEntry(pr)); maintenencePrLines.push(formatPrEntry(pr));
} }
} }
for (const pr of relaventPrs) { if (enhancementPrLines.length > 0) {
await handleRelaventPr(pr); enhancementPrLines.unshift("## 🚀 Features", "");
enhancementPrLines.push("");
}
if (bugPrLines.length > 0) {
bugPrLines.unshift("## 🐛 Bug Fixes", "");
bugPrLines.push("");
}
if (maintenencePrLines.length > 0) {
maintenencePrLines.unshift("## 🧰 Maintenance", "");
maintenencePrLines.push("");
}
return [
`## Changes since ${previousReleasedVersion}`,
"",
...enhancementPrLines,
...bugPrLines,
...maintenencePrLines,
].join("\n");
}
async function cherrypickCommits(prs: ExtendedGithubPrData[]): Promise<void> {
const rl = createInterface(process.stdin);
const cherrypickCommit = cherrypickCommitWith(rl);
for (const pr of prs) {
await cherrypickCommit(pr.mergeCommit.oid);
} }
rl.close(); rl.close();
}
const prBodyLines = [ async function pickRelaventPrs(prs: ExtendedGithubPrData[], isMasterBranch: boolean): Promise<ExtendedGithubPrData[]> {
`## Changes since ${previousReleasedVersion}`, if (isMasterBranch) {
"", return prs;
...( }
prLines.enhancement.length > 0
? [
"## 🚀 Features",
"",
...prLines.enhancement,
"",
]
: []
),
...(
prLines.bugfix.length > 0
? [
"## 🐛 Bug Fixes",
"",
...prLines.bugfix,
"",
]
: []
),
...(
prLines.maintenence.length > 0
? [
"## 🧰 Maintenance",
"",
...prLines.maintenence,
"",
]
: []
),
];
const prBody = prBodyLines.join("\n");
const createPrArgs = [
"pr",
"create",
"--base", prBase,
"--title", `Release ${newVersion.format()}`,
"--label", "skip-changelog",
"--label", "release",
"--milestone", `${newVersion.major}.${newVersion.minor}.${newVersion.patch}`,
"--body-file", "-",
];
await exec(`git push --set-upstream origin ${prBranch}`); let selectedPrs: ExtendedGithubPrData[];
const createPrProcess = execFile("gh", createPrArgs); do {
selectedPrs = await pickWhichPRsToUse(prs);
} while (selectedPrs.length === 0 && (console.warn("[WARNING]: must pick at least once commit"), true));
createPrProcess.child.stdout?.pipe(process.stdout); await cherrypickCommits(selectedPrs);
createPrProcess.child.stderr?.pipe(process.stderr);
createPrProcess.child.stdin?.write(prBody); return selectedPrs;
createPrProcess.child.stdin?.end(); }
await createPrProcess; async function createRelease(): Promise<void> {
await checkCurrentWorkingDirectory();
const currentK8slensCoreVersion = await getCurrentVersionOfSubPackage("core");
const prBase = await getCurrentBranch();
const isMasterBranch = prBase === "master";
const tags = await fetchAllGitTags();
const previousReleasedVersion = findClosestVersionTagLessThanVersion(tags, currentK8slensCoreVersion);
if (isMasterBranch) {
await bumpPackageVersions();
}
const prMilestone = formatSemverForMilestone(await getCurrentVersionOfSubPackage("core"));
const relaventPrs = await getRelevantPRs(prMilestone, previousReleasedVersion);
const selectedPrs = await pickRelaventPrs(relaventPrs, isMasterBranch);
const prBody = formatChangelog(previousReleasedVersion, selectedPrs);
if (!isMasterBranch) {
await bumpPackageVersions();
}
const newK8slensCoreVersion = await getCurrentVersionOfSubPackage("core");
await createReleaseBranchAndCommit(prBase, newK8slensCoreVersion, prBody);
}
await createRelease();