Skip to content

change trex plugin build#104

Merged
p-hoffmann merged 1 commit into
developfrom
p-hoffmann/npmpkg
Jul 26, 2025
Merged

change trex plugin build#104
p-hoffmann merged 1 commit into
developfrom
p-hoffmann/npmpkg

Conversation

@p-hoffmann

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 26, 2025 04:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 modernizes the build process by replacing the local Rust compilation of the trex plugin with a Docker-based approach. The changes eliminate the need to compile Rust code locally and instead use a pre-built Docker image containing the trex binary.

  • Switches from local trex binary execution to Docker containerized execution
  • Adds environment variable validation for Docker tag specification
  • Removes Rust compilation steps from CI workflow

Reviewed Changes

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

File Description
scripts/build.ts Replaces local trex execution with Docker container approach and adds environment variable validation
.github/workflows/npm-ci.yml Removes Rust compilation and cargo-related build steps
Comment thread scripts/build.ts
Comment on lines +28 to +29
"-v", `${Deno.cwd()}:${Deno.cwd()}`,
"-w", Deno.cwd(),

Copilot AI Jul 26, 2025

Copy link

Choose a reason for hiding this comment

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

Mounting the current working directory with the same path inside the container could expose sensitive files and create security risks. Consider using a more restrictive mount point or mounting only the necessary directories.

Suggested change
"-v", `${Deno.cwd()}:${Deno.cwd()}`,
"-w", Deno.cwd(),
"-v", `${function_path2}:${function_path2}`,
"-w", function_path2,
Copilot uses AI. Check for mistakes.
Comment thread scripts/build.ts
"run", "--rm",
"-v", `${Deno.cwd()}:${Deno.cwd()}`,
"-w", Deno.cwd(),
`ghcr.io/data2evidence/d2e-trex-base:${dockerTag}`,

Copilot AI Jul 26, 2025

Copy link

Choose a reason for hiding this comment

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

Using an environment variable to specify the Docker image tag without validation could allow injection of malicious image references. Consider validating the dockerTag format or restricting it to known safe values.

Copilot uses AI. Check for mistakes.
Comment thread scripts/build.ts
"/usr/src/trex",
..._args
];
let cmd = new Deno.Command("docker", { args: dockerArgs });

Copilot AI Jul 26, 2025

Copy link

Choose a reason for hiding this comment

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

If Docker is not installed or available, this will fail with a potentially unclear error message. Consider adding a check for Docker availability or improving error handling to provide clearer feedback.

Copilot uses AI. Check for mistakes.
@p-hoffmann p-hoffmann merged commit 18473df into develop Jul 26, 2025
8 checks passed
@p-hoffmann p-hoffmann deleted the p-hoffmann/npmpkg branch July 26, 2025 05:19
@p-hoffmann p-hoffmann restored the p-hoffmann/npmpkg branch July 26, 2025 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants