Skip to content

run: add command package runner support#2689

Draft
joeykchen wants to merge 2 commits intogoplus:mainfrom
joeykchen:feature/command-runner
Draft

run: add command package runner support#2689
joeykchen wants to merge 2 commits intogoplus:mainfrom
joeykchen:feature/command-runner

Conversation

@joeykchen
Copy link
Copy Markdown

No description provided.

@joeykchen joeykchen marked this pull request as draft March 30, 2026 14:29
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements a command runner feature for the gop run command, allowing projects to define custom runners in their gop.mod files. The changes include logic for resolving project directories, building or installing runner binaries, and executing them. Review feedback suggests propagating errors from xgomod.Load instead of swallowing them and notes that the current implementation only supports the first project defined in a gop.mod file, which could lead to issues in multi-project configurations.

@xgopilot
Copy link
Copy Markdown

xgopilot bot commented Mar 30, 2026

Overall: Clean separation across runner.go / runner_binary.go / runner_project.go with solid test coverage. A few items worth addressing: the validateMainPackage call is both a redundant process spawn and a TOCTOU window — go build already rejects non-main packages. lookupModulePackage silently swallows all errors (including permission errors, corrupt go.mod), which could mask real problems. Consider adding runner path validation and documenting the trust model for the new runner directive.

@joeykchen joeykchen force-pushed the feature/command-runner branch from 54f60c7 to 614cb07 Compare April 2, 2026 11:40
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.12%. Comparing base (be09c49) to head (3ab2c34).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2689   +/-   ##
=======================================
  Coverage   94.12%   94.12%           
=======================================
  Files          32       32           
  Lines       10054    10054           
=======================================
  Hits         9463     9463           
  Misses        421      421           
  Partials      170      170           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@joeykchen joeykchen force-pushed the feature/command-runner branch from 3ab2c34 to 93d69a7 Compare April 3, 2026 03:58
@xgopilot
Copy link
Copy Markdown

xgopilot bot commented Apr 3, 2026

@joeykchen Thanks for the trigger request.

This repository currently enforces member-only triggers, and your account does not have repository membership access, so xgopilot cannot run for this request.

To proceed, you can:

  • Ask a repository maintainer to add you as a collaborator/member, or
  • Update .xgopilot.yml and set require_member_to_trigger: false.

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.

1 participant