Skip to content

fix(mkconcore): allow node labels with no source file - #685

Open
yadavchiragg wants to merge 2 commits into
ControlCore-Project:devfrom
yadavchiragg:fix/allow-empty-source-nodes
Open

yadavchiragg wants to merge 2 commits into
ControlCore-Project:devfrom
yadavchiragg:fix/allow-empty-source-nodes

Conversation

@yadavchiragg

Copy link
Copy Markdown

Fixes #684

Problem: mkconcore.py raises ValueError: Node source file '' cannot be empty for any node whose label has an empty source part, such as IN: or OUT:. 22 of the .graphml files in the repository have such port-only nodes (0mq/, measurements/, ratc/yuyu*learn*.graphml, testsou/), and none of them can be built. The rest of mkconcore.py still handles a node without a source file (it checks len(sourcecode) != 0 / if not sourcecode in several places), so the label validation is stricter than the generator.

Change: only validate the source part with safe_relpath when it is non-empty. Non-empty sources are validated exactly as before, so unsafe source paths are still rejected.

Testing: new tests/test_port_only_nodes.py finds every workflow in the repo that contains a port-only node and builds it for posix, windows and docker. On current dev all 66 build cases fail; with this change all pass. ruff format --check and ruff check are clean.

Maintainer confirmed port-only nodes (IN:/OUT:) are meant to be supported. validate no longer reports 'has no filename' for them; mkconcore already builds them. The test now asserts port-only nodes validate.
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.

mkconcore.py rejects node labels with no source file ("IN:", "OUT:"), so 22 example workflows no longer build

1 participant