Deploy conductor-ready modules to modules-conductor #680
Conversation
Deploys build artifacts from the conductor-migration branch to source-academy/modules-conductor via GitHub Pages, allowing the conductor version of modules to coexist with the current deployment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
| - name: include java json | ||
| run: cp -r src/java build |
There was a problem hiding this comment.
Bug: The cp -r src/java build command will cause the workflow to fail if the src/java directory does not exist, as there is no error handling.
Severity: HIGH
Suggested Fix
Wrap the cp command in a conditional check to ensure it only runs if the src/java directory exists. For example: if [ -d src/java ]; then cp -r src/java build; fi. This prevents the step from failing if the directory is absent.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: .github/workflows/conductor-deploy.yml#L38-L39
Potential issue: The `conductor-deploy.yml` workflow includes the command `cp -r
src/java build`. This command will fail with a non-zero exit code if the `src/java`
directory does not exist on the branch where the workflow is triggered. Since GitHub
Actions treats non-zero exit codes as step failures by default and there is no
conditional check or `continue-on-error` flag, the entire deployment workflow will halt
and fail. The `src/java` directory does not currently exist in the repository's main
branch, making this failure a realistic scenario.
Did we get this right? 👍 / 👎 to inform future reviews.
RichDom2185
left a comment
There was a problem hiding this comment.
I don't get the purpose of this PR, is it for CD? What's left to get it out of draft status?
Every push to this branch updates the modules-conductor repo. So yea, it's for CD in that sense. Having a PR allows us to easily merge any commits to the main branch into this branch, to keep modules-conductor up-to-date. |
I agree, but this sounds like this is a PR for the development trunk instead of CD then. In which case it would remain in draft forever and the workflow never get merged or run? |
…ntation) (#698) * feat(repeat): migrate initial repeat module * feat(conductor): fix conductor documentation * chore: add testing plugin * fix: add chaining for undefined blockTags * fix: make changes as per review
Resolves conflicts from master's "Better Type Errors" refactor (#607) landing on the stale conductor-migration branch: - lib/buildtools/src/build/docs/index.ts: keep master's typedoc-plugin based output generation, re-add normalizeConductorDocs() calls. - src/bundles/repeat/package.json: merge master's version bump/catalog deps with the Conductor devDependencies. - src/bundles/repeat/src/functions.ts: keep the Conductor async-generator implementation, add back integer-range validation for n, and keep a synchronous repeat_internal export since the rune bundle depends on it directly. - src/bundles/repeat/src/index.ts: add required `override` modifiers after master's stricter noImplicitOverride setting. - lib/buildtools/src/build/docs/__tests__/conductor.test.ts: update initTypedocForJson() call site for its new outDir parameter. - yarn.lock: regenerated via `yarn install`. Verified: tsc, lint, and tests pass for buildtools, repeat, and rune.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
PR not meant to be merged.
https://github.com/source-academy/modules#conductor-migration
explains the setup. Our CD for conductor-enabled Source Academy is coming from the conductor-migration branch.
* Migrate binary_tree module to Conductor Rewrites the binary_tree bundle as a Conductor BaseModulePlugin, backed by IDataHandler pair/list primitives instead of js-slang's stdlib. Tree entries are stored as OPAQUE values at the module boundary; is_tree and is_empty_tree declare no arg type so they can accept any DataType and answer false rather than throw, matching their predicate semantics. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Address review feedback: null guards and EvaluatorRuntimeError is_tree/is_empty_tree/assertNonEmptyTree now guard against a missing/undefined value instead of crashing with a raw TypeError, and the plugin's arity-check throws now use EvaluatorRuntimeError (already used elsewhere in this module) instead of a generic Error. Also adds the same __bindExportedMethods() workaround repeat/rune use for the unbound-method issue in BaseModulePlugin.initialise() (conductor#41), since this fix isn't merged upstream yet. * Validate left/right are trees in make_tree master's binary_tree gained this validation while conductor-migration was diverging (make_tree(0, 0, null) previously constructed a malformed tree silently instead of throwing). Ports the same check, using EvaluatorTypeError to match this module's existing Conductor error style rather than modules-lib's InvalidParameterTypeError, which doesn't apply here since this module no longer goes through js-slang. * binary_tree: remove __bindExportedMethods workaround The upstream binding fix (source-academy/conductor#41) is merged and published, making the per-module bind workaround unnecessary. Also drops the constructor override, which was left as a pure passthrough to the base class once the workaround was removed. * fix: pin @sourceacademy/conductor to a real published version everywhere repeat and testplugin depended on conductor via a bare, unpinned GitHub URL. yarn.lock had resolved and locked that to a commit from before even the BaseModulePlugin binding fix (conductor#41) - a real `yarn install` builds against that stale, broken conductor entirely silently, since nothing forces Yarn to re-resolve an already-locked git dependency. Other bundles (rune, etc.) already depend on the versioned npm release; switched these two to match (^0.7.0), which also resolves a duplicate-package TS error that showed up in any bundle depending on both specs simultaneously. * binary_tree: pin @sourceacademy/conductor to a published version Was depending on conductor via a bare, unpinned GitHub URL, which yarn.lock had resolved and locked to a commit from before the BaseModulePlugin binding fix (conductor#41). Switched to the versioned npm range other bundles already use (^0.7.0), matching the same fix applied to midi. * binary_tree: add override modifiers required by conductor-migration's stricter tsconfig Picked up as part of merging conductor-migration in - noImplicitOverride is now enabled repo-wide, and exportedNames/channelAttach shadow members declared on BaseModulePlugin. * lock file fixed * Fix lint errors blocking pre-push: unnecessary type assertions and Conductor error allowlist - lib/buildtools, lib/testplugin: drop assertions that no longer change the expression's type (same pattern as master's a2f369e fix). - eslint.config.js: allowlist EvaluatorTypeError/EvaluatorRuntimeError in @sourceacademy/throw-runtime-error — they're Conductor's own protocol-level error hierarchy, unrelated to js-slang's RuntimeSourceError that the rule checks for. binary_tree is the first Conductor-based bundle to throw these. - binary_tree test: drop a now-unnecessary type assertion. --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: henz <henz@comp.nus.edu.sg>
Deploys build artifacts from the conductor-migration branch to source-academy/modules-conductor via GitHub Pages, allowing the conductor version of modules to coexist with the current deployment.