captive-release 0.13.0 → 0.13.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f164e66eb747a40700e3fb75708097cc3284dbaf52cd40719bcf72689d6c11df
4
- data.tar.gz: 464925ca718160f9968ee03d1e4611c7a5ccc3fa5f3b076a7f29de96507696fd
3
+ metadata.gz: 423b36a49572d388825d68a5128239d40977d95642dbb88e9e430c12a2c828e1
4
+ data.tar.gz: 743a871e6213ac1c663ecc75bfeff8cecfeba16925bf95fa3b743d6186c0826c
5
5
  SHA512:
6
- metadata.gz: 7ebed4eca5ded03e043ec51adc60da07141435c8aa368ae2caea3185605b9a5f86becb1e3bf1ccec66a6df42505da10d20f89d029a85217d60526b41fbc543cd
7
- data.tar.gz: 788821f98efa0e1a3afbcf97a8307370fda1b6131c8769250bd5a157b8b929bb4cec13d3b6b3c19a8820209ff719ffcd0a080befb0820df0d0ac22b47c95aae2
6
+ metadata.gz: ab946e3effe06248e0633c40936cc572a9cf2b875e61b4dda50f26d915698cc8f5bceab19a5b1f39f7649d024a3b3dd46080a4046a7f12185a54d8e77f5474de
7
+ data.tar.gz: 5ce64635bc166ef4aacdb3cc468e07fda810941a8a0c73a3b085f466529aaf579e15240baf8e2e7ad37a18edd0a2a096a50183143c55d3784d127ebba7fcef6e
@@ -20,25 +20,7 @@ module CaptiveRelease
20
20
  @terminal.done "git tag v#{version}"
21
21
  return @terminal.done("git push + tag") if GitCommands.push(version)
22
22
 
23
- pull_request(version)
24
- end
25
-
26
- private
27
-
28
- # Le tag est déjà poussé et reste sur le commit de version : la release GitHub peut
29
- # suivre, et un merge commit le ramène sur la branche de base.
30
- def pull_request(version)
31
- @terminal.say " #{@terminal.warn(Messages.t(:push_refused))}"
32
- base = GitCommands.current_branch
33
- branche = "release/v#{version}"
34
- GitCommands.push_branch(branche)
35
- @terminal.done "git push origin #{branche}"
36
-
37
- jeton = @token_provider.call
38
- raise Messages.t(:pull_request_needs_token, branch: branche) unless jeton
39
-
40
- @terminal.done ReleasePullRequest.create(version: version, base: base, head: branche,
41
- remote_url: GitCommands.remote_url, token: jeton)
23
+ ProtectedBranchRelease.new(terminal: @terminal, token_provider: @token_provider).call(version)
42
24
  end
43
25
  end
44
26
  end
@@ -89,8 +89,8 @@ fr:
89
89
  bump_patch: Patch
90
90
  bump_minor: Minor
91
91
  bump_major: Major
92
- bump_pre: Itérer
93
- nothing_to_iterate: 'Pas de pré-release à itérer : saisissez x.y.z-alpha.1'
92
+ bump_pre: Incrémenter
93
+ nothing_to_iterate: 'Pas de pré-release à incrémenter : saisissez x.y.z-alpha.1'
94
94
  bump_promote: Promouvoir
95
95
  bump_from_prerelease: 'Impossible de faire un %{type} depuis une pré-release : promouvez-la ou saisissez une version.'
96
96
  prerelease_on_app: "Pré-release %{version} impossible : %{path} porte une version d'app, qui n'admet pas de suffixe."
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CaptiveRelease
4
+ # Relancer les Gemfile.lock que le bump a périmés, et le dire au fur et à mesure. Rend les
5
+ # locks relancés, qui partent dans le commit de version.
6
+ #
7
+ # Cette unité change quand la façon d'annoncer la relance change, GemfileLockRefresh quand
8
+ # la détection ou la relance changent, ReleaseCommand quand la suite des étapes change.
9
+ class LockfilesRefreshing
10
+ def initialize(terminal:, refresh: GemfileLockRefresh.new)
11
+ @terminal = terminal
12
+ @refresh = refresh
13
+ end
14
+
15
+ def call
16
+ locks = @refresh.lockfiles
17
+ return locks if locks.empty?
18
+
19
+ @terminal.say "\n#{@terminal.bold(Messages.t(:refreshing_lockfile))}"
20
+ @refresh.call(locks)
21
+ locks.each { |lock| @terminal.done lock }
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CaptiveRelease
4
+ # Le repli quand une branche protégée refuse le push direct : pousser une branche de
5
+ # release et ouvrir la PR qui la ramène sur la branche de base. Le tag est déjà poussé et
6
+ # reste sur le commit de version : la release GitHub peut suivre, et un merge commit le
7
+ # ramène sur la branche de base.
8
+ #
9
+ # Cette unité change quand la politique de repli change, GitRelease quand la séquence
10
+ # git nominale change.
11
+ class ProtectedBranchRelease
12
+ def initialize(terminal:, token_provider:)
13
+ @terminal = terminal
14
+ @token_provider = token_provider
15
+ end
16
+
17
+ def call(version)
18
+ @terminal.say " #{@terminal.warn(Messages.t(:push_refused))}"
19
+ base = GitCommands.current_branch
20
+ branche = "release/v#{version}"
21
+ GitCommands.push_branch(branche)
22
+ @terminal.done "git push origin #{branche}"
23
+
24
+ jeton = @token_provider.call
25
+ raise Messages.t(:pull_request_needs_token, branch: branche) unless jeton
26
+
27
+ @terminal.done ReleasePullRequest.create(version: version, base: base, head: branche,
28
+ remote_url: GitCommands.remote_url, token: jeton)
29
+ end
30
+ end
31
+ end
@@ -30,16 +30,7 @@ module CaptiveRelease
30
30
  private
31
31
 
32
32
  def chemins_a_commiter
33
- chemins = @config.version_files.map(&:path)
34
- refresh = GemfileLockRefresh.new
35
- locks = refresh.lockfiles
36
- return chemins if locks.empty?
37
-
38
- @terminal.say "\n#{@terminal.bold(Messages.t(:refreshing_lockfile))}"
39
- refresh.call(locks)
40
- locks.each { |lock| @terminal.done lock }
41
-
42
- chemins + locks
33
+ @config.version_files.map(&:path) + LockfilesRefreshing.new(terminal: @terminal).call
43
34
  end
44
35
 
45
36
  def publication
@@ -29,7 +29,7 @@ module CaptiveRelease
29
29
  derniere = @thread&.join(ATTENTE)&.value
30
30
  return unless derniere && Gem::Version.new(derniere) > Gem::Version.new(courante)
31
31
 
32
- @output.puts "\e[31m#{Messages.t(:update_available, current: courante, latest: derniere)}\e[0m"
32
+ @output.puts "\e[33m#{Messages.t(:update_available, current: courante, latest: derniere)}\e[0m"
33
33
  end
34
34
 
35
35
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CaptiveRelease
4
- VERSION = "0.13.0"
4
+ VERSION = "0.13.2"
5
5
  end
@@ -43,7 +43,9 @@ require_relative "captive_release/menu"
43
43
  require_relative "captive_release/version_choice"
44
44
  require_relative "captive_release/gemfile_lock_refresh"
45
45
  require_relative "captive_release/exclusion_input"
46
+ require_relative "captive_release/lockfiles_refreshing"
46
47
  require_relative "captive_release/release_pull_request"
48
+ require_relative "captive_release/protected_branch_release"
47
49
  require_relative "captive_release/git_release"
48
50
  require_relative "captive_release/changes_since"
49
51
  require_relative "captive_release/release_publication"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: captive-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Captive Studio
@@ -52,11 +52,13 @@ files:
52
52
  - lib/captive_release/locale.rb
53
53
  - lib/captive_release/locales/en.yml
54
54
  - lib/captive_release/locales/fr.yml
55
+ - lib/captive_release/lockfiles_refreshing.rb
55
56
  - lib/captive_release/menu.rb
56
57
  - lib/captive_release/messages.rb
57
58
  - lib/captive_release/options.rb
58
59
  - lib/captive_release/prerelease_guard.rb
59
60
  - lib/captive_release/prerelease_iteration.rb
61
+ - lib/captive_release/protected_branch_release.rb
60
62
  - lib/captive_release/release_command.rb
61
63
  - lib/captive_release/release_confirmation.rb
62
64
  - lib/captive_release/release_notes.rb