Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add docker blob build artifact type #1086

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion conda-store-server/conda_store_server/_internal/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ class BuildArtifactType(str, enum.Enum):
CONDA_PACK = "CONDA_PACK"
DOCKER_MANIFEST = "DOCKER_MANIFEST"
CONSTRUCTOR_INSTALLER = "CONSTRUCTOR_INSTALLER"
_ = "CONTAINER_REGISTRY"

# Deprecated
# Old database may still have docker or container build artifacts.
# So, these enum values must stay in order to remain backwards compatible
# however, no new artifacts of these types should be created.
CONTAINER_REGISTRY = "CONTAINER_REGISTRY"
DOCKER_BLOB = "DOCKER_BLOB"


class BuildStatus(enum.Enum):
Expand Down
35 changes: 35 additions & 0 deletions conda-store-server/tests/_internal/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

import datetime

import pytest

from conda_store_server._internal import schema
Expand Down Expand Up @@ -62,3 +64,36 @@ def test_parse_lockfile_obj(test_lockfile):
}
specification = schema.LockfileSpecification.model_validate(lockfile_spec)
assert specification.model_dump()["lockfile"] == test_lockfile


@pytest.mark.parametrize(
("build"),
[
{
"id": 1,
"environment_id": 1,
"status": "BUILDING",
"scheduled_on": datetime.datetime.now(),
"size": 123,
},
{
"id": 2,
"environment_id": 1,
"status": "BUILDING",
"scheduled_on": datetime.datetime.now(),
"size": 123,
"build_artifacts": [
{"id": 1, "artifact_type": "YAML", "key": "not_a_real_key"},
{"id": 2, "artifact_type": "DOCKER_BLOB", "key": "not_a_real_key"},
{
"id": 3,
"artifact_type": "CONTAINER_REGISTRY",
"key": "not_a_real_key",
},
],
},
],
)
def test_parse_build(build):
output = schema.Build.model_validate(build).model_dump()
assert output is not None
Loading