Skip to content

concore validate --format json returns wrong node_id for nodes without a label #592

Description

@bhuvan-somisetty

concore validate --format json reports the wrong node_id when a node has no label.

The warning is built as Node {node_id} has no label, but _build_entries() pulls the id back out with message[5:-9]. The suffix has no label is 13 chars, not 9, so part of it stays in the id.

Repro:

  1. Make a workflow with one node that has no <y:NodeLabel>, e.g. <node id="n1"></node>
  2. Run concore validate test.graphml --format json

Output:

"warnings": [
  {
    "message": "Node n1 has no label",
    "error_type": "missing_node_label",
    "node_id": "n1 has"
  }
],
...
"nodes_affected": ["n1 has"]

Expected: node_id and nodes_affected should be "n1".

Actual: they are "n1 has", so anything that uses the JSON output to find the node (editor, scripts) gets an id that doesn't exist.

The bad slice is at concore_cli/commands/validate.py line 94. Changing it to message[5:-len(" has no label")] fixes it, and a test for this case would be good too since no existing test checks node_id here.

Tested on dev at 32951ab, Python 3.12.10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions