Skip to content

Commit

Permalink
Merge pull request #462 from juozasg/async-treeviews
Browse files Browse the repository at this point in the history
Improved async treeview loading logic and related UI improvements
  • Loading branch information
Kingdon Barrett authored Aug 21, 2023
2 parents eea0f03 + 20a58f9 commit 5f20075
Show file tree
Hide file tree
Showing 45 changed files with 591 additions and 394 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # pin@v3
with:
node-version: '19'
node-version: '20'

- run: npm install

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GitOps Tools for Visual Studio Code

[![VSCode Marketplace Link](https://vsmarketplacebadges.dev/version-short/weaveworks.vscode-gitops-tools.png)](https://marketplace.visualstudio.com/items?itemName=Weaveworks.vscode-gitops-tools)
[![Install Counter](https://vsmarketplacebadges.dev/installs/weaveworks.vscode-gitops-tools.png)](https://marketplace.visualstudio.com/items?itemName=Weaveworks.vscode-gitops-tools)
[![VSCode Marketplace Link](https://img.shields.io/visual-studio-marketplace/v/weaveworks.vscode-gitops-tools)](https://marketplace.visualstudio.com/items?itemName=Weaveworks.vscode-gitops-tools)
[![Install Counter](https://img.shields.io/visual-studio-marketplace/i/weaveworks.vscode-gitops-tools)](https://marketplace.visualstudio.com/items?itemName=Weaveworks.vscode-gitops-tools)

Weaveworks [GitOps Tools Extension](https://marketplace.visualstudio.com/items?itemName=Weaveworks.vscode-gitops-tools) provides an intuitive way to manage, troubleshoot and operate your Kubernetes environment following the GitOps operating model. GitOps accelerates your development lifecycle and simplifies your continuous delivery pipelines. The extension is built on Flux (a CNCF open source project). To learn more about the Flux GitOps toolkit, visit [fluxcd.io]

Expand Down Expand Up @@ -145,11 +145,9 @@ We rely on the Kubernetes extension to discover and connect to clusters. If you

Confirm that your configuration context shows in a terminal running `kubectl config get-contexts`

### _Switching from an unreachable cluster context to a working cluster_





Unreachable or laggy clusters can create long running that cluster resource queries that finish after switching to a working cluster context. This can lead to the slow cluster data overwriting the current cluster treeview. **Clusters** -> **Refresh** button will reinitialize the views with current data. Timeout settings can be adjusted under **GitOps** section in VSCode Settings.

# Data and Telemetry

Expand Down
95 changes: 95 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 29 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,15 @@
"default": false,
"description": "Enable WGE GitOpsTemplates feature"
},
"gitops.kubectlTimeout": {
"gitops.kubectlRequestTimeout": {
"type": "string",
"default": "10s",
"description": "kubectl --request-timeout"
},
"gitops.execTimeout": {
"type": "string",
"default": "60",
"description": "Seconds until SIGTERM for every shell exec (except `kubectl proxy`). Set to 0 for no timeout."
}
}
},
Expand All @@ -319,17 +324,22 @@
{
"view": "gitops.views.sources",
"contents": "[Enable GitOps](command:gitops.flux.install) for the selected Cluster to view Sources.",
"when": "gitops:currentClusterGitOpsNotEnabled && !gitops:noClusterSelected"
"when": "gitops:currentClusterGitOpsNotEnabled && !gitops:noClusterSelected && !gitops:clusterUnreachable"
},
{
"view": "gitops.views.sources",
"contents": "Loading Sources ...",
"when": "gitops:loadingSources && !gitops:noClusterSelected && !gitops:currentClusterGitOpsNotEnabled"
"when": "gitops:loadingSources && !gitops:noClusterSelected && !gitops:currentClusterGitOpsNotEnabled && !gitops:clusterUnreachable"
},
{
"view": "gitops.views.sources",
"contents": "No sources.",
"when": "!gitops:loadingSources && !gitops:currentClusterGitOpsNotEnabled && !gitops:noClusterSelected && gitops:noSources"
"when": "!gitops:loadingSources && !gitops:currentClusterGitOpsNotEnabled && !gitops:noClusterSelected && gitops:noSources && !gitops:clusterUnreachable"
},
{
"view": "gitops.views.sources",
"contents": "Cluster unreachable",
"when": "gitops:clusterUnreachable"
},
{
"view": "gitops.views.sources",
Expand All @@ -339,17 +349,22 @@
{
"view": "gitops.views.workloads",
"contents": "[Enable GitOps](command:gitops.flux.install) for the selected Cluster to view Workloads.",
"when": "gitops:currentClusterGitOpsNotEnabled"
"when": "gitops:currentClusterGitOpsNotEnabled && !gitops:clusterUnreachable"
},
{
"view": "gitops.views.workloads",
"contents": "Loading Workloads ...",
"when": "gitops:loadingWorkloads && !gitops:noClusterSelected && !gitops:currentClusterGitOpsNotEnabled"
"when": "gitops:loadingWorkloads && !gitops:noClusterSelected && !gitops:currentClusterGitOpsNotEnabled && !gitops:clusterUnreachable"
},
{
"view": "gitops.views.workloads",
"contents": "No workloads.",
"when": "!gitops:loadingWorkloads && !gitops:currentClusterGitOpsNotEnabled && !gitops:noClusterSelected && gitops:noWorkloads"
"when": "!gitops:loadingWorkloads && !gitops:currentClusterGitOpsNotEnabled && !gitops:noClusterSelected && gitops:noWorkloads && !gitops:clusterUnreachable"
},
{
"view": "gitops.views.workloads",
"contents": "Cluster unreachable",
"when": "gitops:clusterUnreachable"
},
{
"view": "gitops.views.workloads",
Expand Down Expand Up @@ -609,6 +624,7 @@
],
"devDependencies": {
"@types/git-url-parse": "^9.0.1",
"@types/is-running": "^2.1.0",
"@types/mocha": "^9.1.0",
"@types/node": "14.x",
"@types/semver": "^7.3.9",
Expand All @@ -623,10 +639,10 @@
"eslint": "^8.11.0",
"glob": "^7.2.0",
"mocha": "^9.2.2",
"tough-cookie": ">=4.1.3",
"ts-loader": "^9.2.8",
"tsconfig-paths-webpack-plugin": "^4.0.1",
"typescript": "^4.5.5",
"tough-cookie": ">=4.1.3",
"vite": ">=2.9.16",
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2",
Expand All @@ -636,9 +652,11 @@
"@kubernetes/client-node": "^0.18.1",
"@types/ws": "^8.5.4",
"@vscode/extension-telemetry": "^0.4.7",
"bufferutil": "^4.0.7",
"change-case": "^4.1.2",
"extract-zip": "^2.0.1",
"git-url-parse": "^13.0.0",
"is-running": "^2.1.0",
"jose": ">=2.0.6",
"lite-deep-equal": "^1.0.6",
"parse-path": ">=5.0.0",
Expand All @@ -648,15 +666,15 @@
"shelljs": "^0.8.5",
"tinytim": "^0.1.1",
"tough-cookie": ">=4.1.3",
"tree-kill": "^1.2.2",
"utf-8-validate": "^6.0.3",
"uuid": "^9.0.0",
"vite": ">=2.9.16",
"vscode-kubernetes-tools-api": "^1.3.0",
"vscode-uri": "^3.0.7",
"word-wrap": ">=1.2.4"
},
"activationEvents": [
"onDebug"
],
"activationEvents": [],
"__metadata": {
"id": "61a914ed-c714-4c42-a201-6008038286a4",
"publisherDisplayName": "Weaveworks",
Expand Down
2 changes: 1 addition & 1 deletion src/cli/azure/azurePrereqs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { window } from 'vscode';

import { shell } from 'cli/shell/exec';
import * as shell from 'cli/shell/exec';
import { ClusterProvider } from 'types/kubernetes/clusterProvider';
import { AzureClusterProvider } from './azureTools';

Expand Down
9 changes: 4 additions & 5 deletions src/cli/azure/azureTools.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { Uri, env, window } from 'vscode';

import { fluxTools } from 'cli/flux/fluxTools';
import { ShellResult, shell, shellCodeError } from 'cli/shell/exec';
import { kubeConfig } from 'cli/kubernetes/kubernetesConfig';
import * as shell from 'cli/shell/exec';
import { ShellResult, shellCodeError } from 'cli/shell/exec';
import { refreshAllTreeViewsCommand } from 'commands/refreshTreeViews';
import { ClusterMetadata } from 'data/globalState';
import { globalState, telemetry } from 'extension';
import { failed } from 'types/errorable';
import { ClusterProvider } from 'types/kubernetes/clusterProvider';
import { TelemetryError } from 'types/telemetryEventNames';
import { getCurrentClusterInfo } from 'ui/treeviews/treeViews';
import { refreshAllTreeViewsCommand } from 'commands/refreshTreeViews';
import { parseJson } from 'utils/jsonUtils';
import { checkAzurePrerequisites } from './azurePrereqs';
import { getAzureMetadata } from './getAzureMetadata';
import { kubeConfig } from 'cli/kubernetes/kubernetesConfig';

export type AzureClusterProvider = ClusterProvider.AKS | ClusterProvider.AzureARC;

Expand Down
Loading

0 comments on commit 5f20075

Please sign in to comment.