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

Refactor out copyConcurrency calculation in install.copyFiles() #4287

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

pchila
Copy link
Member

@pchila pchila commented Feb 20, 2024

What does this PR do?

Extract the copyConcurrency parameter out of copyFiles() function allows for a simpler function signature and removes a dependency on cli.IOStreams that was used only to output an error log. The functions copyFiles() and calculateCopyConcurrency() implement a better separation of concerns.

Why is it important?

General cleanliness of code and testability

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

@pchila pchila self-assigned this Feb 20, 2024
@pchila pchila requested a review from a team as a code owner February 20, 2024 08:33
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@pchila pchila force-pushed the cleanup-copy-files-during-install branch from 97a5945 to 3513ea2 Compare February 20, 2024 08:40
@pchila pchila requested a review from ycombinator February 20, 2024 08:41
@pchila pchila force-pushed the cleanup-copy-files-during-install branch from 3513ea2 to 66eb059 Compare February 21, 2024 11:11
@pchila pchila added the chore Tasks that just need to be done, they are neither bug, nor enhancements label Feb 21, 2024
@cmacknz cmacknz requested a review from AndersonQ February 21, 2024 14:18
Copy link
Contributor

mergify bot commented Feb 21, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b cleanup-copy-files-during-install upstream/cleanup-copy-files-during-install
git merge upstream/main
git push upstream cleanup-copy-files-during-install

@pchila pchila force-pushed the cleanup-copy-files-during-install branch from 66eb059 to f594f48 Compare February 21, 2024 15:36
Extract the copyConcurrency parameter out of copyFiles() function allows
for a simpler function signature and removes a dependency on
cli.IOStreams that was used only to output an error log.
The functions copyFiles() and calculateCopyConcurrency() implement a
better separation of concerns.
@pchila pchila force-pushed the cleanup-copy-files-during-install branch from f594f48 to 2bdceeb Compare February 21, 2024 17:04
Copy link

Quality Gate passed Quality Gate passed

The SonarQube Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
25.0% 25.0% Coverage on New Code
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

👌

@pchila pchila merged commit 6899b75 into elastic:main Feb 22, 2024
@pchila pchila deleted the cleanup-copy-files-during-install branch February 22, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip chore Tasks that just need to be done, they are neither bug, nor enhancements refactoring skip-changelog Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor out copy parallelism from install copyFiles() function
3 participants