Pull Request HowTo

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums.
User avatar
NormandC
Posts: 12066
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Pull Request HowTo

Postby NormandC » Wed Jan 25, 2017 4:10 am

Kunda1, if you get a Github account you can "watch" a git repo and configure email notifications. I get all the Git PRs in my mailbox.
User avatar
bernd
Posts: 3869
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Pull Request HowTo

Postby bernd » Wed Jan 25, 2017 5:52 am

blacey wrote:
Kunda1 wrote:It would be whimsical and fun but for sure not essential, to have a way to know when someone has sent a PR to the FC repo.
Not sure how. :mrgreen:


1) You can already - just ensure the activity feed is visible in Gitter
How does this works? I have been clicking around in Gitter but do not really understand what it is for how it should be used?
User avatar
kkremitzki
Posts: 318
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Pull Request HowTo

Postby kkremitzki » Wed Jan 25, 2017 6:16 am

blacey wrote:
Kunda1 wrote:It would be whimsical and fun but for sure not essential, to have a way to know when someone has sent a PR to the FC repo.
Not sure how. :mrgreen:


1) You can already - just ensure the activity feed is visible in Gitter
2) I thought Kurt was developing an auto-poster that would generate the Pull-request post in the forum.

But, I definitely agree with @yorik that the additional overhead does not provide any real value - if a process step doesn't provide value, it should be eliminated ;)


Yeah, I was/am, but ultimately it's really up to Yorik/Werner as to whether it has any use to continue to make PRs on the forums.

Anyway, here's the status of what I have:
  • A webhook server set up at api.kwkengineering.com
  • Which will make a new topic here with the subject and contents of a new PR if a repo is set to send webhooks to it
  • After the topic is created the link can be added in a comment on the PR
  • It does NOT have locking the PR from further comments is not supported by PyGithub currently but can be implemented fairly easily with requests since it's a length 0 HTTP PUT to an address that can be constructed from the info in the PR

Features like automatically moving closed/merged PR topics could be added pretty easily.

The code is a bit too messy to publish just yet because I have was having some issues with paths, etc, and they're hardcoded in plus debug statements and so forth. Regardless it was still a worthwhile learning experience and there may be some use for a webhook server in the future, even if it's for me and not the FreeCAD project.
User avatar
kkremitzki
Posts: 318
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Pull Request HowTo

Postby kkremitzki » Wed Jan 25, 2017 6:18 am

bernd wrote:
blacey wrote:
Kunda1 wrote:It would be whimsical and fun but for sure not essential, to have a way to know when someone has sent a PR to the FC repo.
Not sure how. :mrgreen:


1) You can already - just ensure the activity feed is visible in Gitter
How does this works? I have been clicking around in Gitter but do not really understand what it is for how it should be used?

Do you see the activity feed? It's shown by clicking a little hamburger menu (three horizontal lines) in the bottom right. Then it shows new PRs, comments, issues, merges, build statuses, etc, in a pane on the right.
User avatar
bernd
Posts: 3869
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Pull Request HowTo

Postby bernd » Wed Jan 25, 2017 6:51 am

kkremitzki wrote:
bernd wrote:
blacey wrote:
Kunda1 wrote:It would be whimsical and fun but for sure not essential, to have a way to know when someone has sent a PR to the FC repo.
Not sure how. :mrgreen:
1) You can already - just ensure the activity feed is visible in Gitter
How does this works? I have been clicking around in Gitter but do not really understand what it is for how it should be used?

Do you see the activity feed? It's shown by clicking a little hamburger menu (three horizontal lines) in the bottom right. Then it shows new PRs, comments, issues, merges, build statuses, etc, in a pane on the right.
Mhh for me the three horizontal lines are on the bottom left and if I click on them a search opens. My idea was to add me too FreeCAD first because gitter do not know I would like to join FreeCAD community on gitter or does it?
User avatar
kkremitzki
Posts: 318
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Pull Request HowTo

Postby kkremitzki » Wed Jan 25, 2017 7:06 am

bernd wrote:
kkremitzki wrote:
bernd wrote:
blacey wrote:
Kunda1 wrote:It would be whimsical and fun but for sure not essential, to have a way to know when someone has sent a PR to the FC repo.
Not sure how. :mrgreen:
1) You can already - just ensure the activity feed is visible in Gitter
How does this works? I have been clicking around in Gitter but do not really understand what it is for how it should be used?

Do you see the activity feed? It's shown by clicking a little hamburger menu (three horizontal lines) in the bottom right. Then it shows new PRs, comments, issues, merges, build statuses, etc, in a pane on the right.
Mhh for me the three horizontal lines are on the bottom left and if I click on them a search opens. My idea was to add me too FreeCAD first because gitter do not know I would like to join FreeCAD community on gitter or does it?

Yeah, it sounds like you might need to join the FreeCAD/FreeCAD room first.
User avatar
bernd
Posts: 3869
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Pull Request HowTo

Postby bernd » Wed Jan 25, 2017 7:11 am

kkremitzki wrote:Yeah, it sounds like you might need to join the FreeCAD/FreeCAD room first.
I could not find the room in gui. What I did was typing the following in the browser address: https://gitter.im/FreeCAD/FreeCAD Than on the bottom there is an orange button "join room" Thanks
User avatar
yorik
Site Admin
Posts: 8554
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Pull Request HowTo

Postby yorik » Wed Jan 25, 2017 4:42 pm

Of course there would always be the possibility to do some webhook stuff to automatically post here when a PR is done on github, like kkremitzki did, but then it should be in a place or in a manner that doesn't need handling here. Maybe directly in the "archived pull requests" section...