File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed
conda_store_server/_internal Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,13 @@ class BuildArtifactType(str, enum.Enum):
104
104
CONDA_PACK = "CONDA_PACK"
105
105
DOCKER_MANIFEST = "DOCKER_MANIFEST"
106
106
CONSTRUCTOR_INSTALLER = "CONSTRUCTOR_INSTALLER"
107
- _ = "CONTAINER_REGISTRY"
107
+
108
+ # Deprecated
109
+ # Old database may still have docker or container build artifacts.
110
+ # So, these enum values must stay in order to remain backwards compatible
111
+ # however, no new artifacts of these types should be created.
112
+ CONTAINER_REGISTRY = "CONTAINER_REGISTRY"
113
+ DOCKER_BLOB = "DOCKER_BLOB"
108
114
109
115
110
116
class BuildStatus (enum .Enum ):
Original file line number Diff line number Diff line change 2
2
# Use of this source code is governed by a BSD-style
3
3
# license that can be found in the LICENSE file.
4
4
5
+ import datetime
6
+
5
7
import pytest
6
8
7
9
from conda_store_server ._internal import schema
@@ -62,3 +64,36 @@ def test_parse_lockfile_obj(test_lockfile):
62
64
}
63
65
specification = schema .LockfileSpecification .model_validate (lockfile_spec )
64
66
assert specification .model_dump ()["lockfile" ] == test_lockfile
67
+
68
+
69
+ @pytest .mark .parametrize (
70
+ ("build" ),
71
+ [
72
+ {
73
+ "id" : 1 ,
74
+ "environment_id" : 1 ,
75
+ "status" : "BUILDING" ,
76
+ "scheduled_on" : datetime .datetime .now (),
77
+ "size" : 123 ,
78
+ },
79
+ {
80
+ "id" : 2 ,
81
+ "environment_id" : 1 ,
82
+ "status" : "BUILDING" ,
83
+ "scheduled_on" : datetime .datetime .now (),
84
+ "size" : 123 ,
85
+ "build_artifacts" : [
86
+ {"id" : 1 , "artifact_type" : "YAML" , "key" : "not_a_real_key" },
87
+ {"id" : 2 , "artifact_type" : "DOCKER_BLOB" , "key" : "not_a_real_key" },
88
+ {
89
+ "id" : 3 ,
90
+ "artifact_type" : "CONTAINER_REGISTRY" ,
91
+ "key" : "not_a_real_key" ,
92
+ },
93
+ ],
94
+ },
95
+ ],
96
+ )
97
+ def test_parse_build (build ):
98
+ output = schema .Build .model_validate (build ).model_dump ()
99
+ assert output is not None
You can’t perform that action at this time.
0 commit comments