Refactor AttributeGraphVendor to RawRepresentable struct#222
Conversation
🤖 Augment PR SummarySummary: Refactors 🤖 Was this summary useful? React with 👍 or 👎 |
| /// A type that identifies the underlying attribute graph implementation vendor. | ||
| /// | ||
| /// Use `attributeGraphVendor` to check which vendor is active at runtime. | ||
| public struct AttributeGraphVendor: RawRepresentable, CaseIterable { |
There was a problem hiding this comment.
Changing AttributeGraphVendor from an enum to a struct drops the enum’s implicit Equatable/Hashable, which can break existing ==, Set/Dictionary usage, and switch constant patterns (e.g. case .oag). Consider explicitly conforming to Equatable/Hashable to preserve those behaviors.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| public struct AttributeGraphVendor: RawRepresentable, CaseIterable { | ||
| public let rawValue: String | ||
|
|
||
| public init(rawValue: String) { |
There was a problem hiding this comment.
AttributeGraphVendor(rawValue:) used to be failable when it was a RawRepresentable enum; making it non-failable can break downstream code that does optional binding (if let) or force-unwrapping on this initializer. If source-compatibility is a goal, consider also providing a failable init?(rawValue:) entry point.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #222 +/- ##
==========================================
- Coverage 32.08% 31.77% -0.32%
==========================================
Files 70 71 +1
Lines 2596 2628 +32
==========================================
+ Hits 833 835 +2
- Misses 1763 1793 +30
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
2a2b6ac to
f6b1294
Compare
f6b1294 to
7cef543
Compare
Summary
AttributeGraphVendorfrom aString-backed enum to a struct conforming toRawRepresentableandCaseIterable, aligning with the pattern used byRenderBoxVendorTest plan
OPENATTRIBUTEGRAPH_COMPATIBILITY_TEST=0 swift buildsucceedsOPENATTRIBUTEGRAPH_COMPATIBILITY_TEST=1 swift buildsucceeds