Skip to content

Detect and error on duplicate artifact NVRAs#4564

Open
AthreyVinay wants to merge 6 commits intoavinay-report-installable-artifactsfrom
avinay--fix-duplicate-artifact-handling
Open

Detect and error on duplicate artifact NVRAs#4564
AthreyVinay wants to merge 6 commits intoavinay-report-installable-artifactsfrom
avinay--fix-duplicate-artifact-handling

Conversation

@AthreyVinay
Copy link
Contributor

from sync...
Specific example:
User provides two scratch builds of curl
Two koji tasks with the same nvr (content is different, e.g. two ways / patches how to fix the bug)
Raise an error (as we cannot decide/check what should be installed)

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 enhances the robustness of the artifact preparation step by introducing validation for artifact NVRAs. It ensures that if multiple artifact providers attempt to supply artifacts with identical NVRAs, an explicit error is raised. This prevents potential conflicts and ensures a clear, deterministic source for each artifact, thereby improving the overall reliability and predictability of the artifact management process.

Highlights

  • Duplicate NVRA Detection: Implemented a mechanism to detect and error on duplicate artifact NVRAs (Name-Version-Release-Architecture) provided by different sources, preventing ambiguous artifact installations.
  • Error Handling: Introduced a PrepareError to be raised when duplicate NVRAs are found, ensuring that the process halts and notifies the user of the conflict.
  • Code Refactoring: Refactored the artifact metadata collection and duplicate checking logic into a new dedicated private method, _collect_artifacts_metadata, improving modularity and readability.
Changelog
  • tmt/steps/prepare/artifact/init.py
    • Updated specific type imports from the typing module for Any, ClassVar, and Optional.
    • Introduced seen_nvras and providers_data variables within the go method to track artifact NVRAs and collected metadata.
    • Extracted artifact metadata collection and duplicate NVRA detection into a new private method _collect_artifacts_metadata.
    • Modified the _persist_artifact_metadata method to accept pre-collected artifact data, streamlining its responsibility.
    • Integrated the new _collect_artifacts_metadata method into the artifact processing loop to perform duplicate checks and gather data.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@AthreyVinay AthreyVinay added step | prepare Stuff related to the prepare step plugin | artifact Related to the `prepare/artifact` plugin. labels Feb 10, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses the requirement to detect and error on duplicate artifact NVRAs by introducing the _collect_artifacts_metadata method and refactoring _persist_artifact_metadata. No security vulnerabilities were found, and the changes are well-implemented, directly fulfilling the stated objective.

@AthreyVinay AthreyVinay force-pushed the avinay-report-installable-artifacts branch from caebeef to 21bc23b Compare February 10, 2026 16:43
@AthreyVinay AthreyVinay force-pushed the avinay--fix-duplicate-artifact-handling branch from 735c673 to db2e674 Compare February 10, 2026 16:50
@happz happz added this to planning Feb 11, 2026
@github-project-automation github-project-automation bot moved this to backlog in planning Feb 11, 2026
@happz happz moved this from backlog to review in planning Feb 11, 2026
@AthreyVinay AthreyVinay force-pushed the avinay-report-installable-artifacts branch 3 times, most recently from 119fbab to b2cc461 Compare February 13, 2026 12:45
@psss psss added this to the 1.68 milestone Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin | artifact Related to the `prepare/artifact` plugin. step | prepare Stuff related to the prepare step

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

2 participants