UCP: `auto-update` reuse exist pull request
Description
When the auto-update being triggered frequently, there will be many opened PRs being generated, but only the latest one is required, the outdated unmerged PRs are spamming.
Score
- 100
Mentor
@you06
Recommended Skills
- Go
Learning Materials
I'd like to finish it, but I don't have any ideas. Could you give me more information? :+1: thanks.
The updated PR will be created here. https://github.com/pingcap-incubator/cherry-bot/blob/53734a35c63e1f7b67a2654ceeffb478c122cd90/pkg/providers/auto-update/pr.go#L59
To reuse an exist PR, you need to find it and force push to the head branch. Unfortunately, there is not a way to find the exist PR directory, you may filter PRs by author, target branch and title to find out it (it's also ok to record in database if you would like to create a new table).