Skip to content
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] ocabot migration issue maintainer #97

Merged
merged 1 commit into from
Nov 13, 2021

Conversation

pedrobaeza
Copy link
Member

New ocabot command for maintaining migration issues:

/ocabot migration, followed by the module name, performing the following:

  • Look for an issue in that repository with the name "Migration to version {version}", where {version} is the name of the target branch.
  • Add or edit a line in that issue, linking the module to the pull request (PR) and the author of it.
  • TODO: When the PR is merged, the line gets ticked.
  • Put the milestone corresponding to the target branch in the PR.

cc @Tecnativa TT21199

@pedrobaeza
Copy link
Member Author

@sbidoul can you take a look and if it looks good for you, deploy it on OCA server for doing real tests?

@pedrobaeza
Copy link
Member Author

I have put the command migration, but if you prefer another one, we can talk about it.

@sbidoul
Copy link
Member

sbidoul commented Jan 5, 2020

@pedrobaeza thanks for working on this.

I'm good with the overall concept. A couple of comments though:

  • I would split the setting of the milestone in another PR: that action is not specific for migrations, and can be done on all PRs.
  • I'm not 100% comfortable with the use of a command to trigger this action, perhaps it would seem more natural by looking at [MIG] in the subject, or looking for a Migration label? Actually, we could trigger this action on the presence of a Migration label, and have a separate action that sets the Migration label automatically if there is [MIG] in the subject?

@pedrobaeza
Copy link
Member Author

I would split the setting of the milestone in another PR: that action is not specific for migrations, and can be done on all PRs.

Well, I was thinking in being activated manually with this because not all repos follow this milestone way (for example, you with OCA/mis-builder).

I'm not 100% comfortable with the use of a command to trigger this action, perhaps it would seem more natural by looking at [MIG] in the subject, or looking for a Migration label? Actually, we could trigger this action on the presence of a Migration label, and have a separate action that sets the Migration label automatically if there is [MIG] in the subject?

Apart from the reason exposed for checking permissions, there are incorrect migration PRs that shouldn't be pointed until a reasonable quality state is got (I did this for example until commit history is preserved at least). The last reason is that almost nobody respect commit message format, so it's almost impossible to deduce module from this title. Editing the title to conform the specs is worse as:

  • It requires permission to do it (only persons with write permissions in repo can do it), so you leave out module maintainers.
  • It requires to know a more difficult syntax than the command one.

@pedrobaeza pedrobaeza mentioned this pull request Jan 15, 2020
26 tasks
@pedrobaeza
Copy link
Member Author

@sbidoul what do you think about my replies?

@sbidoul
Copy link
Member

sbidoul commented Feb 6, 2020

@pedrobaeza I understand your argument for making it a command. It makes sense.

Splitting the setting of the milestone in another PR that is independent of this command sounds important. It can simply work by looking at the target branch and setting the milestone or label if one exist with the same name.

Also a couple of unit tests for the inner part of the command will make future maintenance much less stressful :)

@legalsylvain
Copy link
Collaborator

Is it still WIP ?

@sbidoul
Copy link
Member

sbidoul commented May 26, 2020

My last #97 (comment) is still current. If someone can do this split and add a small test for the inner part that should be good.

@pedrobaeza
Copy link
Member Author

For me the split is not needed and the test is a picky thing. This is working as is.

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, no, asking for a minimal test is definitely not nitpicking.

Same for the part that sets the milestone: it can be done automatically on all PRs and is totally independent of updating the migration issue. This is basic separation of concerns.

@pedrobaeza
Copy link
Member Author

I don't know how to make tests of this, and simply the setup of all the needed parts is something I can't afford, so all yours.

@pedrobaeza
Copy link
Member Author

@victoralmau can you please catch this one and finish it?

@victoralmau victoralmau force-pushed the migration_maintainer branch 4 times, most recently from efc3950 to 6be0c83 Compare February 23, 2021 07:11
@victoralmau
Copy link
Member

Hi @sbidoul i have added some test about these new command.
It's not possible to test it (green) because it's necessary to github access. What idea propose you to solve it?

@legalsylvain
Copy link
Collaborator

@victoralmau : could you rebase ? there is a conflict.

@sbidoul : could you answer to the last question of @victoralmau ?

thanks !

@sbidoul
Copy link
Member

sbidoul commented Aug 10, 2021

@victoralmau I see you started using VCR for the tests, and you have factored out the inner code for easier testing. That sounds like the right approach to me. What problem do you have ?

@joao-p-marques joao-p-marques force-pushed the migration_maintainer branch 2 times, most recently from 1ad1ecc to 5c0fc66 Compare October 22, 2021 13:28
@joao-p-marques
Copy link
Member

@pedrobaeza @sbidoul I fixed the tests and I think it should be good now. OTOH, I think the fix from sigmavirus24/github3.py#1048 might be necessary.

Copy link
Collaborator

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review.

Thanks for this great feature.

@pedrobaeza
Copy link
Member Author

@sbidoul good for you? The problem is if we can't deploy it without the patch, or maybe deploy that Github patched library?

New ocabot command for maintaining migration issues:

``/ocabot migration``, followed by the module name, performing the following:

* Look for an issue in that repository with the name "Migration to version
  ``{version}``", where ``{version}`` is the name of the target branch.
* Add or edit a line in that issue, linking the module to the pull request
  (PR) and the author of it.
* TODO: When the PR is merged, the line gets ticked.
* Put the milestone corresponding to the target branch in the PR.

Co-authored-by: Pedro M. Baeza <pedro.baeza@tecnativa.com>
@joao-p-marques
Copy link
Member

@pedrobaeza @sbidoul Turns out the patch was not necessary, I was just creating the wrong test cassete, thinking it was an error caused by an update to the Github API spec.

It should be green now.

Copy link
Contributor

@MiquelRForgeFlow MiquelRForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the yaml files are difficult to review, but LGTM

@joao-p-marques
Copy link
Member

the yaml files are difficult to review, but LGTM

Thanks for the review 👍

Well, it is hard to work around that with the current test setup... The other option would be to encode the response body to make it more compact, but at the same time unreadable, so IMHO it is still better this way...

@pedrobaeza
Copy link
Member Author

@sbidoul any news about this? It would be very interesting to have it for the migrations to v15 for saving a lot of maintenance work.

@sbidoul sbidoul merged commit 016b10c into OCA:master Nov 13, 2021
@sbidoul
Copy link
Member

sbidoul commented Nov 13, 2021

I just deployed this. Thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants