git_reflow 0.8.10 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/multi-ruby-tests.yml +33 -0
  3. data/.rubocop.yml +2 -0
  4. data/.ruby-version +1 -1
  5. data/Appraisals +1 -6
  6. data/CHANGELOG.md +466 -348
  7. data/Gemfile.lock +100 -70
  8. data/LICENSE +20 -20
  9. data/README.md +36 -12
  10. data/Rakefile +15 -8
  11. data/Workflow +3 -0
  12. data/bin/console +7 -7
  13. data/bin/setup +6 -6
  14. data/exe/git-reflow +14 -30
  15. data/git_reflow.gemspec +25 -24
  16. data/lib/git_reflow.rb +3 -14
  17. data/lib/git_reflow/config.rb +52 -17
  18. data/lib/git_reflow/git_helpers.rb +69 -22
  19. data/lib/git_reflow/git_server/base.rb +68 -68
  20. data/lib/git_reflow/git_server/git_hub.rb +53 -40
  21. data/lib/git_reflow/git_server/git_hub/pull_request.rb +25 -17
  22. data/lib/git_reflow/git_server/pull_request.rb +19 -3
  23. data/lib/git_reflow/merge_error.rb +9 -9
  24. data/lib/git_reflow/rspec.rb +1 -0
  25. data/lib/git_reflow/rspec/command_line_helpers.rb +23 -6
  26. data/lib/git_reflow/rspec/stub_helpers.rb +13 -13
  27. data/lib/git_reflow/rspec/workflow_helpers.rb +18 -0
  28. data/lib/git_reflow/sandbox.rb +16 -6
  29. data/lib/git_reflow/version.rb +1 -1
  30. data/lib/git_reflow/workflow.rb +305 -10
  31. data/lib/git_reflow/workflows/FlatMergeWorkflow +38 -0
  32. data/lib/git_reflow/workflows/core.rb +208 -79
  33. data/spec/fixtures/authentication_failure.json +3 -0
  34. data/spec/fixtures/awesome_workflow.rb +2 -6
  35. data/spec/fixtures/git/git_config +7 -7
  36. data/spec/fixtures/issues/comment.json.erb +27 -27
  37. data/spec/fixtures/issues/comments.json +29 -29
  38. data/spec/fixtures/issues/comments.json.erb +15 -15
  39. data/spec/fixtures/pull_requests/comment.json.erb +45 -45
  40. data/spec/fixtures/pull_requests/comments.json +47 -47
  41. data/spec/fixtures/pull_requests/comments.json.erb +15 -15
  42. data/spec/fixtures/pull_requests/commits.json +29 -29
  43. data/spec/fixtures/pull_requests/external_pull_request.json +145 -145
  44. data/spec/fixtures/pull_requests/pull_request.json +142 -142
  45. data/spec/fixtures/pull_requests/pull_request.json.erb +142 -142
  46. data/spec/fixtures/pull_requests/pull_request_branch_nonexistent_error.json +32 -0
  47. data/spec/fixtures/pull_requests/pull_request_exists_error.json +32 -32
  48. data/spec/fixtures/pull_requests/pull_requests.json +136 -136
  49. data/spec/fixtures/repositories/commit.json +53 -53
  50. data/spec/fixtures/repositories/commit.json.erb +53 -53
  51. data/spec/fixtures/repositories/commits.json.erb +13 -13
  52. data/spec/fixtures/repositories/statuses.json +31 -31
  53. data/spec/fixtures/users/user.json +32 -0
  54. data/spec/lib/git_reflow/git_helpers_spec.rb +115 -12
  55. data/spec/lib/git_reflow/git_server/git_hub/pull_request_spec.rb +6 -6
  56. data/spec/lib/git_reflow/git_server/git_hub_spec.rb +77 -3
  57. data/spec/lib/git_reflow/git_server/pull_request_spec.rb +41 -7
  58. data/spec/lib/git_reflow/workflow_spec.rb +259 -14
  59. data/spec/lib/git_reflow/workflows/core_spec.rb +224 -65
  60. data/spec/lib/git_reflow/workflows/flat_merge_spec.rb +17 -6
  61. data/spec/lib/git_reflow_spec.rb +2 -25
  62. data/spec/spec_helper.rb +3 -0
  63. data/spec/support/github_helpers.rb +1 -1
  64. data/spec/support/mock_pull_request.rb +17 -17
  65. data/spec/support/web_mocks.rb +39 -39
  66. metadata +52 -53
  67. data/circle.yml +0 -26
  68. data/lib/git_reflow/commands/deliver.rb +0 -10
  69. data/lib/git_reflow/commands/refresh.rb +0 -20
  70. data/lib/git_reflow/commands/review.rb +0 -13
  71. data/lib/git_reflow/commands/setup.rb +0 -11
  72. data/lib/git_reflow/commands/stage.rb +0 -9
  73. data/lib/git_reflow/commands/start.rb +0 -18
  74. data/lib/git_reflow/commands/status.rb +0 -7
  75. data/lib/git_reflow/workflows/flat_merge.rb +0 -10
  76. data/spec/fixtures/workflow_with_super.rb +0 -8
data/circle.yml DELETED
@@ -1,26 +0,0 @@
1
- dependencies:
2
- cache_directories:
3
- - '~/.rvm/rubies'
4
- - 'vendor'
5
-
6
- override:
7
- - >
8
- case $CIRCLE_NODE_INDEX in
9
- 0)
10
- rvm-exec 2.3.7 gem install bundler
11
- rvm-exec 2.3.7 bash -c "bundle check --path=vendor/bundle_2.1 || bundle install --path=vendor/bundle_2.2"
12
- ;;
13
- 1)
14
- rvm-exec 2.4.4 gem install bundler
15
- rvm-exec 2.4.4 bash -c "bundle check --path=vendor/bundle_2.2 || bundle install --path=vendor/bundle_2.3"
16
- ;;
17
- 2)
18
- rvm-exec ruby-head gem install bundler
19
- rvm-exec ruby-head bash -c "bundle check --path=vendor/bundle_head || bundle install --path=vendor/bundle_head"
20
- ;;
21
- esac
22
-
23
- test:
24
- override:
25
- - case $CIRCLE_NODE_INDEX in 0) rvm-exec 2.3.7 bundle exec rake ;; 1) rvm-exec 2.4.4 bundle exec rake ;; 2) rvm-exec ruby-head bundle exec rake ;; esac:
26
- parallel: true
@@ -1,10 +0,0 @@
1
- desc 'deliver your feature branch'
2
- long_desc 'merge your feature branch down to your base branch, and cleanup your feature branch'
3
-
4
- command :deliver do |c|
5
- c.desc 'merge your feature branch down to your base branch, and cleanup your feature branch'
6
- c.switch [:f, :'skip-lgtm'], desc: 'skip the lgtm checks and deliver your feature branch'
7
- c.action do |global_options, options, args|
8
- GitReflow.deliver base: args[0], force: options[:'skip-lgtm']
9
- end
10
- end
@@ -1,20 +0,0 @@
1
- desc 'Updates and synchronizes your base branch and feature branch.'
2
- long_desc <<LONGTIME
3
- Performs the following:\n
4
- \t$ git checkout <base_branch>\n
5
- \t$ git pull <remote_location> <base_branch>\n
6
- \t$ git checkout <current_branch>\n
7
- \t$ git pull origin <current_branch>\n
8
- \t$ git merge <base_branch>\n
9
- LONGTIME
10
- arg_name '[remote_location] - remote repository name to fetch updates from (origin by default), [base_branch] - branch that you want to merge with (master by default)'
11
- command :refresh do |c|
12
- c.desc 'updates base_branch based on remote and merges the base with your feature_branch'
13
- c.flag [:r,:remote], default_value: 'origin'
14
- c.flag [:b,:base], default_value: 'master'
15
- c.action do |global_options, options, args|
16
-
17
- GitReflow.refresh base: options[:base], remote: options[:remote]
18
-
19
- end
20
- end
@@ -1,13 +0,0 @@
1
- desc 'review will push your latest feature branch changes to your remote repo and create a pull request'
2
- arg_name 'Describe arguments to review here'
3
- command :review do |c|
4
- c.desc 'push your latest feature branch changes to your remote repo and create a pull request against the destination branch'
5
- c.arg_name '[destination_branch] - the branch you want to merge your feature branch into'
6
- c.flag [:t, :title]
7
- c.flag [:m, :message]
8
- c.action do |global_options,options,args|
9
-
10
- GitReflow.review base: args[0], title: options[:title], body: options[:message]
11
-
12
- end
13
- end
@@ -1,11 +0,0 @@
1
- desc 'Setup your GitHub account'
2
- command :setup do |c|
3
- c.desc 'sets up your api token with GitHub'
4
- c.switch [:l, :local], default_value: false, desc: 'setup GitReflow for the current project only'
5
- c.switch [:e, :enterprise], default_value: false, desc: 'setup GitReflow with a Github Enterprise account'
6
- c.action do |global_options, options, args|
7
-
8
- GitReflow.setup local: options[:local], enterprise: options[:enterprise]
9
-
10
- end
11
- end
@@ -1,9 +0,0 @@
1
- desc 'Deliver your changes to a staging server'
2
- command :stage do |c|
3
- c.desc 'deliver your feature branch to the staging branch'
4
- c.action do |global_options, options, args|
5
-
6
- GitReflow.stage
7
-
8
- end
9
- end
@@ -1,18 +0,0 @@
1
-
2
- desc 'Start will create a new feature branch and setup remote tracking'
3
- long_desc <<LONGTIME
4
- Performs the following:\n
5
- \t$ git checkout <base_branch>\n
6
- \t$ git pull origin <base_branch>\n
7
- \t$ git push origin <base_branch>:refs/heads/[new_feature_branch]\n
8
- \t$ git checkout --track -b [new_feature_branch] origin/[new_feature_branch]\n
9
- LONGTIME
10
- arg_name '[new-feature-branch-name] - name of the new feature branch'
11
- command :start do |c|
12
- c.flag [:b,:base], default_value: 'master'
13
- c.action do |global_options, options, args|
14
-
15
- GitReflow.start feature_branch: args[0], base: options[:base]
16
-
17
- end
18
- end
@@ -1,7 +0,0 @@
1
- desc 'Display information about the status of your feature in the review process'
2
- arg_name "destination_branch - the branch you're merging your feature into ('master' is default)"
3
- command :status do |c|
4
- c.action do |global_options, options, args|
5
- GitReflow.status destination_branch: args[0]
6
- end
7
- end
@@ -1,10 +0,0 @@
1
- class FlatMerge < GitReflow::Workflows::Core
2
- def self.deliver(**params)
3
- base_branch = params[:base] || 'master'
4
- params[:squash] = false
5
-
6
- super(**params)
7
- end
8
- end
9
-
10
- FlatMerge
@@ -1,8 +0,0 @@
1
- class WorkflowWithSuper < GitReflow::Workflows::Core
2
- def self.start(**args)
3
- GitReflow.say "Super."
4
- super(feature_branch: args[:feature_branch], base: args[:base])
5
- end
6
- end
7
-
8
- WorkflowWithSuper