feat(api): adds Resource persistence model and migration#278
Open
eLRuLL wants to merge 1 commit into
Open
Conversation
joaquingx
requested changes
Apr 30, 2026
| @@ -0,0 +1,140 @@ | |||
| # Generated by Django 3.1.14 on 2026-04-28 15:35 | |||
Contributor
There was a problem hiding this comment.
There will be a conflict with this migration in #275, we need to coordinate it.
Comment on lines
+509
to
+511
| class Resource(models.Model): | ||
| KIND_OPTIONS = [ | ||
| (ResourceKind.SPIDER_JOB, "Spider Job"), |
Contributor
There was a problem hiding this comment.
Will be good to add a str
Comment on lines
+543
to
+546
| desired_spec = models.JSONField( | ||
| default=dict, | ||
| help_text="Desired resource spec managed by the control plane.", | ||
| ) |
Contributor
There was a problem hiding this comment.
e.g. spiderjob which kind of desired_spec should have, the same for observed_state ?
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.
Description
Introduces the initial persistence layer for the resource control-plane architecture.
Changes included:
Resourcemodel incore/models.py.core/migrations/0039_resource.pyto create theResourcetable.Resourceincludes:projectkind,phasedesired_spec,observed_state,external_referror_message,retry_countcreated,updatedThis PR is intentionally persistence-only:
Issue
Checklist before requesting a review