Skip to content

Branch remote runner plugin#23

Draft
proto-aiken-13 wants to merge 17 commits into
source-academy:mainfrom
proto-aiken-13:branch-remoteRunnerPlugin
Draft

Branch remote runner plugin#23
proto-aiken-13 wants to merge 17 commits into
source-academy:mainfrom
proto-aiken-13:branch-remoteRunnerPlugin

Conversation

@proto-aiken-13

Copy link
Copy Markdown

Set up a remote runner plugin under the runner/dist directory to receive code from the ev3 engine in py-slang

@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f9fa921

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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

Copy link
Copy Markdown

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 establishes a monorepo structure for plugins using Yarn workspaces, adding configuration files for ESLint, Prettier, Jest, and VSCode, alongside a custom build script to manage plugin manifests. It also bootstraps initial test packages for common, runner, and web environments. The code review highlights several critical issues that must be addressed before merging, including a missing type export (PySlangMessage), hardcoded absolute local file paths in imports and tsconfig.json mappings, incorrect import paths in tests, a hardcoded failing test assertion, and a class naming convention violation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


export const CHANNEL_ID = "test";

export type TestMessage = "ping" | "pong";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The type PySlangMessage is imported by both src/runner/test/src/remoteExecution/index.ts and src/runner/test/src/__tests__/runner.test.ts from @sourceacademy/common-test, but it is not defined or exported here. This will cause compilation errors. Please define and export PySlangMessage in this file.

Suggested change
export type TestMessage = "ping" | "pong";
export type TestMessage = "ping" | "pong";
export type PySlangMessage = {
type: "run";
code: string;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

++, but put it in a separate common/remoteExecution package

@@ -0,0 +1,26 @@
import { CHANNEL_ID, RUNNER_ID, type PySlangMessage } from "@sourceacademy/common-test";
import { IPlugin, IChannel, IConduit } from "@sourceacademy/conductor/conduit";
import { EV3Engine } from "C:/Users/Migue/OneDrive/Desktop/Projects/py-slang-2/src/engines/ev3/EV3Engine";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Avoid using absolute local file paths (e.g., C:/Users/...) for imports, as this will fail to compile on any other machine or in CI/CD environments. Since py-slang is listed as a dependency in package.json, you should import EV3Engine directly from the py-slang package.

Suggested change
import { EV3Engine } from "C:/Users/Migue/OneDrive/Desktop/Projects/py-slang-2/src/engines/ev3/EV3Engine";
import { EV3Engine } from "py-slang";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

++

Comment on lines +8 to +11
"rootDir": ".",
"paths": {
"@py-slang/*": ["C:/Users/Migue/OneDrive/Desktop/Projects/py-slang-2/src/*"]
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Avoid hardcoding absolute local paths in tsconfig.json path mappings, as this breaks compilation on other environments. Since py-slang is installed as a package dependency, this path mapping is unnecessary and should be removed.

    "rootDir": "."

@@ -0,0 +1,25 @@
import { remoteRunnerPlugin } from "..";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The import of remoteRunnerPlugin from ".." (which points to src/runner/test/src/index.ts) will fail because remoteRunnerPlugin is not exported from the package entry point. Import it directly from the relative path ../remoteExecution to fix the test compilation, and consider exporting it from src/runner/test/src/index.ts if it is intended to be part of the public API.

Suggested change
import { remoteRunnerPlugin } from "..";
import { remoteRunnerPlugin } from "../remoteExecution";


expect(sentMessages.length).toBeGreaterThan(0);
console.log(sentMessages[0]);
expect(sentMessages[0]).toEqual("FORCE_FAIL_TO_SEE_OUTPUT");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The assertion expect(sentMessages[0]).toEqual("FORCE_FAIL_TO_SEE_OUTPUT"); is hardcoded to fail. This was likely added for debugging purposes to inspect the output. Please replace it with a proper assertion matching the expected output of the engine execution so that the test suite can pass in CI.

Suggested change
expect(sentMessages[0]).toEqual("FORCE_FAIL_TO_SEE_OUTPUT");
expect(sentMessages[0]).toBeDefined();

import { IPlugin, IChannel, IConduit } from "@sourceacademy/conductor/conduit";
import { EV3Engine } from "C:/Users/Migue/OneDrive/Desktop/Projects/py-slang-2/src/engines/ev3/EV3Engine";

export class remoteRunnerPlugin implements IPlugin {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Following standard TypeScript naming conventions, class names should use PascalCase. Please rename remoteRunnerPlugin to RemoteRunnerPlugin and update all references accordingly.

Suggested change
export class remoteRunnerPlugin implements IPlugin {
export class RemoteRunnerPlugin implements IPlugin {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

++

@AaravMalani

Copy link
Copy Markdown
Member

Could you please rebase the branch off main instead of the init-infra branch (ensure the main branch is not out of date, check out your local branch, run git rebase --onto main 7e9293f, then git push --force-with-lease), so the merge conflicts go away? Thanks!

@AaravMalani AaravMalani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I may have missed a couple of changes, but for now, I have a couple of recommendations

  1. Rebase the branch onto main as mentioned in the previous comments (it'll help me look through your code easily as well)
  2. Move the remote execution code into a separate folder. Each directory under the runner, common and web represents a distinct package. They'll each have their own package.json, manifest, etc. and get published as a separate package (if they're installable) or deployed onto GitHub Pages under a separate plugin definition in the plugin directory (if they're external)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The remoteExecution directory would be a sibling of the runner/test directory, not a child of it.

runner
├─── test
└─── remoteExecution

It would have its own manifest, package.json, rollup.config.mjs, etc.
Just make a copy of the runner/test directory and rename it to runner/remoteExecution.

import { IPlugin, IChannel, IConduit } from "@sourceacademy/conductor/conduit";
import { EV3Engine } from "C:/Users/Migue/OneDrive/Desktop/Projects/py-slang-2/src/engines/ev3/EV3Engine";

export class remoteRunnerPlugin implements IPlugin {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

++

@@ -0,0 +1,26 @@
import { CHANNEL_ID, RUNNER_ID, type PySlangMessage } from "@sourceacademy/common-test";
import { IPlugin, IChannel, IConduit } from "@sourceacademy/conductor/conduit";
import { EV3Engine } from "C:/Users/Migue/OneDrive/Desktop/Projects/py-slang-2/src/engines/ev3/EV3Engine";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

++


constructor(
_conduit: IConduit,
[channel]: IChannel<any>[],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You might have to ESLint ignore this line for now, otherwise it throws a warning

@@ -0,0 +1,26 @@
import { CHANNEL_ID, RUNNER_ID, type PySlangMessage } from "@sourceacademy/common-test";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It shouldn't share the same CHANNEL_ID and RUNNER_ID as the test package
They are separate plugins


export const CHANNEL_ID = "test";

export type TestMessage = "ping" | "pong";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

++, but put it in a separate common/remoteExecution package

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.

2 participants