Skip to content

feat(cli): add 'concore add-node' to add a starter node to a project - #696

Merged
pradeeban merged 4 commits into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-add-node
Nov 28, 2026
Merged

pradeeban merged 4 commits into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-add-node

Conversation

@yadavchiragg

Copy link
Copy Markdown

Why

concore init --interactive creates stub nodes for Python, C++, Octave, Verilog and Java, but only while creating a new project. Adding another node later means copying a stub and editing workflow.graphml by hand.

What

concore add-node <project_dir> --lang python|cpp|octave|verilog|java

  • writes the same stub init uses into src/ and appends a matching, unconnected node to workflow.graphml (to be wired up in yEd)
  • picks free names: script.py, script2.py, ... and for Java renames the class so Script2.java still compiles
  • places the node below the existing ones; uses the file's own nodegraphics key id and keeps its line endings (CRLF files stay CRLF)
  • clear errors for a directory without workflow.graphml

Testing

  • tests/test_add_node_command.py (8 tests), including CRLF + non-default key id, name collisions, Java class rename, and that the project still validates
  • init -> add-node -> validate -> build --type posix run end to end
  • existing CLI tests unchanged, ruff clean

Docs

Added concore add-node to concore_cli/README.md

concore init --interactive can create nodes, but only when creating a new project. add-node adds a stub source file plus a matching workflow.graphml node to an existing project, picking free file names, renaming the Java class to match, keeping the file's graphics key and line endings. Tests and docs included.
@pradeeban

Copy link
Copy Markdown
Member

Merge conflicts. Pls check @yadavchiragg

@pradeeban
pradeeban marked this pull request as draft November 27, 2026 03:17
@yadavchiragg

Copy link
Copy Markdown
Author

@pradeeban I merged the latest dev and resolved the conflict in cli.py (both concore logs and concore add-node are kept). The remaining red checks are not from this PR: test (3.9) and the cancelled 3.10-3.12 jobs come from the Ubuntu 26.04 / Python 3.9 problem that #678 fixes, and the cpp-* jobs come from the params path in the C++ test that #714 fixes. I'll re-run CI here once those are merged.

@pradeeban

Copy link
Copy Markdown
Member

Looks like some more merge conflicts, @yadavchiragg

@pradeeban
pradeeban marked this pull request as ready for review November 28, 2026 03:20
@pradeeban
pradeeban merged commit 2d5779f into ControlCore-Project:dev Nov 28, 2026
12 of 17 checks passed
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