Skip to content

Gitlab: add support for creating merge requests for forks#4324

Merged
jurre merged 3 commits intodependabot:mainfrom
andrcuns:gitlab-add-fork-support
Oct 18, 2021
Merged

Gitlab: add support for creating merge requests for forks#4324
jurre merged 3 commits intodependabot:mainfrom
andrcuns:gitlab-add-fork-support

Conversation

@andrcuns
Copy link
Copy Markdown
Contributor

@andrcuns andrcuns commented Oct 17, 2021

This PR adds support for creating merge requests from a forked project in to the upstream project.

Because Gitlab doesn't prevent running the pipeline for merge request created within the project like it happens with workflows created by dependabot in github repositories, a malicious dependency would gain access to all environment variables, including keys, secrets etc.

For this purpose users might want to setup a fork of a project and use a less privileged user to run the dependabot-core and create merge requests from forks. This way the pipeline is not gaining access to secrets of the upstream project until user manually reviews the updates and triggers the pipeline as a more privileged user.

@andrcuns andrcuns requested a review from a team as a code owner October 17, 2021 10:39
Validate target_project_id passed correctly

Fix request expectation
@jurre
Copy link
Copy Markdown
Member

jurre commented Oct 18, 2021

Overall sounds like this approach makes sense for gitlab, I made some suggestions to avoid adding provider-specific keys to the (already large 😅) list of arguments we pass to these classes

@andrcuns
Copy link
Copy Markdown
Contributor Author

Overall sounds like this approach makes sense for gitlab, I made some suggestions to avoid adding provider-specific keys to the (already large 😅) list of arguments we pass to these classes

Makes sense, I missed the provider_metadata argument. Moved it there and added it to PullRequestUpdater as well.

@jurre jurre merged commit fa9ea5e into dependabot:main Oct 18, 2021
@brrygrdn brrygrdn mentioned this pull request Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants