Skip to content

ci(weighted-edges): fix ruff-action glob so 'Static analysis — weighted-edge sources' can run#167

Open
alexzhu0 wants to merge 1 commit intoFlowElement-ai:mainfrom
alexzhu0:chore/fix-weighted-edges-glob-expansion
Open

ci(weighted-edges): fix ruff-action glob so 'Static analysis — weighted-edge sources' can run#167
alexzhu0 wants to merge 1 commit intoFlowElement-ai:mainfrom
alexzhu0:chore/fix-weighted-edges-glob-expansion

Conversation

@alexzhu0
Copy link
Copy Markdown
Contributor

@alexzhu0 alexzhu0 commented May 5, 2026

I affirm that all code in every commit of this pull request conforms to the terms of the M-flow Developer Certificate of Origin

Summary

.github/workflows/weighted_edges_tests.yml invokes astral-sh/ruff-action@v2 with m_flow/knowledge/graph_ops/** in the args string. ruff-action passes that verbatim to ruff without shell glob expansion, so ruff treats /** as a literal path and the job fails instantly on every fork PR with:

E902 No such file or directory (os error 2)
 --> m_flow/knowledge/graph_ops/**:1:1
Found 1 error.

Example failed runs (all fork PRs — same error regardless of PR content):

As a result, Static analysis — weighted-edge sources is permanently red on contributor PRs and blocks merges that would otherwise be clean.

Fix

Drop the /**. ruff already recurses into directories, so passing the plain directory path (m_flow/knowledge/graph_ops) is the canonical idiom and matches how the upstream ruff-action examples are written.

Two lines changed — args for both the check and format --check steps in the quality-gate job.

Verification

Ran locally with the repo's lockfile-pinned ruff (0.15.10):

$ uvx ruff@0.15.10 check \
    m_flow/knowledge/graph_ops \
    m_flow/tests/unit/interfaces/graph/test_weighted_edges.py \
    examples/python/weighted_edges_example.py
All checks passed!

$ uvx ruff@0.15.10 format --check \
    m_flow/knowledge/graph_ops \
    m_flow/tests/unit/interfaces/graph/test_weighted_edges.py \
    examples/python/weighted_edges_example.py
17 files already formatted

The quality-gate job will now actually exercise the files it is supposed to guard, rather than failing before it reaches them.

Out of scope

No application code touched. No rule set changes. Pure CI fix.

Signed-off-by: Alexazhu alexazzjjtt@163.com

The weighted_edges_tests quality-gate job invokes astral-sh/ruff-action
with args containing 'm_flow/knowledge/graph_ops/**'. ruff-action passes
the string directly to ruff without shell glob expansion, so ruff treats
'/**' as a literal path component and fails with:

    E902 No such file or directory (os error 2)
     --> m_flow/knowledge/graph_ops/**:1:1

ruff already recurses into directories, so passing the plain directory
path 'm_flow/knowledge/graph_ops' is the standard idiom and matches how
the upstream ruff-action examples are written.

Verified locally with ruff 0.15.10 (lockfile-pinned version):

    $ uvx ruff@0.15.10 check m_flow/knowledge/graph_ops \
        m_flow/tests/unit/interfaces/graph/test_weighted_edges.py \
        examples/python/weighted_edges_example.py
    All checks passed!
    $ uvx ruff@0.15.10 format --check ...
    17 files already formatted

Signed-off-by: Alexazhu <alexazzjjtt@163.com>
@alexzhu0
Copy link
Copy Markdown
Contributor Author

alexzhu0 commented May 5, 2026

Heads-up: this PR surfaces a second latent bug in the same workflow that I'm intentionally leaving out of scope.

With the glob fix in place, quality-gate now passes — which unblocks Stage 2 (unit-regression) for the first time. Both Python matrix legs fail on:

ERROR: file or directory not found: m_flow/tests/unit/interfaces/graph/get_graph_from_model_unit_test.py

That path doesn't exist on main. The current files under m_flow/tests/unit/interfaces/graph/ are:

  • extract_graph_unit_test.py
  • extract_graph_huge_test.py
  • extract_graph_circular_test.py
  • test_weighted_edges.py

Looks like the test was renamed/removed but .github/workflows/weighted_edges_tests.yml:95 was never updated.

Two reasons this hasn't bitten anyone until now:

  1. quality-gate was always failing first on fork PRs (what this PR fixes), so needs: [quality-gate] kept the downstream jobs in a permanent skipping state.
  2. The workflow's paths: filter limits it to changes under m_flow/knowledge/graph_ops/**, which none of the open fork PRs (chore: make trace_cli datetime.fromtimestamp() tz-aware (ruff DTZ006) #134/chore: trivial idiom cleanups (ruff PIE810, FURB167, B009) #135/chore: drop unnecessary pass statements (ruff PIE790) #150/chore: sort __slots__ tuples alphabetically (ruff RUF023) #152/chore: drop empty if TYPE_CHECKING: blocks and orphaned imports (ruff TC005) #153) touch — so they'll still show skipping for this job and remain unblocked by it after this merges.

Happy to open a separate PR for the stale test path once you tell me what the right target is (rename → extract_graph_unit_test.py? Drop the step? Point at a different fixture?). I didn't want to guess and bundle an unrelated change.

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.

1 participant