feat: move report artifacts to OSS storage
This commit is contained in:
@@ -112,6 +112,8 @@ class FileMetadata:
|
||||
sha256: str
|
||||
byte_size: int
|
||||
mime_type: str
|
||||
storage_provider: str = "local"
|
||||
bucket_alias: str = "arr-project-root"
|
||||
|
||||
def validate(self) -> None:
|
||||
storage = PurePosixPath(self.storage_key)
|
||||
@@ -122,6 +124,12 @@ class FileMetadata:
|
||||
or self.original_filename != PurePosixPath(self.original_filename).name
|
||||
or not SHA256_RE.fullmatch(self.sha256)
|
||||
or self.byte_size < 0
|
||||
or not isinstance(self.storage_provider, str)
|
||||
or self.storage_provider not in {"local", "local_fixture", "oss", "s3"}
|
||||
or not isinstance(self.bucket_alias, str)
|
||||
or not self.bucket_alias.strip()
|
||||
or "/" in self.bucket_alias
|
||||
or "\\" in self.bucket_alias
|
||||
):
|
||||
raise RepositoryError(
|
||||
ErrorCode.PUBLISH_FAILED,
|
||||
|
||||
Reference in New Issue
Block a user