Class: Fastlane::Actions::CheckUnfinishedReleasesAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/apadmi_grout/actions/check_unfinished_releases_action.rb

Overview

Check if there are releases that haven’t been merged into this release

Class Method Summary collapse

Class Method Details

.authorsObject



43
44
45
# File 'lib/fastlane/plugin/apadmi_grout/actions/check_unfinished_releases_action.rb', line 43

def self.authors
  ["[email protected]"]
end

.available_optionsObject



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/fastlane/plugin/apadmi_grout/actions/check_unfinished_releases_action.rb', line 47

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :version,
                                 description: "The version of this release e.g 1.0.0",
                                 type: String,
                                 verify_block: proc do |value|
                                   UI.user_error!("Didn't pass a valid release version") unless value
                                 end,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :suppressed_error_versions,
                                 description: "Old versions that shouldn't throw an error (comma separated)",
                                 env_name: "SUPPRESS_ERROR_VERSIONS",
                                 default_value: "",
                                 type: String,
                                 optional: true)
  ]
end

.descriptionObject



39
40
41
# File 'lib/fastlane/plugin/apadmi_grout/actions/check_unfinished_releases_action.rb', line 39

def self.description
  "Checks for any older version releases that aren't merged into this release"
end

.is_supported?(_platform) ⇒ Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/fastlane/plugin/apadmi_grout/actions/check_unfinished_releases_action.rb', line 65

def self.is_supported?(_platform)
  true
end

.run(params) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fastlane/plugin/apadmi_grout/actions/check_unfinished_releases_action.rb', line 12

def self.run(params)
  logger = FastLane::FastlaneLogger.new

  action = Apadmi::Grout::CheckUnfinishedReleasesAction.new(Apadmi::Grout::GitUtils, logger)

  unmerged = action.run(
    params[:version],
    params[:suppressed_error_versions].split(",")
  )

  if unmerged.any?
    logger.error(%(
======================================================================================
STOP!
You have old versions that aren't merged into your current release.
Check that all your old releases are correctly closed.
You may be about to release a version without all the features and bugfixes you expect.

The releases in question are #{unmerged.map(&:to_s)}.
======================================================================================
))
    throw "Unmerged old versions detected, see logs for details"
  end

  logger.success("No unmerged releases found, we're good!")
end