Skip to content

Refactor AttributeGraphVendor to RawRepresentable struct#222

Merged
Kyle-Ye merged 2 commits intomainfrom
feature/attribute-graph-vendor-raw-representable
Mar 10, 2026
Merged

Refactor AttributeGraphVendor to RawRepresentable struct#222
Kyle-Ye merged 2 commits intomainfrom
feature/attribute-graph-vendor-raw-representable

Conversation

@Kyle-Ye
Copy link
Contributor

@Kyle-Ye Kyle-Ye commented Mar 10, 2026

Summary

  • Refactor AttributeGraphVendor from a String-backed enum to a struct conforming to RawRepresentable and CaseIterable, aligning with the pattern used by RenderBoxVendor
  • Add DocC comments for the type and each vendor case

Test plan

  • Verify OPENATTRIBUTEGRAPH_COMPATIBILITY_TEST=0 swift build succeeds
  • Verify OPENATTRIBUTEGRAPH_COMPATIBILITY_TEST=1 swift build succeeds
  • Confirm downstream OpenSwiftUI builds without changes (API is source-compatible)

@github-actions github-actions bot added enhancement New feature or request documentation Improvements or additions to documentation labels Mar 10, 2026
@augmentcode
Copy link

augmentcode bot commented Mar 10, 2026

🤖 Augment PR Summary

Summary: Refactors AttributeGraphVendor from a String-backed enum into a RawRepresentable/CaseIterable struct to match the vendor-pattern used elsewhere.
Changes: Adds DocC documentation for the vendor type/cases and defines allCases explicitly for the known vendor identifiers.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

/// 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 {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 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) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 31.77%. Comparing base (91dd6f1) to head (eedc91a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Sources/OpenAttributeGraphShims/OAGShims.swift 66.66% 1 Missing ⚠️
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     
Flag Coverage Δ
ios 32.14% <66.66%> (+0.03%) ⬆️
macos 9.51% <66.66%> (-0.44%) ⬇️
ubuntu 12.03% <66.66%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
Sources/OpenAttributeGraphShims/OAGShims.swift 66.66% <66.66%> (ø)

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye Kyle-Ye force-pushed the feature/attribute-graph-vendor-raw-representable branch from 2a2b6ac to f6b1294 Compare March 10, 2026 15:30
@Kyle-Ye Kyle-Ye force-pushed the feature/attribute-graph-vendor-raw-representable branch from f6b1294 to 7cef543 Compare March 10, 2026 15:33
@Kyle-Ye Kyle-Ye merged commit 30d5d34 into main Mar 10, 2026
9 of 10 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/attribute-graph-vendor-raw-representable branch March 10, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant