Skip to content
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

chore: Merge the subcommands from context into cluster and get rid of the context command #1111

Conversation

Ivo-Yankov
Copy link
Contributor

@Ivo-Yankov Ivo-Yankov commented Jan 6, 2025

Description

This PR merges the context and cluster subcommands into the cluster command by keeping the file structure with separated handler, task etc. files.

Related Issues

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Unit Test Results - Linux

  1 files  ±0   58 suites  ±0   4s ⏱️ -1s
227 tests ±0  227 ✅ ±0  0 💤 ±0  0 ❌ ±0 
232 runs  ±0  232 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit d3db951. ± Comparison against base commit 6e73f57.

This pull request removes 14 and adds 14 tests. Note that renamed tests count towards both.
should prompt for clusters and contexts if selected deployment is not found in local config ‑ ContextCommandTasks unit tests selectContext should prompt for clusters and contexts if selected deployment is not found in local config
should prompt for context if selected cluster is not found in local config mapping ‑ ContextCommandTasks unit tests selectContext should prompt for context if selected cluster is not found in local config mapping
should prompt for context if selected deployment is found in local config but the context is not ‑ ContextCommandTasks unit tests selectContext should prompt for context if selected deployment is found in local config but the context is not
should update clusterContextMapping with provided context ‑ ContextCommandTasks unit tests updateLocalConfig should update clusterContextMapping with provided context
should update currentDeployment with clusters from remoteConfig ‑ ContextCommandTasks unit tests updateLocalConfig should update currentDeployment with clusters from remoteConfig
should update multiple clusterContextMappings with default KubeConfig context if quiet=true ‑ ContextCommandTasks unit tests updateLocalConfig should update multiple clusterContextMappings with default KubeConfig context if quiet=true
should update multiple clusterContextMappings with prompted context no value was provided ‑ ContextCommandTasks unit tests updateLocalConfig should update multiple clusterContextMappings with prompted context no value was provided
should update multiple clusterContextMappings with provided contexts ‑ ContextCommandTasks unit tests updateLocalConfig should update multiple clusterContextMappings with provided contexts
should use clusters and contexts from kubeConfig if selected deployment is not found in local config and quiet=true ‑ ContextCommandTasks unit tests selectContext should use clusters and contexts from kubeConfig if selected deployment is not found in local config and quiet=true
should use context from local config mapping for the first cluster from the selected deployment ‑ ContextCommandTasks unit tests selectContext should use context from local config mapping for the first cluster from the selected deployment
…
should prompt for clusters and contexts if selected deployment is not found in local config ‑ ClusterCommand unit tests cluster connect selectContext should prompt for clusters and contexts if selected deployment is not found in local config
should prompt for context if selected cluster is not found in local config mapping ‑ ClusterCommand unit tests cluster connect selectContext should prompt for context if selected cluster is not found in local config mapping
should prompt for context if selected deployment is found in local config but the context is not ‑ ClusterCommand unit tests cluster connect selectContext should prompt for context if selected deployment is found in local config but the context is not
should update clusterContextMapping with provided context ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update clusterContextMapping with provided context
should update currentDeployment with clusters from remoteConfig ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update currentDeployment with clusters from remoteConfig
should update multiple clusterContextMappings with default KubeConfig context if quiet=true ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with default KubeConfig context if quiet=true
should update multiple clusterContextMappings with prompted context no value was provided ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with prompted context no value was provided
should update multiple clusterContextMappings with provided contexts ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with provided contexts
should use clusters and contexts from kubeConfig if selected deployment is not found in local config and quiet=true ‑ ClusterCommand unit tests cluster connect selectContext should use clusters and contexts from kubeConfig if selected deployment is not found in local config and quiet=true
should use context from local config mapping for the first cluster from the selected deployment ‑ ClusterCommand unit tests cluster connect selectContext should use context from local config mapping for the first cluster from the selected deployment
…

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Unit Test Results - Windows

  1 files  ±0   58 suites  ±0   15s ⏱️ +2s
227 tests ±0  227 ✅ ±0  0 💤 ±0  0 ❌ ±0 
232 runs  ±0  232 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit d3db951. ± Comparison against base commit 6e73f57.

This pull request removes 14 and adds 14 tests. Note that renamed tests count towards both.
should prompt for clusters and contexts if selected deployment is not found in local config ‑ ContextCommandTasks unit tests selectContext should prompt for clusters and contexts if selected deployment is not found in local config
should prompt for context if selected cluster is not found in local config mapping ‑ ContextCommandTasks unit tests selectContext should prompt for context if selected cluster is not found in local config mapping
should prompt for context if selected deployment is found in local config but the context is not ‑ ContextCommandTasks unit tests selectContext should prompt for context if selected deployment is found in local config but the context is not
should update clusterContextMapping with provided context ‑ ContextCommandTasks unit tests updateLocalConfig should update clusterContextMapping with provided context
should update currentDeployment with clusters from remoteConfig ‑ ContextCommandTasks unit tests updateLocalConfig should update currentDeployment with clusters from remoteConfig
should update multiple clusterContextMappings with default KubeConfig context if quiet=true ‑ ContextCommandTasks unit tests updateLocalConfig should update multiple clusterContextMappings with default KubeConfig context if quiet=true
should update multiple clusterContextMappings with prompted context no value was provided ‑ ContextCommandTasks unit tests updateLocalConfig should update multiple clusterContextMappings with prompted context no value was provided
should update multiple clusterContextMappings with provided contexts ‑ ContextCommandTasks unit tests updateLocalConfig should update multiple clusterContextMappings with provided contexts
should use clusters and contexts from kubeConfig if selected deployment is not found in local config and quiet=true ‑ ContextCommandTasks unit tests selectContext should use clusters and contexts from kubeConfig if selected deployment is not found in local config and quiet=true
should use context from local config mapping for the first cluster from the selected deployment ‑ ContextCommandTasks unit tests selectContext should use context from local config mapping for the first cluster from the selected deployment
…
should prompt for clusters and contexts if selected deployment is not found in local config ‑ ClusterCommand unit tests cluster connect selectContext should prompt for clusters and contexts if selected deployment is not found in local config
should prompt for context if selected cluster is not found in local config mapping ‑ ClusterCommand unit tests cluster connect selectContext should prompt for context if selected cluster is not found in local config mapping
should prompt for context if selected deployment is found in local config but the context is not ‑ ClusterCommand unit tests cluster connect selectContext should prompt for context if selected deployment is found in local config but the context is not
should update clusterContextMapping with provided context ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update clusterContextMapping with provided context
should update currentDeployment with clusters from remoteConfig ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update currentDeployment with clusters from remoteConfig
should update multiple clusterContextMappings with default KubeConfig context if quiet=true ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with default KubeConfig context if quiet=true
should update multiple clusterContextMappings with prompted context no value was provided ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with prompted context no value was provided
should update multiple clusterContextMappings with provided contexts ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with provided contexts
should use clusters and contexts from kubeConfig if selected deployment is not found in local config and quiet=true ‑ ClusterCommand unit tests cluster connect selectContext should use clusters and contexts from kubeConfig if selected deployment is not found in local config and quiet=true
should use context from local config mapping for the first cluster from the selected deployment ‑ ClusterCommand unit tests cluster connect selectContext should use context from local config mapping for the first cluster from the selected deployment
…

♻️ This comment has been updated with latest results.

Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
@Ivo-Yankov Ivo-Yankov self-assigned this Jan 6, 2025
Copy link
Contributor

github-actions bot commented Jan 6, 2025

E2E Test Report

 16 files  ±0  121 suites  ±0   1h 23m 3s ⏱️ + 3m 19s
258 tests ±0  258 ✅ ±0  0 💤 ±0  0 ❌ ±0 
261 runs  ±0  261 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit d3db951. ± Comparison against base commit 6e73f57.

This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
function getClusterInfo should return true ‑ ClusterCommand function getClusterInfo should return true
function showClusterList should return right true ‑ ClusterCommand function showClusterList should return right true
solo cluster info should work ‑ ClusterCommand solo cluster info should work
solo cluster list ‑ ClusterCommand solo cluster list

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 6, 2025

E2E Test Report

 16 files  ±0  121 suites  ±0   1h 23m 3s ⏱️ + 3m 19s
258 tests ±0  258 ✅ ±0  0 💤 ±0  0 ❌ ±0 
261 runs  ±0  261 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit d3db951. ± Comparison against base commit 6e73f57.

This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
function getClusterInfo should return true ‑ ClusterCommand function getClusterInfo should return true
function showClusterList should return right true ‑ ClusterCommand function showClusterList should return right true
solo cluster info should work ‑ ClusterCommand solo cluster info should work
solo cluster list ‑ ClusterCommand solo cluster list

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.42% (target: -1.00%) 78.79%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d8903a8) 20011 17110 85.50%
Head commit (d3db951) 20039 (+28) 17218 (+108) 85.92% (+0.42%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1111) 561 442 78.79%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 78.07487% with 123 lines in your changes missing coverage. Please review.

Project coverage is 85.08%. Comparing base (d8903a8) to head (d3db951).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/commands/cluster/index.ts 40.74% 64 Missing ⚠️
src/commands/cluster/handlers.ts 85.71% 21 Missing ⚠️
src/commands/cluster/configs.ts 83.87% 19 Missing and 1 partial ⚠️
src/commands/cluster/tasks.ts 87.67% 15 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1111      +/-   ##
==========================================
+ Coverage   84.66%   85.08%   +0.41%     
==========================================
  Files          76       75       -1     
  Lines       20038    20039       +1     
  Branches     1489     1313     -176     
==========================================
+ Hits        16965    17050      +85     
+ Misses       2989     2962      -27     
+ Partials       84       27      -57     
Files with missing lines Coverage Δ
src/commands/base.ts 97.30% <100.00%> (+1.49%) ⬆️
src/commands/cluster/flags.ts 100.00% <100.00%> (ø)
src/commands/cluster/tasks.ts 94.01% <87.67%> (ø)
src/commands/cluster/configs.ts 83.87% <83.87%> (ø)
src/commands/cluster/handlers.ts 85.71% <85.71%> (ø)
src/commands/cluster/index.ts 40.74% <40.74%> (ø)

... and 21 files with indirect coverage changes

Impacted file tree graph

@Ivo-Yankov Ivo-Yankov marked this pull request as ready for review January 6, 2025 20:04
@Ivo-Yankov Ivo-Yankov requested review from leninmehedy and a team as code owners January 6, 2025 20:04
@jeromy-cannon jeromy-cannon merged commit a9ba0c4 into main Jan 7, 2025
42 of 45 checks passed
@jeromy-cannon jeromy-cannon deleted the 01082-merge-the-subcommands-from-context-into-cluster-and-get-rid-of-the-context-command branch January 7, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

merge the subcommands from context into cluster, and get rid of the context command
2 participants