Generate artifacts.yaml manifest for downloaded packages#4558
Generate artifacts.yaml manifest for downloaded packages#4558AthreyVinay wants to merge 1 commit intoavinay-refactor-nvr-abstractionfrom
artifacts.yaml manifest for downloaded packages#4558Conversation
Summary of ChangesHello @AthreyVinay, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the internal handling and persistence of artifact information. It introduces a standardized object model for artifact details, ensuring a consistent approach across various artifact providers. A key enhancement is the ability to persist these detailed artifact metadata to a YAML file, which will greatly improve the ability to track and debug artifact-related issues. These changes streamline artifact management and lay a robust foundation for future development. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and valuable refactoring of artifact handling by introducing structured Version and ArtifactInfo classes. This greatly improves the clarity and maintainability of the code. The new feature to persist artifact metadata to disk is also a great addition.
My review includes a few suggestions to further improve the design:
- A potential performance regression due to the removal of
@cached_propertyon methods that perform API calls. - Opportunities to improve code organization by moving shared helper classes to a more central location.
- A suggestion to resolve a Liskov Substitution Principle violation in one of the provider classes.
- A minor suggestion for more concise code in the new metadata persistence logic.
Overall, this is a solid piece of work. Thank you for the contribution!
|
This pr currently generates the following providers:
- id: koji.build:2909847
artifacts:
- name: python-click
version: 8.1.7
release: 12.fc44
arch: src
epoch: 1
nvra: python-click-8.1.7-12.fc44.src
location:
https://kojipkgs.fedoraproject.org/packages/python-click/8.1.7/12.fc44/src/python-click-8.1.7-12.fc44.src.rpm
- name: python3-click
version: 8.1.7
release: 12.fc44
arch: noarch
epoch: 1
nvra: python3-click-8.1.7-12.fc44.noarch
location:
https://kojipkgs.fedoraproject.org/packages/python-click/8.1.7/12.fc44/noarch/python3-click-8.1.7-12.fc44.noarch.rpm |
artifacts.yaml manifest for downloaded packages
|
providers:
- id: koji.build:2909847
artifacts:
- name: python-click
version: 8.1.7
release: 12.fc44
arch: src
epoch: 1
nvra: python-click-8.1.7-12.fc44.src
location:
https://kojipkgs.fedoraproject.org/packages/python-click/8.1.7/12.fc44/src/python-click-8.1.7-12.fc44.src.rpm
sha256header:
20ec605df07f9caa186deb48622089f5f38df0b7dfb6e095f3fde401d23bdb23
- name: python3-click
version: 8.1.7
release: 12.fc44
arch: noarch
epoch: 1
nvra: python3-click-8.1.7-12.fc44.noarch
location:
https://kojipkgs.fedoraproject.org/packages/python-click/8.1.7/12.fc44/noarch/python3-click-8.1.7-12.fc44.noarch.rpm
sha256header:
873b3db9067e278a4cc1b13798deeea595c175cb6c37f7b267e06240ec8cb5db
- id: copr.build:10074834:fedora-43-x86_64
artifacts:
- name: tmt+prepare-artifact
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+prepare-artifact-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+prepare-artifact-1.66.0-1.fc43.noarch.rpm
sha256header:
635f16efb8f5dceca89e8e24d1b06c2aaad733c159bc6607c02ab0e119565907
- name: tmt+test-convert
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+test-convert-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+test-convert-1.66.0-1.fc43.noarch.rpm
sha256header:
f29a5f3a746bd513eba0821c194cfcc80791dfbb28c722259090b0da57926884
- name: tmt
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt-1.66.0-1.fc43.noarch.rpm
sha256header:
59420254e537097b56570e2521a389d3cb0754935c189049b05ba7e89b2aa1df
- name: tmt+provision-bootc
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+provision-bootc-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+provision-bootc-1.66.0-1.fc43.noarch.rpm
sha256header:
87b53a9a5e86f9c1b71b6e7660f87168db0fb7820f38b1752e3af38f4d4486ca
- name: tmt+report-polarion
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+report-polarion-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+report-polarion-1.66.0-1.fc43.noarch.rpm
sha256header:
f2c2b5ca31696451cd11119fb05e8994362360ed6842fa0cf1daefde49c3d633
- name: tmt+provision-virtual
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+provision-virtual-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+provision-virtual-1.66.0-1.fc43.noarch.rpm
sha256header:
01b632a605d844893bd7cd900456118846233dc73fcaf4f5161d504cd633e3ce
- name: tmt+all
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+all-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+all-1.66.0-1.fc43.noarch.rpm
sha256header:
3b9d7dbd522c4e2167a95a07bbb7bf6b00b8607adaae64e08fdd3b65cdce4e24
- name: tmt+export-polarion
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+export-polarion-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+export-polarion-1.66.0-1.fc43.noarch.rpm
sha256header:
8eb5fc4d50548f087ef6d620cb985e6c068a60af7168407aaee4be1b22c507f0
- name: tmt+provision-beaker
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+provision-beaker-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+provision-beaker-1.66.0-1.fc43.noarch.rpm
sha256header:
30d8def6494004bbb1b4afb0718ca53a3154c4797d90b6d9a7ca36089095926d
- name: tmt+link-jira
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+link-jira-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+link-jira-1.66.0-1.fc43.noarch.rpm
sha256header:
fdd4a2083c247e7164dae8524fe51b3a78c0a9f83815131983ab61fddb954d75
- name: tmt+report-junit
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+report-junit-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+report-junit-1.66.0-1.fc43.noarch.rpm
sha256header:
0575a191a6e6c2410109ba2343dffba5281c274e68872a8f98f7e5d1b40d77fc
- name: tmt+provision-mock
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+provision-mock-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+provision-mock-1.66.0-1.fc43.noarch.rpm
sha256header:
5f1d00eb8a2a136fd8c6b466509e6bb5fbbab0931abd25ea62f515fd5d96be5a
- name: tmt+provision-container
version: 1.66.0
release: 1.fc43
arch: noarch
epoch:
nvra: tmt+provision-container-1.66.0-1.fc43.noarch
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt+provision-container-1.66.0-1.fc43.noarch.rpm
sha256header:
6f4b2b2832d17d47ac4b5c86c4a23aeed68d62b200d95cfbbb98360279616a40
- name: tmt
version: 1.66.0
release: 1.fc43
arch: src
epoch:
nvra: tmt-1.66.0-1.fc43.src
location:
https://download.copr.fedorainfracloud.org/results/@teemtee/stable/fedora-43-x86_64/10074834-tmt/tmt-1.66.0-1.fc43.src.rpm
sha256header:
9cf9a314212881a7e8e243877fee73ae04be81fce221fb50845671ed47b683d0
discover:
how: fmf
provision:
how: container
image: fedora:43
prepare:
how: artifact
provide:
- koji.build:2909847
- copr.build:10074834:fedora-43-x86_64
execute:
how: tmt |
652fa41 to
2eee10e
Compare
77f1de3 to
43bb94d
Compare
caebeef to
21bc23b
Compare
| providers_data = [] | ||
|
|
||
| for provider in providers: | ||
| artifacts_list = [] |
There was a problem hiding this comment.
artifacts would be enough, it's a plural, it's storing artifacts, _list is superfluous.
| 'nvra': str(artifact.version), | ||
| 'location': artifact.location, | ||
| } | ||
| artifacts_list.append(artifact_dict) |
There was a problem hiding this comment.
artifacts = [
{
**vars(artifact.version),
'nvra': str(artifact.version),
'location': artifact.location,
}
for artifact in provider.artifacts
]| for artifact in provider.artifacts: | ||
| artifact_dict = { | ||
| **vars(artifact.version), | ||
| 'nvra': str(artifact.version), |
There was a problem hiding this comment.
Why not artifact.version.nvra?
|
|
||
| for artifact in provider.artifacts: | ||
| artifact_dict = { | ||
| **vars(artifact.version), |
There was a problem hiding this comment.
We would be flattening the Version container into artifact fields, that may end up with a conflict. Can we keep version in its own container?
{
'version': vars(artifact.version),
...
}There was a problem hiding this comment.
Okay to see version under version?
providers:
- id: koji.build:2926458
artifacts:
- version:
name: tmt
version: 1.66.0
release: 1.fc44
arch: src
epoch:
nvra: tmt-1.66.0-1.fc44.src
location:
https://kojipkgs.fedoraproject.org/packages/tmt/1.66.0/1.fc44/src/tmt-1.66.0-1.fc44.src.rpmThere was a problem hiding this comment.
Yep, one is artifact version, the other is the "version" component of RPM NVRA.
a5b4976 to
8b98406
Compare
495bdd5 to
2d0e577
Compare
cb25be9 to
9024859
Compare
1011d6f to
119fbab
Compare
646c154 to
4a9f51a
Compare
119fbab to
b2cc461
Compare
An effort towards resolving: #4055 (part-2)
Pull Request Checklist