Implement ActorTemplate CRUD in the control API - #895
Open
Zoe Zhao (zoez7) wants to merge 8 commits into
Open
Conversation
ActorRef was the original of the struct the template refs copied. Alias it to ResourceRef[actorKind] like the others; the actor-specific DNSName method becomes the ActorDNSName function since methods cannot be declared on an alias of a generic instantiation.
Return the status errors from validateDefaultActorTemplateVersion unwrapped so clients see the original Aborted/FailedPrecondition messages, drop the unreachable nameless-version check (request validation already rejects a default_version_on_create without a name), and refresh the actorTemplateLockKey comment now that the per-version lock fences DeleteActorTemplateVersion.
Pure code motion following the actor_snapshot.go convention (agent-substrate#891): the five per-RPC handler files become actor_template.go, their validation tests become actor_template_test.go, and the functional tests (TestActorTemplateCRUD out of functional_test.go, plus TestUpdateActorTemplate) become actor_template_functional_test.go. Part of agent-substrate#891; the remaining resources are follow-ups.
Zoe Zhao (zoez7)
requested review from
Eitan Yarmush (EItanya),
Haven Xia (HavenXia) and
Julian Gutierrez Oschmann (juli4n)
August 12, 2026 17:37
Comment on lines
+49
to
+51
| return slog.GroupValue( | ||
| slog.String("atespace", r.Atespace), | ||
| slog.String("name", r.Name), |
Collaborator
There was a problem hiding this comment.
Should we include the type?
| return stored, nil | ||
| } | ||
|
|
||
| func validateCreateActorTemplateRequest(req *ateapipb.CreateActorTemplateRequest) field.ErrorList { |
Collaborator
There was a problem hiding this comment.
We have some pretty sprawling validation functions at this point, have we thought about using protoc-gen-validate or something similar for uniformity?
Collaborator
Author
|
Update: we are rethinking the ActorTemplate and ActorTemplateVersion relationship in #905 |
| in := req.GetActorTemplate() | ||
| templateRef := resources.ActorTemplateRefFromActorTemplate(in) | ||
|
|
||
| // Lock the ActorTemplate. |
Collaborator
There was a problem hiding this comment.
do we still need this lock, given that UpdateActorTemplate in the storage layer has a watch now:
(I haven't checked atepg.go yet, though)
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.
Part of #477.
Changes
Relevant: