eac_tools 0.80.0 → 0.81.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +25 -16
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/lib/avm/application_scms/base.rb +17 -6
- data/sub/avm/lib/avm/applications/base/auto_local_source_path.rb +24 -0
- data/sub/avm/lib/avm/applications/base/local_source.rb +1 -1
- data/sub/avm/lib/avm/applications/base/scm.rb +2 -2
- data/sub/avm/lib/avm/registry/application_scms.rb +2 -2
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm/spec/lib/avm/applications/base/entries_spec.rb +4 -2
- data/sub/avm/spec/lib/avm/applications/base/entries_spec_files/config.yml +1 -0
- data/sub/avm-eac_github_base0/Gemfile +2 -2
- data/sub/avm-eac_github_base0/avm-eac_github_base0.gemspec +3 -2
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/entity.rb +1 -1
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/application_scms/base.rb +30 -2
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/version.rb +1 -1
- data/sub/avm-eac_github_base0/spec/lib/avm/eac_github_base0/application_scms/base_spec.rb +40 -0
- data/sub/avm-eac_github_base0/spec/rubocop_spec.rb +1 -1
- data/sub/avm-eac_github_base0/spec/spec_helper.rb +1 -1
- data/sub/avm-eac_gitlab_base0/Gemfile +8 -0
- data/sub/avm-eac_gitlab_base0/avm-eac_gitlab_base0.gemspec +20 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api/base_entity.rb +72 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api/file.rb +33 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api/group.rb +49 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api/member.rb +25 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api/node.rb +20 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api/nodes_set.rb +118 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api/project.rb +65 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api/root.rb +30 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/api.rb +43 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/application_scms/base.rb +13 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/application_scms.rb +11 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/instances/base.rb +18 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0/version.rb +7 -0
- data/sub/avm-eac_gitlab_base0/lib/avm/eac_gitlab_base0.rb +9 -0
- data/sub/avm-eac_gitlab_base0/spec/lib/avm/eac_gitlab_base0/application_scms/base_spec.rb +7 -0
- data/sub/avm-eac_gitlab_base0/spec/rubocop_spec.rb +3 -0
- data/sub/avm-eac_gitlab_base0/spec/spec_helper.rb +4 -0
- data/sub/avm-git/Gemfile +2 -2
- data/sub/avm-git/avm-git.gemspec +3 -4
- data/sub/avm-git/lib/avm/git/application_scms/base/assert_main_at.rb +49 -0
- data/sub/avm-git/lib/avm/git/application_scms/base.rb +21 -0
- data/sub/avm-git/lib/avm/git/application_scms.rb +11 -0
- data/sub/avm-git/lib/avm/git/issue/complete/commits.rb +2 -2
- data/sub/avm-git/lib/avm/git/issue/complete/push.rb +2 -2
- data/sub/avm-git/lib/avm/git/issue.rb +1 -1
- data/sub/avm-git/lib/avm/git/launcher/base/dirty_files.rb +4 -4
- data/sub/avm-git/lib/avm/git/launcher/base/subrepo.rb +1 -1
- data/sub/avm-git/lib/avm/git/launcher/base.rb +1 -0
- data/sub/avm-git/lib/avm/git/launcher/publish_base.rb +1 -2
- data/sub/avm-git/lib/avm/git/launcher/remote.rb +2 -2
- data/sub/avm-git/lib/avm/git/launcher/warp_base.rb +3 -2
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/warp.rb +2 -2
- data/sub/avm-git/lib/avm/git/organize/repository.rb +1 -1
- data/sub/avm-git/lib/avm/git/revision_test.rb +2 -2
- data/sub/avm-git/lib/avm/git/scms/git/change_tracker.rb +1 -0
- data/sub/avm-git/lib/avm/git/scms/git/commit.rb +1 -1
- data/sub/avm-git/lib/avm/git/scms/git/interval.rb +1 -1
- data/sub/avm-git/lib/avm/git/scms/git_subtree.rb +1 -1
- data/sub/avm-git/lib/avm/git/subrepo_check/show_result.rb +1 -1
- data/sub/avm-git/lib/avm/git/subrepo_checks.rb +1 -0
- data/sub/avm-git/lib/avm/git/version.rb +1 -1
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec.rb +2 -2
- data/sub/avm-git/spec/lib/avm/git/commit_spec.rb +4 -4
- data/sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb +10 -10
- data/sub/avm-git/spec/lib/avm/git/scms/git/commit/deploy_spec.rb +11 -11
- data/sub/avm-git/spec/lib/avm/git/scms/git_spec.rb +1 -1
- data/sub/avm-git/spec/lib/avm/git/scms/git_subrepo_spec.rb +1 -1
- data/sub/avm-git/spec/lib/avm/git/vendor/github_spec.rb +3 -3
- data/sub/avm-git/spec/rubocop_spec.rb +1 -1
- data/sub/avm-git/spec/spec_helper.rb +1 -1
- data/sub/avm-tools/avm-tools.gemspec +3 -3
- data/sub/avm-tools/lib/avm/tools/runner/application/info.rb +2 -1
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- metadata +34 -17
- data/sub/avm-eac_github_base0/spec/avm/eac_github_base0/application_scms/base_spec.rb +0 -7
@@ -0,0 +1,118 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_gitlab_base0/api/base_entity'
|
4
|
+
require 'avm/eac_gitlab_base0/api/project'
|
5
|
+
require 'eac_rest/api'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module EacGitlabBase0
|
10
|
+
class Api < ::EacRest::Api
|
11
|
+
class NodesSet
|
12
|
+
IDS_PREFIXES = {
|
13
|
+
'@@' => :group_and_projects, '@-' => :group_projects, '@' => :group
|
14
|
+
}.freeze
|
15
|
+
|
16
|
+
GROUP_AND_PROJECTS_ID_PARSER = /\A@@(.*)\z/.to_parser { |m| m[1] }
|
17
|
+
GROUP_ID_PARSER = /\A@(.*)\z/.to_parser { |m| m[1] }
|
18
|
+
|
19
|
+
class << self
|
20
|
+
def parse_id(id)
|
21
|
+
IDS_PREFIXES.each do |prefix, type|
|
22
|
+
/\A#{::Regexp.quote(prefix)}(.*)\z/.if_match(id, false) do |m|
|
23
|
+
return [m[1], type]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
[id, :project]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
attr_reader :rest_api
|
32
|
+
attr_writer :no_groups
|
33
|
+
|
34
|
+
def initialize(rest_api, *ids)
|
35
|
+
self.rest_api = rest_api
|
36
|
+
ids.each { |id| add(id) }
|
37
|
+
end
|
38
|
+
|
39
|
+
def add(id)
|
40
|
+
parsed_id, type = self.class.parse_id(id)
|
41
|
+
|
42
|
+
send("add_by_#{type}_id", parsed_id)
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [Array<Avm::EacGitlabBase0::Api::Group>]
|
46
|
+
def group
|
47
|
+
nodes.select { |node| node.is_a?(::Avm::EacGitlabBase0::Api::Group) }
|
48
|
+
end
|
49
|
+
|
50
|
+
# @return [Array<Avm::EacGitlabBase0::Api::Project>]
|
51
|
+
def projects
|
52
|
+
nodes.select { |node| node.is_a?(::Avm::EacGitlabBase0::Api::Project) }
|
53
|
+
end
|
54
|
+
|
55
|
+
# @return [Array<Avm::EacGitlabBase0::Api::Node>]
|
56
|
+
def nodes
|
57
|
+
r = nodes_set
|
58
|
+
r = r.reject { |g| g.is_a?(::Avm::EacGitlabBase0::Api::Group) } if no_groups?
|
59
|
+
r.sort_by { |p| [p.full_path] }
|
60
|
+
end
|
61
|
+
|
62
|
+
def no_groups?
|
63
|
+
@no_groups ? true : false
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
attr_writer :rest_api
|
69
|
+
|
70
|
+
# @return [Set<Avm::EacGitlabBase0::Api::Project>]
|
71
|
+
def nodes_set
|
72
|
+
@nodes_set ||= ::Set.new
|
73
|
+
end
|
74
|
+
|
75
|
+
# @return [Avm::EacGitlabBase0::Api::Node]
|
76
|
+
def add_node(node)
|
77
|
+
nodes_set.add(node)
|
78
|
+
|
79
|
+
node
|
80
|
+
end
|
81
|
+
|
82
|
+
# @return [Array<Avm::EacGitlabBase0::Api::Group>]
|
83
|
+
def add_by_group_id(id)
|
84
|
+
group = rest_api.root.group(id)
|
85
|
+
|
86
|
+
raise "No group found with ID = \"#{id}\"" unless group
|
87
|
+
|
88
|
+
[add_node(group)]
|
89
|
+
end
|
90
|
+
|
91
|
+
# @return [Array<Avm::EacGitlabBase0::Api::Project>]
|
92
|
+
def add_by_group_projects_id(id)
|
93
|
+
group = rest_api.root.group(id)
|
94
|
+
|
95
|
+
raise "No group found with ID = \"#{id}\"" unless group
|
96
|
+
|
97
|
+
group.projects.map do |project|
|
98
|
+
add_node(project)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# @return [Array<Avm::EacGitlabBase0::Api::Node>]
|
103
|
+
def add_by_group_and_projects_id(id)
|
104
|
+
add_by_group_id(id) + add_by_group_projects_id(id)
|
105
|
+
end
|
106
|
+
|
107
|
+
# @return [Array<Avm::EacGitlabBase0::Api::Project>]
|
108
|
+
def add_by_project_id(id)
|
109
|
+
project = rest_api.root.project(id)
|
110
|
+
|
111
|
+
raise "No project found with ID = \"#{id}\"" unless project
|
112
|
+
|
113
|
+
[add_node(project)]
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_gitlab_base0/api/file'
|
4
|
+
require 'avm/eac_gitlab_base0/api/member'
|
5
|
+
require 'avm/eac_gitlab_base0/api/node'
|
6
|
+
require 'eac_rest/api'
|
7
|
+
require 'eac_ruby_utils/core_ext'
|
8
|
+
|
9
|
+
module Avm
|
10
|
+
module EacGitlabBase0
|
11
|
+
class Api < ::EacRest::Api
|
12
|
+
class Project < ::Avm::EacGitlabBase0::Api::Node
|
13
|
+
FIELDS = %w[id description name name_with_namespace path path_with_namespace created_at
|
14
|
+
default_branch tag_list ssh_url_to_repo http_url_to_repo web_url readme_url
|
15
|
+
avatar_url star_count forks_count last_activity_at empty_repo archived
|
16
|
+
visibility resolve_outdated_diff_discussions container_registry_enabled
|
17
|
+
issues_enabled merge_requests_enabled wiki_enabled jobs_enabled snippets_enabled
|
18
|
+
issues_access_level repository_access_level merge_requests_access_level
|
19
|
+
wiki_access_level builds_access_level snippets_access_level
|
20
|
+
shared_runners_enabled lfs_enabled creator_id import_status
|
21
|
+
ci_default_git_depth public_jobs build_timeout auto_cancel_pending_pipelines
|
22
|
+
build_coverage_regex ci_config_path shared_with_groups
|
23
|
+
only_allow_merge_if_pipeline_succeeds request_access_enabled
|
24
|
+
only_allow_merge_if_all_discussions_are_resolved
|
25
|
+
remove_source_branch_after_merge printing_merge_request_link_enabled
|
26
|
+
merge_method auto_devops_enabled auto_devops_deploy_strategy].freeze
|
27
|
+
|
28
|
+
FIELDS.each do |field|
|
29
|
+
define_method field do
|
30
|
+
data.fetch(field)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def api_prefix
|
35
|
+
"/projects/#{encode_id(id)}"
|
36
|
+
end
|
37
|
+
|
38
|
+
def full_path
|
39
|
+
path_with_namespace
|
40
|
+
end
|
41
|
+
|
42
|
+
def file(path)
|
43
|
+
fetch_entity(
|
44
|
+
"#{api_prefix}/repository/files/#{encode_id(path)}?ref=#{default_branch}",
|
45
|
+
::Avm::EacGitlabBase0::Api::File,
|
46
|
+
'404 File Not Found'
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
def to_s
|
51
|
+
path_with_namespace
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def members_uncached
|
57
|
+
fetch_entities(
|
58
|
+
"#{api_prefix}/members",
|
59
|
+
::Avm::EacGitlabBase0::Api::Member
|
60
|
+
)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_gitlab_base0/api/base_entity'
|
4
|
+
require 'avm/eac_gitlab_base0/api/project'
|
5
|
+
require 'eac_rest/api'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module EacGitlabBase0
|
10
|
+
class Api < ::EacRest::Api
|
11
|
+
class Root < ::Avm::EacGitlabBase0::Api::BaseEntity
|
12
|
+
def group(id)
|
13
|
+
fetch_entity(
|
14
|
+
"/groups/#{encode_id(id)}?with_projects=false",
|
15
|
+
::Avm::EacGitlabBase0::Api::Group,
|
16
|
+
'404 Group Not Found'
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
def project(id)
|
21
|
+
fetch_entity(
|
22
|
+
"/projects/#{encode_id(id)}",
|
23
|
+
::Avm::EacGitlabBase0::Api::Project,
|
24
|
+
'404 Project Not Found'
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_rest/api'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacGitlabBase0
|
8
|
+
class Api < ::EacRest::Api
|
9
|
+
require_sub __FILE__
|
10
|
+
|
11
|
+
API_SUFFIX = '/api/v4'
|
12
|
+
|
13
|
+
def auth_token
|
14
|
+
ENV.fetch('TRF1_GITLAB_PRIVATE_TOKEN')
|
15
|
+
end
|
16
|
+
|
17
|
+
def build_service_url_suffix(suffix)
|
18
|
+
r = super(suffix)
|
19
|
+
r.path = API_SUFFIX + r.path
|
20
|
+
r
|
21
|
+
end
|
22
|
+
|
23
|
+
def custom_headers
|
24
|
+
{
|
25
|
+
'PRIVATE-TOKEN' => auth_token
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# @return [Avm::EacGitlabBase0::Api::ProjectsSet]
|
30
|
+
def nodes_set(*projects_ids)
|
31
|
+
::Avm::EacGitlabBase0::Api::NodesSet.new(self, *projects_ids)
|
32
|
+
end
|
33
|
+
|
34
|
+
def request(service_url_suffix, headers = {}, &body_data_proc)
|
35
|
+
super(service_url_suffix, custom_headers.merge(headers), &body_data_proc)
|
36
|
+
end
|
37
|
+
|
38
|
+
def root
|
39
|
+
@root ||= ::Avm::EacGitlabBase0::Api::Root.new(self, {})
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_github_base0/application_scms/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacGitlabBase0
|
8
|
+
module ApplicationScms
|
9
|
+
class Base < ::Avm::EacGithubBase0::ApplicationScms::Base
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/base'
|
4
|
+
require 'avm/eac_gitlab_base0/api'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacGitlabBase0
|
9
|
+
module Instances
|
10
|
+
class Base < ::Avm::Instances::Base
|
11
|
+
# @return [Avm::EacGitlabBase0::Api]
|
12
|
+
def rest_api
|
13
|
+
@rest_api ||= ::Avm::EacGitlabBase0::Api.new(web_url)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/sub/avm-git/Gemfile
CHANGED
@@ -4,5 +4,5 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
local_gemfile =
|
8
|
-
eval_gemfile local_gemfile if
|
7
|
+
local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local')
|
8
|
+
eval_gemfile local_gemfile if File.exist?(local_gemfile)
|
data/sub/avm-git/avm-git.gemspec
CHANGED
@@ -13,12 +13,11 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.files = Dir['{lib,locale}/**/*']
|
14
14
|
s.required_ruby_version = '>= 2.7'
|
15
15
|
|
16
|
-
s.add_dependency 'avm', '~> 0.
|
16
|
+
s.add_dependency 'avm', '~> 0.82'
|
17
17
|
s.add_dependency 'avm-files', '~> 0.6', '>= 0.6.2'
|
18
18
|
s.add_dependency 'eac_git', '~> 0.14', '>= 0.14.1'
|
19
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.119', '>= 0.119.
|
19
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.119', '>= 0.119.2'
|
20
20
|
s.add_dependency 'git', '~> 1.18'
|
21
21
|
|
22
|
-
s.add_development_dependency '
|
23
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.7.0'
|
22
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.9'
|
24
23
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/application_scms/base'
|
4
|
+
require 'eac_git/local'
|
5
|
+
require 'eac_git/remote'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module Git
|
10
|
+
module ApplicationScms
|
11
|
+
class Base < ::Avm::ApplicationScms::Base
|
12
|
+
class AssertMainAt
|
13
|
+
MAIN_REFERENCE = 'HEAD'
|
14
|
+
|
15
|
+
acts_as_instance_method
|
16
|
+
enable_simple_cache
|
17
|
+
common_constructor :base, :path
|
18
|
+
|
19
|
+
# @return [Pathname]
|
20
|
+
def result
|
21
|
+
local_repos.remote(base.git_https_url).fetch
|
22
|
+
local_repos.command('checkout', remote_head_commit_id).execute!
|
23
|
+
path
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
# @return [String]
|
29
|
+
def remote_head_commit_id
|
30
|
+
remote_repos.ls.fetch(MAIN_REFERENCE)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @return [EacGit::Local]
|
34
|
+
def local_repos_uncached
|
35
|
+
path.mkpath
|
36
|
+
r = ::EacGit::Local.new(path)
|
37
|
+
r.command('init').execute! unless r.root_path.join('.git').exist?
|
38
|
+
r
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [EacGit::Remote]
|
42
|
+
def remote_repos_uncached
|
43
|
+
::EacGit::Remote.new(base.git_https_url)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/application_scms/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Git
|
8
|
+
module ApplicationScms
|
9
|
+
class Base < ::Avm::ApplicationScms::Base
|
10
|
+
acts_as_abstract
|
11
|
+
|
12
|
+
# @return [Addressable::URI]
|
13
|
+
def git_https_url
|
14
|
+
raise_abstract_method __method__
|
15
|
+
end
|
16
|
+
|
17
|
+
require_sub __FILE__, require_mode: :kernel
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -32,8 +32,8 @@ module Avm
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def commit_parents(commit)
|
35
|
-
launcher_git.execute!('log', '--pretty=%P', '-n', '1', commit).split
|
36
|
-
|
35
|
+
launcher_git.execute!('log', '--pretty=%P', '-n', '1', commit).split.map(&:strip)
|
36
|
+
.select(&:present?)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -25,11 +25,11 @@ module Avm
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def pushs_uncached
|
28
|
-
[master_push, remove_branch_push, tag_push].
|
28
|
+
[master_push, remove_branch_push, tag_push].compact
|
29
29
|
end
|
30
30
|
|
31
31
|
def master_push
|
32
|
-
remote_master_hash
|
32
|
+
remote_master_hash == branch_hash ? nil : "#{branch_hash}:refs/heads/master"
|
33
33
|
end
|
34
34
|
|
35
35
|
def remove_branch_push
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
4
|
|
5
5
|
module Avm
|
6
6
|
module Git
|
@@ -9,11 +9,11 @@ module Avm
|
|
9
9
|
module DirtyFiles
|
10
10
|
delegate :dirty?, to: :eac_git
|
11
11
|
|
12
|
+
# @return [Array<Struct>]
|
12
13
|
def dirty_files
|
13
14
|
eac_git.dirty_files.map do |df|
|
14
|
-
|
15
|
-
|
16
|
-
)
|
15
|
+
df.to_h.merge(path: df.path.to_path, absolute_path: df.absolute_path.to_path)
|
16
|
+
.to_struct
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -30,7 +30,7 @@ module Avm
|
|
30
30
|
def subrepo_status_parse_output(output)
|
31
31
|
r = {}.with_indifferent_access
|
32
32
|
output.each_line do |l|
|
33
|
-
m = /\A([^\:]+)
|
33
|
+
m = /\A([^\:]+):(.*)\z/.match(l.strip)
|
34
34
|
next unless m && m[2].present?
|
35
35
|
|
36
36
|
r[m[1].strip] = m[2].strip
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/simple_cache'
|
4
3
|
require 'eac_ruby_utils/simple_cache'
|
5
4
|
require 'avm/launcher/publish/base'
|
6
5
|
require 'avm/launcher/publish/check_result'
|
@@ -111,7 +110,7 @@ module Avm
|
|
111
110
|
def remote_sha_uncached
|
112
111
|
remote_fetch
|
113
112
|
b = sgit.git.branches["#{remote_name}/#{remote_ref}"]
|
114
|
-
b
|
113
|
+
b&.gcommit&.sha
|
115
114
|
end
|
116
115
|
|
117
116
|
def remote_fetch_uncached
|
@@ -13,10 +13,10 @@ module Avm
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def ls
|
16
|
-
git.execute!(['ls-remote', name]).each_line.
|
16
|
+
git.execute!(['ls-remote', name]).each_line.to_h do |line|
|
17
17
|
x = line.strip.split(/\s+/)
|
18
18
|
[x[1], x[0]]
|
19
|
-
end
|
19
|
+
end
|
20
20
|
end
|
21
21
|
|
22
22
|
# +git remote add ...+
|
@@ -33,8 +33,9 @@ module Avm
|
|
33
33
|
return
|
34
34
|
end
|
35
35
|
|
36
|
-
raise ::Avm::Launcher::Instances::Error,
|
37
|
-
|
36
|
+
raise ::Avm::Launcher::Instances::Error,
|
37
|
+
"Refspec \"#{source_instance.options.git_current_revision}\" " \
|
38
|
+
"not found in \"#{source_git}\""
|
38
39
|
end
|
39
40
|
|
40
41
|
def update
|
@@ -33,8 +33,8 @@ module Avm
|
|
33
33
|
parent_git_warped.descendant?('HEAD', subrepo_parent_hash)
|
34
34
|
|
35
35
|
raise Avm::Launcher::Errors::Base,
|
36
|
-
"Subrepo parent hash \"#{subrepo_parent_hash}\"" \
|
37
|
-
"
|
36
|
+
"Subrepo parent hash \"#{subrepo_parent_hash}\" " \
|
37
|
+
"not found in \"#{parent_git_warped}\""
|
38
38
|
end
|
39
39
|
|
40
40
|
def subrepo_parent_hash
|
@@ -57,8 +57,8 @@ module Avm
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def run_test
|
60
|
-
infom "Running test command \"#{::Shellwords.join(test_command_args)}\"" \
|
61
|
-
|
60
|
+
infom "Running test command \"#{::Shellwords.join(test_command_args)}\" " \
|
61
|
+
"on \"#{git_absolute_path}\"..."
|
62
62
|
result = ::EacRubyUtils::Ruby.on_clean_environment { test_command.execute }
|
63
63
|
infom 'Test done'
|
64
64
|
write_result_cache(result)
|
@@ -17,7 +17,7 @@ module Avm
|
|
17
17
|
# @return [Array<Avm::Git::Scms::Git::Commit>]
|
18
18
|
def commits
|
19
19
|
scm.git_repo.command('log', '--pretty=format:%H', git_commit_interval).execute!
|
20
|
-
|
20
|
+
.each_line.map { |sha1| scm.commit(sha1.strip) }
|
21
21
|
end
|
22
22
|
|
23
23
|
# @return [String]
|
@@ -15,7 +15,7 @@ module Avm
|
|
15
15
|
|
16
16
|
def valid?
|
17
17
|
return false unless ::Avm::Git::Scms::Provider
|
18
|
-
|
18
|
+
.new.all.any? { |scm_class| parent_scm.is_a?(scm_class) }
|
19
19
|
|
20
20
|
(::Avm::Git::Scms::Provider.new.all - [self.class])
|
21
21
|
.lazy.map { |scm_class| scm_class.new(path) }.none?(&:valid?)
|