-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add support for applying dependent patches when applying a patch #71
Comments
I'm okay with implementing this client side but my preference would be to expose the via Patchwork server. That way we can expose via the API and support in other clients (like pwclient) also. It should be as simple as: class Patch(SubmissionMixin):
...
dependencies = models.ManyToManyField(
"self",
symmetrical=False,
related_name="dependents",
related_query_name="dependent",
) class Series(FilenameMixin, models.Model):
...
dependencies = models.ManyToManyField(
"self",
symmetrical=False,
related_name="dependents",
related_query_name="dependent",
)
... plus the relevant parser and API changes. The parser would need to parse those wdyt? |
Yes, that approach sounds good to me and is definitely better than just implementing it in git-pw. |
For next steps, should I create another issue on the main patchwork repository for these changes? Another comment I have about the approach above, how would we handle a series which is dependent on a patch, or vice versa? It seems like that solution would only handle a series being dependent on another series, or a patch being dependent on another patch. |
Yes, that would be best.
Absolutely. Patchwork has long been a spare-time activity for me (none of the projects I work on currently use a mailing list-driven development process) so the more I can leave to others the better for me/project throughput 😄
I've been thinking over this and have come to the conclusion that neither patch-series dependencies nor patch-patch dependencies are a good idea. Consider things from an end-user/UX perspective. Currently, if we run fwiw I've also looked around and I don't think this is a problem that's really been solved elsewhere. The two examples of similar functionality that jump to mind are Gerrit and Mergify but both of them only allow mapping of the highest level "container" to other instances of same. Gerrit is focused entirely on individual commits and doesn't really have the concept of series, so you track dependencies by simply rebasing one or more commits on top of another commit [*]. Mergify, by comparison, only seems to care about Pull Requests (which are functionally similar to Series) and therefore you can only specify Based on the above and considering that series are a thing and we already have the concept of patch dependencies (on preceding patches from a patch's series), I suspect it would be much easier if we only allowed allow series to depend on other series (that is, if we only respected [*] OpenDev Gerrit (i.e. what's used for OpenStack development), or more specifically Zuul, extends this slightly by supporting a |
btw, we could still infer series dependencies when applying patches. For example, if series Y depended on series X, then I would expect |
It may be interesting to keep the per-patch granularity for reviewers. |
So to be clear, if patch 1686360 states:
Can we infer every patch in the same series as patch 1686360 has the same dependency? What about if patch 1686360 states:
In this case, can we infer we depend on the series patch 1519911 depends on, rather than that patch specifically? (note: we don't have to use that trailer syntax specifically - I'm more focused on how we form the associations) |
Yes. If a single patch x in some series X references another series Y, then that should be interpreted as X depends on Y.
We do the same thing here. This way we can allow dependencies to be declared in any of the commit messages, while keeping the complexity of the dependency relations low. I think the reasoning behind this is so that developers can make it clear that, for example, code contained in patch 3/4 in a series is what depends on another series. |
@loudonlune Okay, that makes sense to me and I've no issues with that. In effect, dependencies will still be between series (and only between series) but we can specify a dependency on a series from a patch in another series. We can also reference a patch from a series in place of the series itself. Both seem reasonable. |
@loudonlune Could you create a new issue at https://github.com/getpatchwork/patchwork/issues and close this one out, since the work needs to happen there now. I'm happy to review patches if you have someone to work on the feature. |
Sure thing. Here is the new issue: getpatchwork/patchwork#583 |
The DPDK project has defined syntax for a "Depends-on" tag. A contributor can add this label to their patch or cover letter if it depends on another patch or series that has not yet been applied to the target branch.
The syntax for this tag and where it appears in a patch file is as follows:
There can be multiple of these tags defined with differing values. An implementation is intended to collect them into a list. When applying a patch which has these tags, they should be applied in the order listed in the patch file. This process is not recursive, as in if the dependents of a patch have additional dependents, those are not applied.
The ask is for, when running
git pw patch apply <id>
orgit pw series apply <id>
, the command will scan for these dependent patches or series and apply them automatically as described above.Would this functionality be useful to other projects, and appropriate to add to git-pw?
The text was updated successfully, but these errors were encountered: