fastlane-plugin-wpmreleasetoolkit 10.0.0 → 11.0.0

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: ea0a11acbc1d86f38ebf67cbed2be77567daf102d562f98ffe5b24b586e76e2a
4
- data.tar.gz: bd63ae1a9b85d9752d82ecca475348ab7707561f5c9dfb65ed6e90d9cad3fa72
3
+ metadata.gz: 0fb1745e0b380d077569e207dccd17c49c0704b4c0cf432bf2f0433a6902b079
4
+ data.tar.gz: f31e085f66591e5f9541d6ef925610f7a7e11431de40f414716d19079f214e0f
5
5
  SHA512:
6
- metadata.gz: c1fc81d95398f1e9a19d436e8c967482ccafde915e7332ef1b0f4b662c2d7237c615120efb2f6d599b45c8ce9193c518010017e9a563735ef4e99ac73c88dff2
7
- data.tar.gz: 55a4e17018754d509abd46ab4aa9b9974c6e5dca146695f94bdacf9409112fe6dd3d49c05b0fc8ac632a348c3c817321c0de63490a8bd2ce1fc81147c529cc21
6
+ metadata.gz: e10dd60259b1605ae99ee51632c39cdc92f07bde6fb0b5020f6652b7f99c8f366b76ab857d87ff1aa9c188aca1f5af30eb07ff58d75c56bcfe7e88f4c6ba1aaf
7
+ data.tar.gz: 8d372187aa53abb0ef2d8652d4852c876b5d4a199687bbb19bfb46b031220ee07f80f028482272970411f94292e3e76d78ce38b91a280e513f55d1ecfbb549a3
@@ -35,8 +35,8 @@ module Fastlane
35
35
  unless params[:skip_confirm]
36
36
  confirm_message = "Building a new release branch starting from #{default_branch}.\nCurrent version is #{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
37
37
  confirm_message += current_alpha_version.nil? ? no_alpha_version_message : "Current Alpha version is #{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
38
- confirm_message += "After codefreeze the new version will be: #{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
39
- confirm_message += current_alpha_version.nil? ? '' : "After codefreeze the new Alpha will be: #{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
38
+ confirm_message += "After code freeze the new version will be: #{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
39
+ confirm_message += current_alpha_version.nil? ? '' : "After code freeze the new Alpha will be: #{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
40
40
  confirm_message += 'Do you want to continue?'
41
41
  UI.user_error!('Aborted by user request') unless UI.confirm(confirm_message)
42
42
  end
@@ -68,7 +68,7 @@ module Fastlane
68
68
  [
69
69
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
70
70
  env_name: 'FL_ANDROID_CODEFREEZE_PRECHECKS_SKIPCONFIRM',
71
- description: 'Skips confirmation before codefreeze',
71
+ description: 'Skips confirmation before code freeze',
72
72
  type: Boolean,
73
73
  default_value: false), # the default value if the user didn't provide one
74
74
  FastlaneCore::ConfigItem.new(key: :default_branch,
@@ -1,25 +1,50 @@
1
+ require 'yaml'
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class IosCheckBetaDepsAction < Action
6
+ ALL_PODS_STABLE_MESSAGE = 'All pods are pointing to a stable version. You can continue with the code freeze.'.freeze
7
+ NON_STABLE_PODS_MESSAGE = "Please create a new stable version of those pods and update the Podfile to the newly released version before continuing with the code freeze:\n".freeze
8
+
4
9
  def self.run(params)
5
10
  require_relative '../../helper/ios/ios_version_helper'
6
11
  require_relative '../../helper/ios/ios_git_helper'
7
12
 
8
- beta_pods = []
9
- File.open(params[:podfile]).each do |li|
10
- beta_pods << li if li.match('^\s*\t*pod.*beta')
13
+ yaml = YAML.load_file(params[:lockfile])
14
+ non_stable_pods = {} # Key will be pod name, value will be reason for flagging
15
+
16
+ # Find pods referenced by commit and branch to a repo. if any
17
+ yaml['EXTERNAL SOURCES']&.each do |pod, options|
18
+ non_stable_pods[pod] = 'commit' if params[:report_commits] && options.key?(:commit)
19
+ non_stable_pods[pod] = 'branch' if params[:report_branches] && options.key?(:branch)
20
+ end
21
+
22
+ # Find pods whose resolved version matches the regex
23
+ version_pattern = params[:report_version_pattern]
24
+ unless version_pattern.nil? || version_pattern.empty?
25
+ regex = begin
26
+ Regexp.new(version_pattern)
27
+ rescue RegexpError
28
+ UI.user_error!("Invalid regex pattern: `#{version_pattern}`")
29
+ end
30
+ resolved_pods = yaml['PODS'].flat_map { |entry| entry.is_a?(Hash) ? entry.keys : entry }
31
+ resolved_pods.each do |line|
32
+ (pod, version) = /(.*) \((.*)\)/.match(line)&.captures
33
+ non_stable_pods[pod] = regex.source if regex.match?(version)
34
+ end
11
35
  end
12
36
 
13
- if beta_pods.count.zero?
14
- UI.message('No beta pods found. You can continue with the code freeze.')
37
+ message = ''
38
+ if non_stable_pods.empty?
39
+ message << ALL_PODS_STABLE_MESSAGE
15
40
  else
16
- message = "The following pods are still in beta:\n"
17
- beta_pods.each do |bpod|
18
- message << "#{bpod}\n"
41
+ message << NON_STABLE_PODS_MESSAGE
42
+ non_stable_pods.sort.each do |pod, reason|
43
+ message << " - #{pod} (currently points to #{reason})\n"
19
44
  end
20
- message << 'Please update to the released version before continuing with the code freeze.'
21
45
  end
22
46
  UI.important(message)
47
+ { message: message, pods: non_stable_pods }
23
48
  end
24
49
 
25
50
  #####################################################
@@ -36,10 +61,33 @@ module Fastlane
36
61
 
37
62
  def self.available_options
38
63
  [
39
- FastlaneCore::ConfigItem.new(key: :podfile,
40
- env_name: 'FL_IOS_CHECKBETADEPS_PODFILE',
41
- description: 'Path to the Podfile to analyse',
42
- type: String),
64
+ FastlaneCore::ConfigItem.new(
65
+ key: :lockfile,
66
+ description: 'Path to the Podfile.lock to analyse',
67
+ default_value: 'Podfile.lock',
68
+ type: String,
69
+ verify_block: proc do |value|
70
+ UI.user_error!("File `#{value}` does not exist") unless File.exist?(value)
71
+ end
72
+ ),
73
+ FastlaneCore::ConfigItem.new(
74
+ key: :report_commits,
75
+ description: 'Whether to report pods referenced by commit',
76
+ default_value: true,
77
+ type: Boolean
78
+ ),
79
+ FastlaneCore::ConfigItem.new(
80
+ key: :report_branches,
81
+ description: 'Whether to report pods referenced by branch',
82
+ default_value: true,
83
+ type: Boolean
84
+ ),
85
+ FastlaneCore::ConfigItem.new(
86
+ key: :report_version_pattern,
87
+ description: 'Report any pod whose resolved version matches this Regex pattern. Set to empty string to ignore',
88
+ default_value: '-beta|-rc',
89
+ type: String
90
+ ),
43
91
  ]
44
92
  end
45
93
 
@@ -47,7 +95,11 @@ module Fastlane
47
95
  end
48
96
 
49
97
  def self.return_value
50
- ''
98
+ <<~RETURN_VALUE
99
+ A Hash with keys `message` and `pods`.
100
+ - The `message` can be used to e.g. post a Buildkite annotation.
101
+ - The `pods` is itself a `Hash` whose keys are the pod names and values are the reason for the violation
102
+ RETURN_VALUE
51
103
  end
52
104
 
53
105
  def self.authors
@@ -18,7 +18,7 @@ module Fastlane
18
18
  next_version = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(current_version)
19
19
 
20
20
  # Ask user confirmation
21
- unless params[:skip_confirm] || UI.confirm("Building a new release branch starting from #{default_branch}.\nCurrent version is #{current_version} (#{current_build_version}).\nAfter codefreeze the new version will be: #{next_version}.\nDo you want to continue?")
21
+ unless params[:skip_confirm] || UI.confirm("Building a new release branch starting from #{default_branch}.\nCurrent version is #{current_version} (#{current_build_version}).\nAfter code freeze the new version will be: #{next_version}.\nDo you want to continue?")
22
22
  UI.user_error!('Aborted by user request')
23
23
  end
24
24
 
@@ -46,7 +46,7 @@ module Fastlane
46
46
  [
47
47
  FastlaneCore::ConfigItem.new(key: :skip_confirm,
48
48
  env_name: 'FL_IOS_CODEFREEZE_PRECHECKS_SKIPCONFIRM',
49
- description: 'Skips confirmation before codefreeze',
49
+ description: 'Skips confirmation before code freeze',
50
50
  type: Boolean,
51
51
  default_value: false), # the default value if the user didn't provide one
52
52
  FastlaneCore::ConfigItem.new(key: :default_branch,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module Wpmreleasetoolkit
5
- VERSION = '10.0.0'
5
+ VERSION = '11.0.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-wpmreleasetoolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.0
4
+ version: 11.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Automattic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-28 00:00:00.000000000 Z
11
+ date: 2024-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport