Pipelines Created by Group Bots Cannot Pull Git Repository
### Summary If a pipeline is created using the [Pipelines API](https://docs.gitlab.com/ee/api/pipelines.html#create-a-new-pipeline) using a [Group Access Token](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#create-a-group-access-token) with a Group Bot that has access to the Project - the Pipeline is successfully created - but the due to the fact that the Group Bot is not considered a `project.bot` - the `build_access_token_check` returns - and pulling the Git repository in the pipeline fails with: ``` remote: HTTP Basic: Access denied ``` ### Steps to reproduce 1. Create a [Group Access Token](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#create-a-group-access-token) 2. [Create a Pipeline](https://docs.gitlab.com/ee/api/pipelines.html#create-a-new-pipeline) in a project belonging to the group using the token: e.g. `curl --request POST --header \"PRIVATE-TOKEN: ${GROUP_ACCESS_TOKEN}\" --form ref=main \"https://gitlab.example.com/api/v4/projects/project_id/pipeline\"` 3. The pipeline is successfully created, but will result in a `401` being returned from `Repositories::GitHttpController` due to the fact that the group bot [isn't considered a `project.bot`](https://gitlab.com/gitlab-org/gitlab/blob/v14.4.2-ee/lib/gitlab/auth.rb#L312) ### Related Discussion I know that we implemented a fix for using Group Access Tokens for regular Git-over-HTTPS operations in !65788 fixing #330718 - and that was meant from the comments to be a stop gap until [Service Accounts](https://gitlab.com/groups/gitlab-org/-/epics/6777) are implemented. This may not be a ~"type::bug" - and it may be that Group Bots aren't considered Project Bots by design - but it does result in a confusing experience when the Pipeline is successfully created - but the pipeline can't pull the git repository for the project. ## Proposal > `@serenafang :` > > Since group tokens are being introduced [this MR](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77449), I think we could [implement this bug fix as described](https://gitlab.com/gitlab-org/gitlab/-/issues/345543#note_733799420) after the MR merges :thumbsup:
issue