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
rails c
p = Project.find(1)
FactoryBot.create(:pypi_package, :with_source, project: p, source_project: Project.find(2))
FactoryBot.create(:npm_package, :with_build, project: p)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
Possibly N/A, depending on whether I add a UI component.
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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