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

support deleted files in kusion deps cmd #96

Merged
merged 9 commits into from
Jul 18, 2022

Conversation

amyXia1994
Copy link
Contributor

@amyXia1994 amyXia1994 commented Jul 14, 2022

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

2. What is the scope of this PR (e.g. component or file name):

  • pkg/kusionctl/cmd/deps/options.go
  • go.mod: In order to update the latest kclvm-go deps API, the kclvm-go version in go.mod is updated to v0.4.3-alpha.1

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

before the PR, the in-existing file paths as --focus option is not allowed in using the kusion deps command to find downstream stacks/projects and the in-existing file paths will cause an "invalid focus path" error.
This PR support deleted files in kusion deps --focus option, and slightly improves the performance of that command.

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

This PR adds some unit tests and benchmarks on the core logic about down stream stacks/projects analyzing.

This PR brings some reduction on memory usage result based on the testdata and brings about 50% time and memory consumption base on a 2000+ stacks Konfig repository.

benchstat result on processing downstream stacks/projects of the testdata:

DownStream-4    5.73ms ±40%    4.52ms ±14%     ~     (p=0.222 n=5+5)

name          old alloc/op   new alloc/op   delta
DownStream-4     241kB ± 0%     196kB ± 0%  -18.81%  (p=0.008 n=5+5)

name          old allocs/op  new allocs/op  delta
DownStream-4     2.04k ± 0%     1.58k ± 0%  -22.44%  (p=0.008 n=5+5)

benchstat result on procession a 2000+ stacks Konfig repository:

name                             old time/op    new time/op    delta
KonfigTotal_siteBuild_simple-4      15.7s ±16%      6.9s ±36%  -56.00%  (p=0.008 n=5+5)                                                                                        
KonfigTotal_siteBuild_complex-4     18.0s ±14%      9.6s ± 9%  -46.79%  (p=0.016 n=5+4)

name                             old alloc/op   new alloc/op   delta
KonfigTotal_siteBuild_simple-4     1.04GB ± 0%    0.33GB ± 0%  -68.13%  (p=0.008 n=5+5)
KonfigTotal_siteBuild_complex-4    1.04GB ± 0%    0.42GB ± 0%  -59.65%  (p=0.008 n=5+5)

name                             old allocs/op  new allocs/op  delta
KonfigTotal_siteBuild_simple-4      7.12M ± 0%     2.78M ± 0%  -60.88%  (p=0.008 n=5+5)
KonfigTotal_siteBuild_complex-4     7.12M ± 0%     3.27M ± 0%  -53.99%  (p=0.008 n=5+5)

6. Release note

support deleted files in ```--focus```option. of the ```kusion deps``` command.

@amyXia1994 amyXia1994 requested review from a team July 14, 2022 07:57
@coveralls
Copy link

coveralls commented Jul 15, 2022

Coverage Status

Coverage increased (+0.5%) to 73.045% when pulling 7b0c24d on dev/xiarui.xr/deps-support-deleted into 6d8d86f on main.

@amyXia1994 amyXia1994 force-pushed the dev/xiarui.xr/deps-support-deleted branch from 57c6bfa to 06d049c Compare July 15, 2022 08:34
Copy link
Contributor

@elliotxx elliotxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@amyXia1994 amyXia1994 merged commit c28949c into main Jul 18, 2022
@amyXia1994 amyXia1994 deleted the dev/xiarui.xr/deps-support-deleted branch July 18, 2022 07:44
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants