Skip to content

Add RoadRunner building #65

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

Open
wants to merge 26 commits into
base: 1.x
Choose a base branch
from
Open

Add RoadRunner building #65

wants to merge 26 commits into from

Conversation

roxblnfk
Copy link
Member

What was changed

This pull request introduces support for the Velox build system, enhances binary handling, and refactors task management in the DLoad module. Key changes include the addition of Velox-specific elements in the XML schema, a new Build command for custom binary creation, updates to binary provider methods, and improvements to task management with promise-based handling.

Velox Build System Integration:

  • Added a new <velox> element to the dload.xsd schema for defining Velox build actions, including attributes for version constraints, plugins, and configuration files.
  • Registered Velox in resources/software.json with metadata such as binary name, version command, and GitHub repository.
  • Introduced a Build command in src/Command/Build.php to execute Velox build actions defined in the configuration file.

Binary Handling Enhancements:

  • Updated BinaryProvider to use a new method getLocalBinary, which includes the software name for more precise binary resolution. Changes applied in src/Command/Show.php and src/DLoad.php. [1] [2] [3]

Task Management Refactor:

  • Replaced TaskManager with a more generic Manager class in src/DLoad.php.
  • Refactored the addTask method in src/DLoad.php to return a PromiseInterface and handle task results asynchronously. [1] [2]

These changes collectively enhance the flexibility and functionality of the DLoad module, particularly for users needing custom binary builds or improved binary management.

Why?

Checklist

roxblnfk added 20 commits July 8, 2025 12:57
@roxblnfk roxblnfk requested a review from Copilot July 11, 2025 13:14
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds RoadRunner custom build support via Velox and refactors core task and binary resolution to a promise-based API.

  • Integrates Velox build actions in the XML schema and configuration metadata
  • Introduces a new build CLI command with VeloxBuilder and associated task/result models
  • Refactors binary provider methods and replaces the old TaskManager with a promise‐driven Manager

