Skip to content

bug(build): --cfg flag skipped on incremental no-op — requires --no-incremental for first CFG build #288

@carlos-alm

Description

@carlos-alm

Found during dogfooding v2.6.32-dev.4f08082

Severity: Medium
Command: codegraph build . --cfg

Reproduction

# Build without --cfg first
codegraph build . --no-incremental
# Now add --cfg
codegraph build . --cfg --verbose

Expected behavior

The --cfg flag should trigger CFG computation even when no files have changed, since this is the first time CFG data is being requested.

Actual behavior

Output: "No changes detected. Graph is up to date." — CFG data is NOT computed. All cfg queries return 0 blocks and 0 edges.

Running build . --cfg --no-incremental works correctly (887 functions analyzed for CFG).

Root cause

The incremental build detects no file changes and short-circuits before the CFG computation phase. The --cfg and --dataflow flags should force re-processing even when the file content hasn't changed, similar to how --no-incremental forces a full rebuild.

Suggested fix

When --cfg or --dataflow is passed and the corresponding data doesn't exist in the DB yet, skip the "no changes detected" early return and proceed with the computation phase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdogfoodFound during dogfooding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions