contribution workflow

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

contribution workflow

Ben Coman
I'm not sure how closely my contribution workflow matches the standard advertised, so just wanted to share it for feedback.  I may remember wrongly, but my understanding of the advertised process was forking the "pharo-project/pharo" repo, then cloning from my fork.  However I found it awkward to keep the "master" branch of my fork synchronised with upstream.

What I ended up finding easiest is *always* cloning "pharo-project/pharo" then adding my "bencoman/pharo" repo as a remote.  Iceberg then makes it simple to push just my working branches to my fork from where I can issue a PR.  I never need to trouble synchronising the master branch in my fork.

How does that compare to your contribution workflow?

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: contribution workflow

Pavel Krivanek-3
You may simply clone your fork because the synchronization between it and the upstream repository is done automatically if you are contributing using Iceberg. When you are creating a branch from your image commit, Iceberg fetches the main Pharo repository to obtain information about the required commit and your fork is updated as soon as you commit the fix. The same thing is true for the other projects too as soon as you clone the repository using the option "Clone From github.com" because this operation uses the GitHub API to obtain information about the repository from which your repository was forked. It is not the case for the option "Clone remote repository".

To contribute to Pharo, follow this documentation:

Cheers,
-- Pavel

po 21. 1. 2019 v 16:59 odesílatel Ben Coman <[hidden email]> napsal:
I'm not sure how closely my contribution workflow matches the standard advertised, so just wanted to share it for feedback.  I may remember wrongly, but my understanding of the advertised process was forking the "pharo-project/pharo" repo, then cloning from my fork.  However I found it awkward to keep the "master" branch of my fork synchronised with upstream.

What I ended up finding easiest is *always* cloning "pharo-project/pharo" then adding my "bencoman/pharo" repo as a remote.  Iceberg then makes it simple to push just my working branches to my fork from where I can issue a PR.  I never need to trouble synchronising the master branch in my fork.

How does that compare to your contribution workflow?

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: contribution workflow

Guillermo Polito
In reply to this post by Ben Coman
Hi Ben,

I'll just expand a bit on what Pavel said.

On Mon, Jan 21, 2019 at 4:59 PM Ben Coman <[hidden email]> wrote:
I'm not sure how closely my contribution workflow matches the standard advertised, so just wanted to share it for feedback.  I may remember wrongly, but my understanding of the advertised process was forking the "pharo-project/pharo" repo, then cloning from my fork.  However I found it awkward to keep the "master" branch of my fork synchronised with upstream.

It's important to understand that you don't need to keep any branch in your fork synchronized ^^.
Pull requests bind two branches, not two repositories.
Your repository may have 30 branches, all outdated, and the only one that needs to be "up to date" is the one participating in a pull request.

Even, I'd say it's not really required to have the branch of the PR up to date either, as git will just make a merge with it, calculating correctly the point of divergence between the two branches. However, making a branch that started too far away in the history (too old) will just increase the possibility of a merge conflict. Actually, the easiest is that you start working on a branch whose tip points to the same commit the image was created from.
This is to make sure that:
 - you will have correct diffs
 - your PR does not introduce commits that you did not intend to

And that's what Iceberg repair actions will guide you to.
 
What I ended up finding easiest is *always* cloning "pharo-project/pharo" then adding my "bencoman/pharo" repo as a remote.  Iceberg then makes it simple to push just my working branches to my fork from where I can issue a PR.  I never need to trouble synchronising the master branch in my fork.

How does that compare to your contribution workflow?

What I do:
 - I download a new image, that was built from commit xxx (the image and iceberg know that, so you don't have to care about it)
 - then I clone pharo from my fork, or I make the existing pharo repo point to an existing clone
    - (this is automatically done for you) iceberg github integration will make a request to github asking if the repository is a fork or not, and in the case IT IS it will configure the remotes for you
 - iceberg will most surely tell me "Fetch required". This means that the commit of my image is not in the cloned repository. I do a fetch.
 - Then I create a branch from my image commit

From that point on, everything is up and running. You can just work, commit, push to your fork, make a PR.

 

cheers -ben


--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: contribution workflow

Ben Coman


On Tue, 22 Jan 2019 at 17:28, Guillermo Polito <[hidden email]> wrote:
Hi Ben,

I'll just expand a bit on what Pavel said.

On Mon, Jan 21, 2019 at 4:59 PM Ben Coman <[hidden email]> wrote:
I'm not sure how closely my contribution workflow matches the standard advertised, so just wanted to share it for feedback.  I may remember wrongly, but my understanding of the advertised process was forking the "pharo-project/pharo" repo, then cloning from my fork.  However I found it awkward to keep the "master" branch of my fork synchronised with upstream.

It's important to understand that you don't need to keep any branch in your fork synchronized ^^.
Pull requests bind two branches, not two repositories.
Your repository may have 30 branches, all outdated, and the only one that needs to be "up to date" is the one participating in a pull request.

Even, I'd say it's not really required to have the branch of the PR up to date either, as git will just make a merge with it, calculating correctly the point of divergence between the two branches. However, making a branch that started too far away in the history (too old) will just increase the possibility of a merge conflict.

 
Actually, the easiest is that you start working on a branch whose tip points to the same commit the image was created from.
This is to make sure that:
 - you will have correct diffs
 - your PR does not introduce commits that you did not intend to

Sure, I often do the same to avoid feeling lost when I don't understanding where extra changes are coming from.
However right now I have a PR from November that didn't make it into Pharo 7 and I'm now trying bring forward for Pharo 8.
Could work with me to reproduce this to see where I'm going wrong...

My image is up to date with Pharo 8, 2019-01-31 19:23, commit 2c0b5d0.
I repaired the "pharo" repo  such that remotes after repairing are...
* origin = [hidden email]:bencoman/pharo.git
* pharo-project = [hidden email]:pharo-project/pharo.git
though if you use https the rest of this workflow should go the same for you.

Double-checked I was up to date by again checking out "pharo-project/Pharo8.0".
Now I want to bring forward my changes from  "origin/22637-Minor-cleanup-of-Delay"
Right-clicking on it I only the choice to "Checkout branch", but I don't want to do that 
since I feel its likely to break something.  A checkout doesn't focus on the package my 
changes are in but reverts months of changes through the whole live system.  

The <Merge> button is another option, choosing "origin" then "22637-Minor-cleanup-of-Delay"
In the preview window is a massive amount of changes that have nothing to do with me.
I guess its again months of every else's changes to Pharo that would be risky and confusing to proceed.

I feel what I need is something like "origin/22637-Minor-cleanup-of-Delay" right-click > Rebase to HEAD
which would determine the common ancestor f2078b5 and integrate just my changes since then.

I can't see any other options.   How would you handle it?   

cheers -ben

P.S. Side info on conflict if you bump into it.  DelaySpinScheduler was removed from Pharo 7 after I submitted that PR for issue 22637.