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 support for open-source workflows #103

Open
codenamev opened this issue May 15, 2015 · 8 comments
Open

Add support for open-source workflows #103

codenamev opened this issue May 15, 2015 · 8 comments

Comments

@codenamev
Copy link
Collaborator

codenamev commented May 15, 2015

This feature needs to account for both the external contributor (the one doing the forking) and the members of the project (that do the merging of the PR).

Starting a new task from an opensource project (external contributor):

git reflow start opensource-user/opensource-project

  1. Create fork if one doesn't already exist for the base repo
  2. Create feature branch as usual
  3. git reflow review would squash commits and then submit a cross-fork pull-request
  4. git reflow deliver would check for merge of PR on base-repo, and then cleanup the local repo's feature branch as usual

Delivering (project member merging PR)

When merging down pull requests on opensource projects, it currently loses track of the original author since we're squash-merging the commits. We'll need some sort of way to retain the attribution to the original author (maybe using --author for the final commit?)

  1. git reflow deliver external_contributor_username/project_name (doing this will perform the following)
  2. git remote add remote_user_of_pull
  3. git fetch remote_user_of_pull
  4. git checkout master
  5. git pull origin master
  6. git merge --squash remote_user_of_pull/branch_of_pull
  7. git commit --author "Author of PULL <[email protected]>"
  8. git push origin master
  9. Ask to cleanup remote and if Y: git remote rm remote_user_of_pull

We'll want to implement this as a Custom Workflow and added to the other workflows here.

@codenamev codenamev added the bug label May 15, 2015
@codenamev codenamev changed the title Add attributor to squashed commit for remote contributions Add support for open-source workflows Jun 18, 2015
@codenamev codenamev added feature and removed bug labels Jun 18, 2015
@nhance
Copy link
Member

nhance commented Jul 22, 2015

I like this.

These commands already receive an argument (start being the most visible example). Do we use the presence of a / to change the way it works?

I'm worried about trying to pack so many features into the same tool. Does it make sense to build a copy of reflow and repurpose it for opensource? It could have it's own name and stay very focused on this particular workflow.

@codenamev
Copy link
Collaborator Author

Hmmm... maybe this would be a good time to introduce the idea of a workflow. Meaning, you can define your workflow in a config file that would plug-in to git-reflow. Like the way oh-my-zsh works with plugins combined with the idea of how capistrano handles callbacks.

So you could define a file that has a bunch of before/after calls that can target the core workflow (the basic reflow commands) as well as target other workflows. An example of what I have in mind:

# Core workflow
commands :setup, :start, :review, :status, :stage, :deliver

start(branch_name) do
  run_command_with_label 'git pull origin', { GitReflow.current_branch }
  run_command_with_label 'git push origin', { "#{GitReflow.current_branch}:refs/heads/#{branch_name}" }
  run_command_with_label 'git checkout --track -b', { "#{branch_name} origin/#{branch_name}" }
end

# ... other commands would go after this

Then to create the opensource workflow:

# Open-source workflow
require 'git_reflow/workflows/core' # would setup all default commands

replace(:start) do
  # ... commands to run instead of git-reflow core
end

before(:start) do
  # ... do something else here
end

after(:start) do
  # ... do something else here
end

@codenamev
Copy link
Collaborator Author

I think this would be a great push for a big 1.0 release ;-)

@nhance
Copy link
Member

nhance commented Jul 22, 2015

Damn it would be cool if we could make it that simple. Any idea on how we can offer an out of the box experience that let's people use it for opensource in less than say 45 seconds?

@codenamev
Copy link
Collaborator Author

Isn't that what GitHub is for? 😜

@sethladd
Copy link
Contributor

Here's what we do now: https://github.com/dart-lang/sdk/wiki/Merging-a-PR-contribution

Would be great to have something similar (and easier) from reflow.

@pboling
Copy link
Contributor

pboling commented Apr 8, 2016

We are implementing the workflow feature now at @invoice2go, will have a PR for review, based on the example given by @codenamev within a few days.

@codenamev
Copy link
Collaborator Author

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

No branches or pull requests

4 participants