You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(extension): add metadata to Poll method and reorder BuildAction enum
Enhance BuildManager.Poll to return build metadata and reorder BuildAction
constants for better semantic ordering.
Changes to Poll method:
- Add map[string]string return value for build metadata
- Document common metadata keys (build_url, commit_sha, duration_ms, etc.)
- Update interface signature: Poll(ctx, id) → (BuildStatus, map[string]string, error)
- Update mocks and tests to handle metadata return value
Changes to BuildAction enum:
- Reorder constants: BuildActionApply now comes before BuildActionValidate
- Apply is the primary action, validate is secondary
- Update all tests and examples to reflect new ordering
Documentation updates:
- Add Build Metadata section explaining common keys
- Update all Poll usage examples to show metadata handling
- Update mock examples with metadata assertions
- Clarify that metadata keys are implementation-defined
The metadata map allows implementations to return provider-specific information
(build URLs, commit SHAs, timestamps, etc.) without changing the interface.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The `Poll` method returns a `map[string]string` containing additional metadata about the build. The specific keys and values are implementation-defined, but common examples include:
111
+
112
+
**Common metadata keys:**
113
+
- `build_url` - Direct link to the build in the CI provider's UI
114
+
- `commit_sha` - Git commit SHA being tested
115
+
- `duration_ms` - Build duration in milliseconds
116
+
- `started_at` - Build start timestamp
117
+
- `finished_at` - Build completion timestamp
118
+
- `error_message` - Error details for failed builds
119
+
120
+
Implementations may include additional provider-specific metadata. Consumers should handle missing keys gracefully.
121
+
108
122
## Error Handling
109
123
110
124
The extension defines sentinel errors following the SubmitQueue pattern:
@@ -119,7 +133,7 @@ Each error has helper functions:
0 commit comments