Skip to content

Commit

Permalink
Konflux: Remove artifact_type from KonfluxRecord and KonfluxBundleBui…
Browse files Browse the repository at this point in the history
…ldRecord
  • Loading branch information
vfreex committed Dec 5, 2024
1 parent a8349c3 commit fd3e2a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
13 changes: 7 additions & 6 deletions artcommon/artcommonlib/konflux/konflux_build_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import random
import uuid
from abc import ABC
from datetime import datetime
from enum import Enum

Expand Down Expand Up @@ -32,7 +33,7 @@ class Engine(KonfluxEnum):
BREW = 'brew'


class KonfluxRecord:
class KonfluxRecord(ABC):
# These fields are excluded when computing the build ID, but are included in the build string representation
EXCLUDED_KEYS = [
'record_id',
Expand All @@ -45,7 +46,7 @@ class KonfluxRecord:
def __init__(self, name: str = '', group: str = '', version: str = '', release: str = '', assembly: str = '',
source_repo: str = '', commitish: str = '', rebase_repo_url: str = '', rebase_commitish: str = '',
start_time: datetime = None, end_time: datetime = None,
artifact_type: ArtifactType = ArtifactType.IMAGE, engine: Engine = Engine.KONFLUX,
engine: Engine = Engine.KONFLUX,
image_pullspec: str = '', image_tag: str = '',
outcome: KonfluxBuildOutcome = KonfluxBuildOutcome.SUCCESS, art_job_url: str = '',
build_pipeline_url: str = '', pipeline_commit: str = '', schema_level: int = 0,
Expand All @@ -65,7 +66,6 @@ def __init__(self, name: str = '', group: str = '', version: str = '', release:
self.rebase_commitish = rebase_commitish
self.start_time = start_time
self.end_time = end_time
self.artifact_type = artifact_type if isinstance(artifact_type, ArtifactType) else ArtifactType(artifact_type)
self.engine = engine if isinstance(engine, Engine) else Engine(engine)
self.image_pullspec = image_pullspec
self.image_tag = image_tag
Expand Down Expand Up @@ -157,14 +157,15 @@ def __init__(self, name: str = '', group: str = '', version: str = '', release:
ingestion_time: datetime = None, record_id: str = '', build_id: str = None, nvr: str = None):

super().__init__(name, group, version, release, assembly, source_repo, commitish, rebase_repo_url,
rebase_commitish, start_time, end_time, artifact_type, engine, image_pullspec, image_tag,
rebase_commitish, start_time, end_time, engine, image_pullspec, image_tag,
outcome, art_job_url, build_pipeline_url, pipeline_commit, schema_level, ingestion_time)

self.el_target = el_target
self.arches = arches
self.installed_packages = installed_packages
self.parent_images = parent_images
self.embargoed = embargoed
self.artifact_type = artifact_type if isinstance(artifact_type, ArtifactType) else ArtifactType(artifact_type)
self.init_uuids(record_id, build_id, nvr)


Expand All @@ -174,15 +175,15 @@ class KonfluxBundleBuildRecord(KonfluxRecord):
def __init__(self, name: str = '', group: str = '', version: str = '', release: str = '', assembly: str = '',
source_repo: str = '', commitish: str = '', rebase_repo_url: str = '', rebase_commitish: str = '',
start_time: datetime = None, end_time: datetime = None,
artifact_type: ArtifactType = ArtifactType.IMAGE, engine: Engine = Engine.KONFLUX,
engine: Engine = Engine.KONFLUX,
image_pullspec: str = '', image_tag: str = '',
outcome: KonfluxBuildOutcome = KonfluxBuildOutcome.SUCCESS, art_job_url: str = '',
build_pipeline_url: str = '', pipeline_commit: str = '', schema_level: int = 0,
ingestion_time: datetime = None, operand_nvrs: list = [], operator_nvr: str = '',
record_id: str = '', build_id: str = None, nvr: str = None):

super().__init__(name, group, version, release, assembly, source_repo, commitish, rebase_repo_url,
rebase_commitish, start_time, end_time, artifact_type, engine, image_pullspec, image_tag,
rebase_commitish, start_time, end_time, engine, image_pullspec, image_tag,
outcome, art_job_url, build_pipeline_url, pipeline_commit, schema_level, ingestion_time)
self.operand_nvrs = operand_nvrs
self.operator_nvr = operator_nvr
Expand Down
1 change: 0 additions & 1 deletion artcommon/tests/test_konflux_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ def test_generate_bundle_builds_schema(self):
SchemaField('rebase_commitish', 'STRING', 'REQUIRED'),
SchemaField('start_time', 'TIMESTAMP', 'REQUIRED'),
SchemaField('end_time', 'TIMESTAMP', 'REQUIRED'),
SchemaField('artifact_type', 'STRING', 'REQUIRED'),
SchemaField('engine', 'STRING', 'REQUIRED'),
SchemaField('image_pullspec', 'STRING', 'REQUIRED'),
SchemaField('image_tag', 'STRING', 'REQUIRED'),
Expand Down

0 comments on commit fd3e2a1

Please sign in to comment.