Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create the PR and branch in repo #383

Closed
bgawale opened this issue Sep 13, 2023 · 5 comments
Closed

Unable to create the PR and branch in repo #383

bgawale opened this issue Sep 13, 2023 · 5 comments
Labels
question Further information is requested

Comments

@bgawale
Copy link

bgawale commented Sep 13, 2023

Release version

v4.10.0

Describe the bug

We are using Azure DevOps and the extractor pipeline is currently functioning ok, producing the required artifacts, however, it's facing an issue when trying to create the PR and temp branch within the repository. We've reviewed the documentation and referred to the article below as per docs, but unfortunately, the issue persists.

We've also confirmed that the build service has the necessary permissions to create branches and pull requests in the repository, but this hasn't resolved the problem.

https://learn.microsoft.com/en-us/azure/devops/pipelines/policies/set-permissions?toc=%2Fazure%2Fdevops%2Forganizations%2Fsecurity%2Ftoc.json&bc=%2Fazure%2Fdevops%2Forganizations%2Fsecurity%2Fbreadcrumb%2Ftoc.json&view=azure-devops

Not sure if there are any alternative documents we should refer to make it work, especially in the event that the links to Microsoft's documentation have changed.

Images for reference:
image

For build service permissions on repo:
image

Expected behavior

The pipeline should be able to create the PR and branch in the repository.

Actual behavior

The pipeline runs successfully but the PR and the temporary branch is not getting created in the repository.

These are debug logs from the Create pull request action

##[debug]Write-Information "Clone URL is $cloneUrl"
##[debug]git -c http.extraheader="AUTHORIZATION: Bearer ***" clone --branch "$branchName" --depth 1 "$cloneUrl" "$temporaryFolderPath"
##[debug]if ($LASTEXITCODE -ne 0) { throw "Cloning branch $branchName in repository $repositoryName failed." }
##[debug]
##[debug]Write-Information "Creating temporary branch $temporaryBranchName from $branchName..."
##[debug]git -C "$temporaryFolderPath" checkout -b "$temporaryBranchName" "$branchName"
##[debug]if ($LASTEXITCODE -ne 0) { throw "Creating temporary branch $temporaryBranchName from $branchName failed." }
##[debug]

Reproduction Steps

NA

@github-actions
Copy link

🎉 Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes. 🎉

@waelkdouh
Copy link
Contributor

Did you check the closed issues? I remember others having similar issue with their own devops environment.

@waelkdouh waelkdouh added the question Further information is requested label Sep 13, 2023
@bgawale
Copy link
Author

bgawale commented Sep 13, 2023

Yes, we've examined a few issues resembling this one, such as #177. However, it redirected us to refer to the documentation we've already referred and verified that the permissions are correctly configured.

Additionally, it's worth noting that our pipeline isn't failing; rather, it's encountering a challenge when attempting to create the PR and branch in the repository. The logs shared above indicate that this issue is likely related to permissions which are already aligned with what is mentioned in the documentation.

@bgawale
Copy link
Author

bgawale commented Sep 13, 2023

It also seems that there are no error messages generated, and all tasks are marked as successfully completed, which includes the creation of a pull request. However, when we check the repository, there is no evidence of a new branch being created, and there is no active pull request visible.

image

and it ends with

image

@bgawale
Copy link
Author

bgawale commented Sep 14, 2023

Update - Sharing this information for reference in case someone else encounters a similar issue. The root cause of the problem was related to the extractor pipeline parameter, specifically "API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH," which was initially set to "artifacts." However, it seems that the code responsible for creating a new branch and PR does not function correctly with this value. To resolve the issue, the value needed to be changed to something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants