feat: add service workload contracts#34
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces new protocol-level workload contracts for service and node-service runtimes in compute-core, along with validation logic and accompanying negative/positive test coverage to support downstream runtime adapter/plugins.
Changes:
- Added
WorkloadSpecplusServiceWorkload/NodeServiceWorkloadcontract types and validation. - Added validation helpers for workload file refs, ingress CIDRs, health/status probes, and peer endpoint safety.
- Added unit tests covering valid service/node-service specs and multiple invalid/unsafe shapes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
protocol/types.go |
Adds new workload contract structs and validation logic (service, node-service, ingress, peers, files). |
protocol/types_test.go |
Adds tests validating the new workload specs and rejecting unsafe/invalid inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WorkloadSpecplus service and node-service workload payload contractsAdversarial review
workflow-plugin-compute-service; no host runtime behavior is moved in this PR.workflow-computeblocksworkflow-plugin-compute-servicefrom compiling without importing the app repo, which violates the extraction boundary.Verdict: SHIP-IT for the prerequisite contract PR; RTE-3 implementation still needs the service plugin and host alias/consumption PRs.
Verification
GOWORK=off go test ./protocol -run 'TestWorkloadSpecValidatesServiceWorkload|TestServiceWorkloadRejectsUnsafeShape|TestWorkloadSpecValidatesNodeServiceWorkload|TestNodeServiceWorkloadRejectsMissingHealthAndUnsafePeers' -count=1GOWORK=off go test ./... -count=1GOWORK=off go vet ./...GOWORK=off go build ./cmd/workflow-plugin-compute-coregit diff --check