-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support additional pull request actions (closed, merged, etc) #1878
Comments
I think this definitely makes sense. I'm interested in other event types that we might want to add to ensure that we don't need to make any additional design changes or abstractions. For example, if we want to support ALL tags we could consider adding an action field (this would make this a very large change, though). Here is a list of all Bitbucket pull request actions:
Here are GitHub pull request actions:
Here are some other GitHub events that we don't handle today:
It is also important to note that drone assumes it can clone a pull request (or tag) as part of the pipeline process. So drone probably can't handle a tag deleted event because it will have nothing to clone, and won't be able to fetch the .drone.yml for the tag ref (since it was just deleted). NOTE this might also be the case for pull requests being closed, so we will need to verify. |
there was a thread in the discourse forum: I will copy my comments here |
Copied from discourse thread. Database Changes [COMPLETED]First step will be to decide how we want to represent and store this data in our Go code and in our database. We will need to store the action type, as you pointed out above. create table builds (
+build_action TEXT
); I would suggest that action values for pull requests should be the following:
The GitHub Yaml ChangesI like the yaml syntax proposed above. I would probably slightly alter to support the below variations. Note that we have many of the required structures in place that we should be able to re-use, so supporting flexible configurations should not be am implementation issue.
OR perhaps we use the actions section and if the action is closed or merged or re-opened (or whatever) it must be specified in the actions section?
Avoid Breaking Changes [NEED MORE INFO]If we started automatically triggering builds for all pull request actions it would probably cause a problem for existing configurations. They will not be expecting builds for So to avoid breaking existing pipelines, this should probably be disabled by default. This will require some addition technical design. I'm not sure the best approach at this time ... MVP ImplementationI think an initial implementation would need to include the following:
|
cc @therynamo |
Are there plans to implement this @bradrydzewski? |
@bradrydzewski +1 My team is also interested in whether Drone can handle pull_request_updated, pull_request_closed, and pull_request_reopened properly as part of |
@bradrydzewski +1 We are trying to implement a gitops and this is required to know whether its time to create a new environment or terminate it (based on event pull request open and pull request merged/declined). |
What's the status of this? |
Any update with this? We are trying too to create ephemeral environments but if we don't know when to terminate them it gets a little tricky. |
I'm interested in triggering builds based on pull requests being merged--any update with this? |
Sorry no updates. When this issue is scheduled for a future release, it will be attached to a milestone, and when work is started we will post a note in the comments. |
Related: #2685 |
I gave "close" a go here: It's not tested, but if the design is correct I would have the opportunity to do the due diligence in the coming week(s) |
@bradrydzewski I'm a little confused based on what I've read in issues and code about what's been implemented with this and what's not. It seems to me that you all have implemented the following:
And based on your statements from above the plan is that There's no documentation for this yet, so I'm a little in the dark. |
@bradrydzewski -- actually I just found this too:
in |
the |
@bradrydzewski Does this mean that a branch deletion event is now a supported trigger? |
To summarize the current state of affairs:
As for a "strategy for not breaking existing projects"...
This is my proposal:
In situations like Case 2 (#2902 (comment)), I don't think there's a way to provide a "compatible" upgrade as the use of the At some point, the Drone project will need to realize it can only pick 2 of the three:
My suggestion is to unblock users is to:
If that is not acceptable, then an alternative proposal that maintains compatibility temporarily (while the fields exist as they do today) but makes the end-user experience more painful: only trigger the new actions when they are explicitly written out.
I sincerely and strongly hope Drone is able to move forward with this feature as it's something that has been waited for on a long time and would be a huge improvement that is worthwhile making changes to use it. |
Hoping there will be some movement on this.
One thought I had was that when a PR is closed, it doesn't really affect this issue since when the PR is closed, the clone would fail as the merge ref won't exist for the branch right? One of the main use case this issues unlocks is running post-PR close actions, such as deleting namespaces. Here is an example of what this can do in Codefresh: https://codefresh.io/docs/docs/ci-cd-guides/preview-environments/#cleaning-up-temporary-environments |
Also need this to realize an end-to-end GitOps implementation. |
As discussed on Gitter.
Use case
When a PR is opened, deploy the app somewhere, and when the pr is closed, tear it down.
Related code
The text was updated successfully, but these errors were encountered: