Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates DistributedFactorGraphs.jl to standardize delete!/merge!-style return values (favoring numeric counts and idempotent “0” results), adds/exports several “has*” helpers, and expands the test suite accordingly. It also pins StructUtils to v2.7.0.
Changes:
- Standardize many delete operations to return
0on missing targets (instead of throwing) and adjust tests accordingly. - Introduce patch/merge-conflict behavior (via
patch!andMergeConflictError) and update merge paths (e.g.,mergeGraph!, GraphsDFG merge implementations). - Add/extend API surface + tests for bloblets, states, and blobstore link merging; pin StructUtils compat to
=2.7.0.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/testBlocks.jl | Updates expectations for delete/merge return values; adds extended test blocks for bloblets, states, blobstores. |
| test/interfaceTests.jl | Adds new testsets invoking the new/extended test blocks. |
| test/iifInterfaceTests.jl | Aligns delete semantics in IIF driver tests to new “0 on missing” behavior. |
| src/services/Tags.jl | Changes DFG-level mergeTags!/deleteTags! return values to numeric counts. |
| src/services/DFGVariable.jl | Updates bulk state add counts, state delete to return 0 when missing, and listStates(dfg) to return a Vector. |
| src/services/Bloblet.jl | Adds has*Bloblet wrappers at the DFG service layer. |
| src/services/AbstractDFG.jl | Adds blobstore helpers (getBlobstores, mergeStorelink!, mergeStorelinks!, hasBlobstore), changes bulk merge sums, refactors mergeGraph!, and renames buildSubgraph → getSubgraph (with deprecations elsewhere). |
| src/serialization/DFGStructStyles.jl | Adds TODO note re: StructUtils v2.7 and StaticArrays support. |
| src/errors.jl | Introduces MergeConflictError. |
| src/entities/DFGVariable.jl | Adds patch! for Variable/Summary/Skeleton, and tweaks VariableDFG constructor signature. |
| src/entities/DFGFactor.jl | Adds patch! for Factor-related types and introduces merge-conflict checks. |
| src/entities/Bloblet.jl | Makes bloblet delete idempotent (0 on missing), adjusts bulk operations, and adds hasBloblet. |
| src/entities/Agent_and_Graph.jl | Adds patch/merge behavior for Agent/Graphroot metadata. |
| src/GraphsDFG/services/GraphsDFG.jl | Uses patch! for merges; makes variable/factor/blobentry deletes return 0 when missing. |
| src/GraphsDFG/GraphsDFG.jl | Imports MergeConflictError/patch! and related accessors for updated merge behavior. |
| src/DistributedFactorGraphs.jl | Exports new has*Bloblet functions; changes getObservation from export to public; updates unstable function list (e.g., getSubgraph). |
| src/Deprecated.jl | Moves old graph copy/merge helpers here and adds deprecations (buildSubgraph → getSubgraph). |
| src/DataBlobs/services/BlobStores.jl | Makes blob deletes idempotent (0 on missing/already deleted) and updates tombstone content. |
| src/DataBlobs/services/BlobEntry.jl | Makes deleteBlobentry! idempotent (0 on missing). |
| Project.toml | Pins StructUtils compat to =2.7.0. |
Comments suppressed due to low confidence (1)
src/DataBlobs/services/BlobEntry.jl:67
deleteBlobentry!now returns0when the label is missing, butdeleteBlobentries!still returnslength(labels)regardless of whether anything was actually deleted. That makes the bulk return value misleading and inconsistent with the updated single-delete semantics; consider summing the per-label results (and usingforeachinstead of broadcasting if you want to ignore intermediate arrays).
function deleteBlobentry!(node, label::Symbol)
!haskey(refBlobentries(node), label) && return 0
pop!(refBlobentries(node), label)
return 1
end
deleteBlobentry!(node, entry) = deleteBlobentry!(node, getLabel(entry))
function deleteBlobentries!(node, labels::Vector{Symbol})
deleteBlobentry!.(node, labels)
return length(labels)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1212 +/- ##
===========================================
+ Coverage 72.37% 75.01% +2.63%
===========================================
Files 37 37
Lines 2360 2465 +105
===========================================
+ Hits 1708 1849 +141
+ Misses 652 616 -36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Warning
Pinned StructUtils.jl to v2.7.0 because of something breaking in v2.7.1