Skip to content

Conversation

@Matios102
Copy link
Contributor

This pull request removes the dedicated compiler stage from the codebase, shifting compilation responsibility into the executor stage. The pipeline now detects compilation errors by checking for output in the compilation error file after execution, rather than relying on a separate compiler interface. The changes also update related tests and dependency injection throughout the codebase to reflect this architectural change.

Pipeline and Architecture Refactor:

  • Removed the compiler stage and interface from the worker pipeline, dependency injection, and related code, consolidating compilation into the executor stage (cmd/main.go, internal/pipeline/pipeline.go, generate_mocks.sh) [1] [2] [3] [4] [5] [6] [7] [8].

  • Updated the task processing logic to check for compilation errors by inspecting the compilation error file after execution, instead of invoking a compiler interface. This includes handling for both success and error flows (internal/pipeline/pipeline.go) [1] [2] [3] [4].

Testing Updates:

  • Refactored all pipeline tests to remove usage of the compiler mock, update mock setups, and simulate compilation errors by writing directly to the compile error file in the executor mock (internal/pipeline/pipeline_test.go) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12].

Docker and Build Environment:

  • Removed the installation of g++ from both the builder and runtime images in the Dockerfile, reflecting the removal of the dedicated compiler stage (Dockerfile) [1] [2].

Executor and Docker Client Enhancements:

  • Updated the Docker client interface and implementation to add an alwaysCopyFiles parameter for more flexible file extraction from containers (internal/docker/docker_client.go) [1] [2] [3].

Matios102 and others added 17 commits December 29, 2025 12:43
…ced process management; update max path depth in validation from 1 to 2
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

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

This PR refactors the architecture to move compilation into the containerized executor stage, eliminating the dedicated compiler interface and host-based compilation. Compilation now occurs inside Docker containers, with errors detected by checking a compilation error file after execution completes. This change simplifies the pipeline and removes the dependency on g++ in the host environment.

Key Changes

  • Removed the compiler stage, interface, and all related code, consolidating compilation into the executor stage where it runs inside containers
  • Modified the pipeline to detect compilation errors by checking file size after execution instead of catching exceptions from a compiler interface
  • Enhanced the Docker client and tar extraction utilities to support an alwaysCopyFiles parameter, ensuring compilation error files are always extracted from containers

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
cmd/main.go Removed compiler initialization and dependency injection
Dockerfile Removed g++ from builder and runtime images as compilation now happens in containers
generate_mocks.sh Removed compiler mock generation
internal/docker/docker_client.go Added alwaysCopyFiles parameter to enable extracting compilation error files regardless of directory restrictions
internal/pipeline/pipeline.go Removed compiler dependency, added compilation error detection via file size check after execution
internal/scheduler/scheduler.go Removed compiler from scheduler constructor and worker initialization
internal/scheduler/scheduler_test.go Updated tests to remove compiler mock usage
internal/stages/compiler/compiler.go Deleted entire compiler interface and implementation
internal/stages/compiler/compiler_test.go Deleted compiler tests
internal/stages/compiler/cpp_compiler.go Deleted C++ compiler implementation
internal/stages/compiler/cpp_compiler_test.go Deleted C++ compiler tests
internal/stages/executor/cpp/Dockerfile Added g++ to container runtime to support in-container compilation
internal/stages/executor/executor.go Added buildCompileCommand function and compilation-related fields to CommandConfig, updated environment variables to pass compilation commands to container
internal/stages/executor/executor_test.go Updated mock expectations to account for new alwaysCopyFiles parameter
internal/stages/executor/run_tests.sh Added compilation logic to handle in-container compilation before test execution
internal/pipeline/pipeline_test.go Refactored all tests to remove compiler mocks and simulate compilation errors via file writes
tests/mocks/mocks_generated.go Removed compiler mock, updated Docker client mock signature
utils/utils.go Refactored ExtractTarArchiveFiltered to support alwaysCopyFiles parameter, added helper functions and context struct for cleaner code organization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HermanPlay HermanPlay changed the base branch from task/runtime-container-safety to master January 11, 2026 11:32
@Matios102 Matios102 requested a review from HermanPlay January 12, 2026 20:25
@Matios102 Matios102 merged commit ad9c961 into master Jan 13, 2026
1 check passed
@Matios102 Matios102 deleted the task/containerized-compilation branch January 13, 2026 10:56
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.

3 participants