Reviewed Changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Service/Container.php Extended bind signature to allow class‐string aliases
src/Module/Velox/Task.php Added Task model for executing Velox builds
src/Module/Velox/Result.php Added Result model capturing build output and metadata
src/Module/Velox/Internal/VeloxBuilder.php Implemented Velox build logic and temporary directory handling
src/Module/Velox/Internal/DependencyChecker.php Added dependency resolution for Go and Velox binaries
src/Module/Velox/Exception/Dependency.php New exception for unmet build dependencies
src/Module/Velox/Exception/Config.php New exception for invalid/failed configuration
src/Module/Velox/Exception/Build.php Base exception class for all build errors
src/Module/Velox/Exception/Api.php New exception for API failures
src/Module/Velox/Builder.php Interface defining the Velox build contract
src/Module/Velox/ApiClient.php Interface for remote Velox configuration API
src/Module/Task/Progress.php Moved Progress class into a shared task namespace
src/Module/Task/Manager.php Replaced TaskManager with a Manager using promises
src/Module/Downloader/Task/DownloadTask.php Updated import to the new Progress namespace
src/Module/Downloader/Internal/DownloadContext.php Updated import to the new Progress namespace
src/Module/Downloader/Downloader.php Switched temp‐dir creation to FS::tmpDir
src/Module/Config/Schema/Downloader.php Tightened tmpDir type to `non-empty-string
src/Module/Config/Schema/Actions.php Added veloxBuilds list for Velox build actions
src/Module/Config/Schema/Action/Velox/Plugin.php New schema class for Velox plugins
src/Module/Config/Schema/Action/Velox.php New schema for <velox> build actions
src/Module/Common/Internal/ObjectContainer.php Enhanced bind to support string‐alias class names
src/Module/Common/FileSystem/Path.php Minor doc updates for __toString formatting
src/Module/Common/FileSystem/FS.php New file system utility class
src/Module/Common/DloadResult.php New wrapper for download task results
src/Module/Binary/Internal/LocalBinary.php Added LocalBinary implementation
src/Module/Binary/Internal/GlobalBinary.php Added GlobalBinary implementation
src/Module/Binary/Internal/BinaryProviderImpl.php Updated to getLocalBinary/getGlobalBinary methods
src/Module/Binary/Internal/BinaryExecutor.php Improved logging and return‐type clarity for execute
src/Module/Binary/Internal/AbstractBinary.php Refactored into AbstractBinary with unified execution logic
src/Module/Binary/BinaryProvider.php Updated interface for local/global binary resolution
src/Module/Binary/Binary.php Extended interface to include execute signature
src/DLoad.php Refactored addTask to return a PromiseInterface using Manager
src/Command/Show.php Switched to getLocalBinary and Path object for cwd resolution
src/Command/Build.php New CLI command to trigger Velox build actions
src/Bootstrap.php Updated container bindings for Builder and binary provider
resources/software.json Registered Velox in the software metadata file
dload.xsd Extended XSD schema to include <velox> actions
Comments suppressed due to low confidence (3)

src/Module/Velox/Internal/VeloxBuilder.php:43

  • This build method orchestrates multiple steps (dependency checks, config prep, build execution) but lacks accompanying unit tests. Consider adding tests for successful and failure scenarios to ensure coverage.
    public function build(VeloxAction $config, \Closure $onProgress): Task

src/Bootstrap.php:109

  • BinaryProviderImpl is not imported in this file, causing an undefined class error. Add use Internal\DLoad\Module\Binary\Internal\BinaryProviderImpl; at the top of the file.
        $this->container->bind(BinaryProvider::class, BinaryProviderImpl::class);

src/Bootstrap.php:110

  • Factory is not imported or defined in this namespace, leading to an unresolved class. Import the correct HTTP client factory interface (e.g., use Internal\DLoad\Module\HttpClient\Factory;).
        $this->container->bind(Factory::class, NyholmFactoryImpl::class);

Copy link

codecov bot commented Jul 27, 2025

Codecov Report

❌ Patch coverage is 13.52941% with 441 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Module/Velox/Internal/DependencyChecker.php 0.00% 154 Missing ⚠️
src/Module/Velox/Internal/VeloxBuilder.php 0.00% 90 Missing ⚠️
src/Command/Build.php 0.00% 34 Missing ⚠️
src/Module/Common/FileSystem/FS.php 0.00% 34 Missing ⚠️
src/Module/Binary/Internal/GlobalBinary.php 0.00% 23 Missing ⚠️
src/Module/Binary/Internal/AbstractBinary.php 0.00% 18 Missing ⚠️
src/Module/Velox/Task.php 0.00% 16 Missing ⚠️
src/DLoad.php 86.25% 11 Missing ⚠️
src/Module/Binary/Internal/BinaryProviderImpl.php 0.00% 10 Missing ⚠️
src/Module/Common/Internal/ObjectContainer.php 0.00% 8 Missing ⚠️
... and 12 more
Files with missing lines Coverage Δ Complexity Δ
src/Module/Binary/BinaryVersion.php 100.00% <ø> (ø) 7.00 <0.00> (ø)
src/Module/Common/FileSystem/Path.php 96.46% <ø> (ø) 50.00 <0.00> (ø)
src/Module/Downloader/Internal/DownloadContext.php 0.00% <ø> (ø) 1.00 <0.00> (ø)
src/Module/Downloader/SoftwareCollection.php 0.00% <ø> (ø) 8.00 <0.00> (ø)
src/Module/Downloader/Task/DownloadTask.php 0.00% <ø> (ø) 1.00 <0.00> (ø)
src/Module/Task/Progress.php 0.00% <ø> (ø) 1.00 <0.00> (?)
src/Module/Downloader/Downloader.php 0.00% <0.00%> (ø) 37.00 <0.00> (ø)
src/Module/Velox/Exception/Api.php 0.00% <0.00%> (ø) 1.00 <1.00> (?)
src/Module/Velox/Exception/Build.php 0.00% <0.00%> (ø) 1.00 <1.00> (?)
src/Module/Velox/Exception/Config.php 0.00% <0.00%> (ø) 1.00 <1.00> (?)
... and 18 more

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Add build or velox action
1 participant