Codium-ai / pr-agent

🚀CodiumAI PR-Agent: An AI-Powered 🤖 Tool for Automated Pull Request Analysis, Feedback, Suggestions and More! 💻🔍
Apache License 2.0
5.91k stars 563 forks source link

Gitlab server should handle the draft status #1160

Closed paolomainardi closed 2 months ago

paolomainardi commented 2 months ago

This is an enhancement propsal.

I think that would be useful if the gitlab webhook server could be capable to discard MR in draft status, of course this should be a configurable behavior.

If you think this is useful, I can try to implement it.

mrT23 commented 2 months ago

first share more details. exactly what is not working today, in which platform, in which state.

paolomainardi commented 2 months ago

I never said that something is not working today. It is a proposal to handle the "draft" status.

mrT23 commented 2 months ago

i approved the PR.

Notice that this is not "gitlab webhook server", and that's what led to my pondering. It's a Gitlab pipeline.

paolomainardi commented 2 months ago

@mrT23, thanks, but the pull request was unrelated to this issue; I just faced that bug today while trying to integrate it into a gitlab pipeline.

To add some useful info here, at the moment, AFAIK, the Gitlab Server handles two statuses: open, reopen - ref: https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/servers/gitlab_webhook.py#L127

I was suggesting that draft merge requests could be excluded from merge request parsing using a configuration toggle.

It should be easy to implement and offer several advantages. On the one hand, it reduces the traffic to the selected AI vendor for unwanted parsing, and on the other hand, it respects the draft semantics.

mrT23 commented 2 months ago

welcome to open a PR also for this

paolomainardi commented 2 months ago

Thanks @mrT23