Open jbaudoux opened 3 weeks ago
That looks great ! Do you think it's complicated to do ?
The problems I see are:
Anyway, the syntax of the comment will be easier than the current one. Is there any workaround for the second problem?
- If the description is changed, there's no GH actions re-triggering, so a manual git operation should be done to re-trigger them.
@pedrobaeza I think this should do the trick:
on:
pull_request_target:
types: [opened, edited, reopened]
I don't think so. I think that "edited" part means the top edition (base branch changed - and maybe PR title? -):
If changing the PR title serves, it can be tricky, but it's an option.
But there's also a risk: to trigger a lot of checks when people put a garbage PR title and someone corrects it.
Indeed, from what I understand, edited
is triggered only when you change the target base. Using pull_request
would trigger when changing the title or description but that won't be a good idea.
Maybe best would be to close and reopen the PR if you had to change the Depends on
in the description
OK, if that works, it can be an option. Don't remember if doing that, GH actions are retriggered, or they reuse last results.
Thanks for the proposal @jbaudoux .
I would do it the other way around:
test-requirements.txt
IMO this would be better because:
Last but not least we could improve the bot to remove the deps on merge and on rebase, or add a specific command to cleanup deps w/o having to ask to the author.
@simahawk That was my initial idea but I saw multiple drawbacks and changed my mind.
Here are the cons:
test-requirement.txt
test-requirement.txt
and how to write the dependency properly, the syntax is not straight forwardtest-requirement.txt
test-requirement.txt
for the ci, than removing them at ocabot merge (i.e. altering the right commit)I don't think the bot can modify the branch that is on another remote. So it cannot rebase and cannot drop the dep in test-requirement.txt
but I may be wrong...
- what is merged is not exactly what was pushed
What do you mean?
* if you depend on multiple PRs, then once one of the PR is merged, you cannot rerun the CI
What do you mean?
* as you need to modify what will be merged, you modify a commit or drop an entire commit; if it fails, the PR will remain green and you need to dig in the log to see why; you need to task the dev to rebase
It is already the case today: you can issue a merge command and the merge branch fails -> PR green, merge branch red -> you've got to check the merge branch build. I don't see any issue w/ this.
* if one of the dependency is taken over by someone else in a new PR, you cannot modify the dependency without asking a dev to change the `test-requirement.txt`
Managing it via description won't solve this. In any case, IMO is not ideal (if not dangerous) to replace a dependency w/o direct action by the authors of the PR.
* you need to teach to use that `test-requirement.txt` and how to write the dependency properly, the syntax is not straight forward
It's python standard. You can find docs on how to do it everywhere, docs that you don't have to maintain ;)
Plus, from v17 is a bit more clear as it does not required setup/
.
* when you git-aggregate multiple PRs with dependency, you need to fix conflicts with the `test-requirement.txt`
Nope, there's a trick to select only what you want (check our projs :wink: ).
Eg:
shell_command_after:
- curl -sSL https://github.com/OCA/$repo/pull/$nr.patch | git am -3 --keep-non-patch --exclude '*requirements.txt'
* I feel that it is easier to generate extra lines in the `test-requirement.txt` for the ci, than removing them at ocabot merge (i.e. altering the right commit)
I feel that it's easier to delete a commit that is known to do only one thing. rather then editing a file :wink:
I don't think the bot can modify the branch that is on another remote. So it cannot rebase and cannot drop the dep in
test-requirement.txt
but I may be wrong...
That's already a problem today. We need to address this somehow. We could:
@legalsylvain @sbidoul I guess you faced the same problem when working around ocabot rebase
. Do you have any insight on possible solutions?
- what is merged is not exactly what was pushed
What do you mean?
That you need to modify a commit and so you modify the commit sha. Or you need to drop a commit from the PR, so you don't really merge the PR
- if you depend on multiple PRs, then once one of the PR is merged, you cannot rerun the CI
What do you mean?
You need to ask the contributor to drop one of the line in the test-requirement.txt
and repush while you could just rerun the ci and let the ci install the open dependency on top of the latest base
- as you need to modify what will be merged, you modify a commit or drop an entire commit; if it fails, the PR will remain green and you need to dig in the log to see why; you need to task the dev to rebase
It is already the case today: you can issue a merge command and the merge branch fails -> PR green, merge branch red -> you've got to check the merge branch build. I don't see any issue w/ this.
It is failing but still green. I don't find it right
- if one of the dependency is taken over by someone else in a new PR, you cannot modify the dependency without asking a dev to change the
test-requirement.txt
Managing it via description won't solve this. In any case, IMO is not ideal (if not dangerous) to replace a dependency w/o direct action by the authors of the PR.
Updating the description is easy. The ci will re-run with the new dependency. The contributor or the PSC can do it. In you case, only the contributor can do it. This has no value as you still ask the contributor to drop it before merging.
- you need to teach to use that
test-requirement.txt
and how to write the dependency properly, the syntax is not straight forwardIt's python standard. You can find docs on how to do it everywhere, docs that you don't have to maintain ;) Plus, from v17 is a bit more clear as it does not required
setup/
.
It is still a hack for the ci to run properly. Otherwise, this would be in requirement.txt
and not in `test-requirement.txt as it is a dependency and not a test dependency.
But still it is a temporary hack you need to learn when you make PRs on the OCA. While you may or may not need when working on a project.
- when you git-aggregate multiple PRs with dependency, you need to fix conflicts with the
test-requirement.txt
Nope, there's a trick to select only what you want (check our projs 😉 ).
I know... but again a trick to learn...
I'm more in favor of a solution that can lower the complexity. But this is just my opinion and happy to get feedback.
hack for the ci to run properly
The ci and runboat as well
It do not work cross-repo, but it works like I understand the documentation, it may facilitate the rebasing from the github UI.
It is still a hack for the ci to run properly.
It's not an hack. It's they you install python packages.
That you need to modify a commit and so you modify the commit sha. Or you need to drop a commit from the PR, so you don't really merge the PR
This is not a problem. The contrary. If you rely on the description, you have no unique identifier for the status of that PR.
Updating the description is easy. The ci will re-run with the new dependency. The contributor or the PSC can do it. In you case, only the contributor can do it. This has no value as you still ask the contributor to drop it before merging.
Is not "my case". It's the current situation :) I'd rather spend time finding a way to be able to amend a PR (remember: we need this also to ease rebases by maintainers) rather then spend time in a non standard way to install pending merges.
My POV of course :)
Currently, stacked PR are managed by asking the contributor to add a separate "do not merge" commit that lists the dependencies in the
test-requirements.txt
. Once the dependency is merged, we need to ask again the contributor to modify the PR to drop the change to thetest-requirements.txt
; it's a back and forth process implicating multiple parties.My proposal would be to not require to list open PRs in the
test-requirements.txt
but rely on the PR description "Depends on" keyword. The advantages I see:test-requirements.txt
On the technical aspect, this means modifying the
test.yml
jobs:unreleased-deps
: add a step to parse the PR description for "Depends on" to mark that step as red. We can rely on https://github.com/gregsdennis/dependencies-actiontest
: append the modules modified by open PRs in thetest-requirements.txt
after the checkout and before the installation of the modulesWhat is your opinion ? What are your remarks ?