Skip to content
Open
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
4 changes: 4 additions & 0 deletions docs/releases/pending/5073.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description: |
The :ref:`/plugins/prepare/artifact` plugin now supports a
``repository-name`` key to configure the name of the shared
aggregation repository created on the guest.
1 change: 1 addition & 0 deletions tests/prepare/artifact/basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ rlJournalStart
rlRun "tmt run -i $run --scratch -vvv --all \
provision -h $PROVISION_HOW --image $image" \
0 "Run tmt with artifact providers"
rlAssertGrep "Successfully created repository 'custom-artifact-repo'" "${run}/log.txt"
rlPhaseEnd
done <<< "$IMAGES"

Expand Down
1 change: 1 addition & 0 deletions tests/prepare/artifact/basic/plan.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ prepare:
script: ./pre_artifact_check.sh
- name: Main artifact to test
how: artifact
repository-name: custom-artifact-repo
Comment thread
tcornell-bus marked this conversation as resolved.
provide:
- file:../rpms/bar/bar-1.0-1.noarch.rpm
- name: Sanity checks after artifact repo setup
Expand Down
3 changes: 3 additions & 0 deletions tmt/schemas/prepare/artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ properties:
default-repository-priority:
type: integer

repository-name:
type: string

verify:
type: boolean

Expand Down
14 changes: 12 additions & 2 deletions tmt/steps/prepare/artifact/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ class PrepareArtifactData(PrepareStepData):
""",
)

repository_name: str = field(
default=SHARED_REPO_NAME,
option='--repository-name',
metavar='NAME',
help="""
Name of the tmt generated repo containing all artifacts
that are generated.
""",
Comment on lines +62 to +64

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Name of the tmt generated repo containing all artifacts
that are generated.
""",
Name of the tmt generated repo containing all artifacts
that are generated.
""",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed here

)

verify: bool = field(
default=True,
option='--verify/--no-verify',
Expand Down Expand Up @@ -242,7 +252,7 @@ def go(
artifact_dir=shared_repo_dir,
guest=guest,
logger=logger,
repo_name=SHARED_REPO_NAME,
repo_name=self.data.repository_name,
priority=self.data.default_repository_priority,
)

Expand Down Expand Up @@ -367,7 +377,7 @@ def _prepare_verify(self, providers: list[ArtifactProvider], guest: Guest) -> No
'requires (dist-git)',
'recommends (dist-git)',
}
provider_repo_ids = {SHARED_REPO_NAME} | {
provider_repo_ids = {self.data.repository_name} | {
repo_id
for provider in providers
for repo in provider.get_repositories()
Expand Down
1 change: 1 addition & 0 deletions tmt/steps/prepare/artifact/providers/copr_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def make_rpm_artifact(self, rpm_meta: dict[str, str]) -> ArtifactInfo:
version=version_info,
location=urljoin(base_url + "/", filename),
provider=self,
repo_id=self.parent.data.repository_name,
)

@cached_property
Expand Down
1 change: 1 addition & 0 deletions tmt/steps/prepare/artifact/providers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def make_rpm_artifact(self, path: str) -> ArtifactInfo:
version=RpmVersion.from_filename(tmt.utils.Path(path).name),
location=path,
provider=self,
repo_id=self.parent.data.repository_name,
)

@cached_property
Expand Down
2 changes: 2 additions & 0 deletions tmt/steps/prepare/artifact/providers/koji.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def make_rpm_artifact(self, rpm_meta: dict[str, Any]) -> ArtifactInfo:
version=version_info,
location=urljoin(self._top_url, path),
provider=self,
repo_id=self.parent.data.repository_name,
)


Expand Down Expand Up @@ -240,6 +241,7 @@ def make_rpm_artifact(self, task_id: int, filename: str) -> ArtifactInfo: # typ
version=RpmVersion.from_filename(filename),
location=url,
provider=self,
repo_id=self.parent.data.repository_name,
)

@cached_property
Expand Down
Loading