Unable to make initial commit and/or add initial file via GitLab v4 api
Summary
After using v4 api with to successfully create a new project with python requests, subsequent api call to make initial commit fails with 404 Not Found error. Private token used has global admin and group owner permissions. Procedure was working after bug was fixed in possibly an 8.17 patch release but regression reintroduced in subsequent major/minor versions.
GitLab Shell 5.3.1
GitLab Workhorse v2.3.0
GitLab API v4
Git 2.13.0
Ruby 2.3.3p222
Rails 4.2.8
postgresql 9.6.2```
### Steps to reproduce
Create project using v4 api post using python requests:
```response = requests.post(gitlab_private_endpoint + '/api/v4/projects', headers={'PRIVATE-TOKEN': 'private_token'}, params={
'name': "new_repo",
'namespace_id': 6,
'issues_enabled': 'true',
'merge_requests_enabled': 'true',
'wiki_enabled': 'true',
'snippets_enabled': 'true',
'shared_runners_enabled': 'false',
'visibility_level': 0,
'request_access_enabled': 'true',
'lfs_enabled': 'true',
'approvals_before_merge' : 1
})```
After success response is returned make api call to create initial commit:
```requests.post(gitlab_private_endpoint + '/api/v4/projects/' + str(project['id']) + "/repository/files", headers='PRIVATE-TOKEN': 'private_token'}, params={
'file_path': 'README.md',
'branch_name': 'master',
'content': 'new_repo',
'commit_message': 'initial commit, add README'
})```
Error 404 response is returned
```{"error":"404 Not Found"}```
### What is the current *bug* behavior?
Making initial commit to master via api after project creation returns ```{"error":"404 Not Found"}```
### What is the expected *correct* behavior?
Making initial commit correctly adds new file and creates master branch as as result after project creation
### Relevant logs and/or screenshots
```{"error":"404 Not Found"}```
### Possible fixes
This bug was possibly fixed in a patch version of 8.17 but regression was reintroduced in subsequent major/minor versions
Edited by username-removed-1159266