-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
feature: significantly increase build speed #113
Conversation
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
WalkthroughThis pull request introduces significant changes to the project's structure and functionality. It primarily focuses on enhancing the handling of Go modules and plugins, with the addition of concurrent processing for fetching module information from GitHub. The changes also include updates to dependencies, renaming of functions and fields, and the addition of new test cases. Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 9
Files ignored due to filter (2)
- go.mod
- go.sum
Files selected for processing (11)
- .gitignore (1 hunks)
- builder/builder.go (6 hunks)
- builder/template_test.go (3 hunks)
- builder/templates/entry.go (1 hunks)
- builder/templates/templateV2023.go (1 hunks)
- cmd/vx/main.go (1 hunks)
- github/modinfo.go (1 hunks)
- github/parse_test.go (1 hunks)
- github/pool.go (1 hunks)
- github/repo.go (4 hunks)
- modulesInfo.go (1 hunks)
Files skipped from review due to trivial changes (5)
- .gitignore
- builder/templates/templateV2023.go
- cmd/vx/main.go
- github/parse_test.go
- modulesInfo.go
Additional comments (Suppressed): 13
builder/templates/entry.go (1)
- 10-19: The
Version
field has been replaced withPseudoVersion
. Ensure that all references to this field in the codebase have been updated accordingly. Also, verify that the newPseudoVersion
field is being correctly populated and used where needed.builder/template_test.go (3)
14-22: The new hunk introduces three new imports for plugins
aba
,abc
, andabd
. Ensure these plugins are available and compatible with the current system.33-41: The new hunk introduces three new plugin instances
aba
,abc
, andabd
. Ensure these plugins are initialized correctly and their usage is as expected.50-73: The new hunk introduces three new entries for plugins
aba
,abc
, andabd
in thett.Entries
slice. Ensure these entries are correctly formatted and their usage is as expected.github/repo.go (4)
3-7: The
bufio
package is removed from the import list. Ensure that this does not affect any other parts of the code that might be using it.16-19: The
github.com/google/go-github
package version is updated fromv49
tov53
. Make sure that this version change does not introduce any breaking changes or incompatibilities.36-42: The comment on line 39 is slightly modified. This change does not affect the functionality of the code.
196-217: The
GetPluginsModData
function is significantly refactored to use a pool executor for concurrent data fetching. This should improve performance by parallelizing network operations. However, ensure that error handling and data consistency are maintained in the concurrent environment. Also, verify that the pool executor is correctly implemented and managed.github/modinfo.go (1)
- 16-28: The function
parseModuleInfo
is not handling the case when the module name does not contain a version. Iflen(match) <= 1
, the function will return a pseudo version with an empty version string. This might not be the intended behavior. Consider adding error handling or a default case for when the version is not found in the module name.builder/builder.go (4)
63-71: The
Version
field intemplates.Entry
struct is replaced withPseudoVersion
. Ensure that all references to this field in the codebase have been updated to match the new field name. Also, verify that thePseudoVersion
field is correctly populated and used throughout the codebase.165-170: The
goGetMod
function is replaced withgoModDownloadCmd
andgoModTidyCmd
functions. This change could improve the build speed by downloading all module dependencies at once instead of one by one. However, ensure that thego mod download
command correctly downloads all required module dependencies and thego mod tidy
command correctly cleans up the module dependencies.257-262: The
goModDownloadCmd
function is introduced to execute thego mod download
command. This function should correctly download all module dependencies. However, ensure that the function correctly handles any errors that may occur during the execution of the command.272-278: The
goModTidyCmd
function is renamed fromgoGetMod
and now executes thego mod tidy
command. This function should correctly clean up the module dependencies. However, ensure that the function correctly handles any errors that may occur during the execution of the command.
Reason for This PR
Description of Changes
Parallelize network operations as much as possible.
Approx 10x faster builds:
Right - Old, Left - New velox (
go clean -modcache
), first run:18.14s vs 275.06s
3.5s vs 36s
License Acceptance
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).CHANGELOG.md
.Summary by CodeRabbit
Release Notes:
velox
package. This change allows users to specify pseudo-versions for their Go modules.github
package that includes functionality for parsing module information and interacting with the GitHub API.github.com/google/go-github
package from version 49 to version 53, enhancing the interaction with the GitHub API.github
package, ensuring the correct parsing of module information.github.com/spf13/viper
from v1.15.0 to v1.17.0, and added new dependenciesgithub.com/roadrunner-server/informer/v4
andgithub.com/roadrunner-server/resetter/v4
.