Skip to content

Implement a link between packages and their source projects

What does this MR do?

Closes #210141.

Any package can be uploaded to any project. This means that the project a package is uploaded to is not always the source project of the package. If a package is uploaded by a project's CI job, the package is linked to that project, regardless of what project it is uploaded to. While it is likely that the project of the CI job that uploads the package is the source project of the package.

This MR will allow users to manually create (and remove) links between a package and its source project.

Considerations

  • What permissions should be required?
    • On the project with the package.
    • On the project being linked to.

During the Package open office hours (#216291 (closed)), someone pointed out that developers can upload packages, so developers should be able to link packages to projects.

How to test

  1. rails c
  2. p = Project.find(1)
  3. FactoryBot.create(:pypi_package, :with_source, project: p, source_project: Project.find(2))
  4. FactoryBot.create(:npm_package, :with_build, project: p)

Screenshots

image

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Possibly N/A, depending on whether I add a UI component.

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Ethan Reesor

Merge request reports