r10k 2.4.1 → 2.4.3
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 +4 -4
- data/CHANGELOG.mkd +37 -0
- data/lib/r10k/action/puppetfile/install.rb +1 -1
- data/lib/r10k/git/stateful_repository.rb +16 -12
- data/lib/r10k/module/base.rb +1 -1
- data/lib/r10k/module/forge.rb +1 -1
- data/lib/r10k/module/git.rb +3 -2
- data/lib/r10k/module/local.rb +1 -1
- data/lib/r10k/module/svn.rb +1 -1
- data/lib/r10k/version.rb +1 -1
- data/spec/integration/git/stateful_repository_spec.rb +33 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 487d95e761e476a0701e43c1a36a146b977a5ed5
|
4
|
+
data.tar.gz: a05e79eadd63370717d5c766b94868a732117889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4ae1bfa5022c9660acecf7953114c1d76e148283cc5d1a1048930a1c56be7b8492b9a07c16ac66ee8a056d69b4b1cdce9272e4485070ba738f16d59acb29ef7
|
7
|
+
data.tar.gz: 4e522d29f6cd877388748c871144763b258cee2afffe0ac2221c2cbbfdf3f1cb0f7bf415466a0b2725e8519787ef3abdc4e50f81906ab46ded0cd65853444807
|
data/CHANGELOG.mkd
CHANGED
@@ -1,6 +1,38 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
+
2.4.3
|
5
|
+
-----
|
6
|
+
|
7
|
+
2016/08/23
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
(RK-266) Fixed an issue where the "puppetfile install" action was encountering an
|
12
|
+
error when operating on a Puppetfile with "local" content declarations.
|
13
|
+
|
14
|
+
2.4.2 (Yanked)
|
15
|
+
--------------
|
16
|
+
|
17
|
+
2016/08/22
|
18
|
+
|
19
|
+
### Bug Fixes
|
20
|
+
|
21
|
+
(RK-265) The "puppetfile install" action will no longer overwrite local
|
22
|
+
modifications to managed Git content. Instead, a message will be logged at the
|
23
|
+
"WARN" level indicating that the content was skipped. Note: The "deploy"
|
24
|
+
actions will still overwrite local modications. For more background on this
|
25
|
+
change, see below:
|
26
|
+
|
27
|
+
In 2.4.0 a change was made to r10k's behavior when it encounters local
|
28
|
+
modifications during "deploy" operations. Previously, r10k would log an error
|
29
|
+
and skip updating the modified content. As of 2.4.0, local modifications will
|
30
|
+
be overwritten and a warning will be logged. This change was considered a bug
|
31
|
+
fix but was originally omitted from the changelog for that release. This change
|
32
|
+
also inadvertently modified the behavior of the "puppetfile install" action. A
|
33
|
+
command line flag to control this behavior more explicitly will likely be added
|
34
|
+
in a future version.
|
35
|
+
|
4
36
|
2.4.1
|
5
37
|
-----
|
6
38
|
|
@@ -51,6 +83,11 @@ iternationalization (i18n) and localization work.
|
|
51
83
|
This situation used to raise an error but will now generate a WARN level log message
|
52
84
|
instead.
|
53
85
|
|
86
|
+
(#483) Local modifications to managed content will now be overwritten during "deploy"
|
87
|
+
actions. (Note: This change inadvertently also affected the "puppetfile install"
|
88
|
+
action in 2.4.0 and 2.4.1. This was fixed in 2.4.2. A command line flag to control
|
89
|
+
this behavior more explicitly will likely be added in a future version.)
|
90
|
+
|
54
91
|
### Bug Fixes
|
55
92
|
|
56
93
|
(#616) Ensure that Forge module version strings are valid semantic versions. (Special
|
@@ -31,7 +31,7 @@ class R10K::Git::StatefulRepository
|
|
31
31
|
@cache.resolve(ref)
|
32
32
|
end
|
33
33
|
|
34
|
-
def sync(ref)
|
34
|
+
def sync(ref, force=true)
|
35
35
|
@cache.sync if sync_cache?(ref)
|
36
36
|
|
37
37
|
sha = @cache.resolve(ref)
|
@@ -44,21 +44,25 @@ class R10K::Git::StatefulRepository
|
|
44
44
|
|
45
45
|
case workdir_status
|
46
46
|
when :absent
|
47
|
-
logger.debug
|
47
|
+
logger.debug(_("Cloning %{repo_path} and checking out %{ref}") % {repo_path: @repo.path, ref: ref })
|
48
48
|
@repo.clone(@remote, {:ref => sha})
|
49
49
|
when :mismatched
|
50
|
-
logger.debug
|
50
|
+
logger.debug(_("Replacing %{repo_path} and checking out %{ref}") % {repo_path: @repo.path, ref: ref })
|
51
51
|
@repo.path.rmtree
|
52
52
|
@repo.clone(@remote, {:ref => sha})
|
53
|
-
when :outdated
|
54
|
-
|
55
|
-
|
53
|
+
when :outdated
|
54
|
+
logger.debug(_("Updating %{repo_path} to %{ref}") % {repo_path: @repo.path, ref: ref })
|
55
|
+
@repo.checkout(sha, {:force => force})
|
56
|
+
when :dirty
|
57
|
+
if force
|
58
|
+
logger.warn(_("Overwriting local modifications to %{repo_path}") % {repo_path: @repo.path})
|
59
|
+
logger.debug(_("Updating %{repo_path} to %{ref}") % {repo_path: @repo.path, ref: ref })
|
60
|
+
@repo.checkout(sha, {:force => force})
|
61
|
+
else
|
62
|
+
logger.warn(_("Skipping %{repo_path} due to local modifications") % {repo_path: @repo.path})
|
56
63
|
end
|
57
|
-
|
58
|
-
logger.debug { _("Updating %{repo_path} to %{ref}") % {repo_path: @repo.path, ref: ref } }
|
59
|
-
@repo.checkout(sha, {:force => true})
|
60
64
|
else
|
61
|
-
logger.debug
|
65
|
+
logger.debug(_("%{repo_path} is already at Git ref %{ref}") % {repo_path: @repo.path, ref: ref })
|
62
66
|
end
|
63
67
|
end
|
64
68
|
|
@@ -71,12 +75,12 @@ class R10K::Git::StatefulRepository
|
|
71
75
|
:mismatched
|
72
76
|
elsif !(@repo.origin == @remote)
|
73
77
|
:mismatched
|
78
|
+
elsif @repo.dirty?
|
79
|
+
:dirty
|
74
80
|
elsif !(@repo.head == @cache.resolve(ref))
|
75
81
|
:outdated
|
76
82
|
elsif @cache.ref_type(ref) == :branch && !@cache.synced?
|
77
83
|
:outdated
|
78
|
-
elsif @repo.dirty?
|
79
|
-
:dirty
|
80
84
|
else
|
81
85
|
:insync
|
82
86
|
end
|
data/lib/r10k/module/base.rb
CHANGED
data/lib/r10k/module/forge.rb
CHANGED
data/lib/r10k/module/git.rb
CHANGED
data/lib/r10k/module/local.rb
CHANGED
data/lib/r10k/module/svn.rb
CHANGED
data/lib/r10k/version.rb
CHANGED
@@ -68,12 +68,19 @@ describe R10K::Git::StatefulRepository do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
describe "when the workdir has local modifications" do
|
71
|
-
it "is dirty" do
|
71
|
+
it "is dirty when workdir is up to date" do
|
72
72
|
thinrepo.clone(remote, {:ref => ref})
|
73
73
|
File.open(File.join(thinrepo.path, 'README.markdown'), 'a') { |f| f.write('local modifications!') }
|
74
74
|
|
75
75
|
expect(subject.status(ref)).to eq :dirty
|
76
76
|
end
|
77
|
+
|
78
|
+
it "is dirty when workdir is not up to date" do
|
79
|
+
thinrepo.clone(remote, {:ref => '1.0.0'})
|
80
|
+
File.open(File.join(thinrepo.path, 'README.markdown'), 'a') { |f| f.write('local modifications!') }
|
81
|
+
|
82
|
+
expect(subject.status(ref)).to eq :dirty
|
83
|
+
end
|
77
84
|
end
|
78
85
|
|
79
86
|
describe "if the right ref is checked out" do
|
@@ -119,11 +126,33 @@ describe R10K::Git::StatefulRepository do
|
|
119
126
|
end
|
120
127
|
|
121
128
|
describe "when the workdir is dirty" do
|
122
|
-
|
129
|
+
before(:each) do
|
123
130
|
thinrepo.clone(remote, {:ref => ref})
|
124
131
|
File.open(File.join(thinrepo.path, 'README.markdown'), 'a') { |f| f.write('local modifications!') }
|
125
|
-
|
126
|
-
|
132
|
+
end
|
133
|
+
|
134
|
+
context "when force == true" do
|
135
|
+
let(:force) { true }
|
136
|
+
|
137
|
+
it "warns and overwrites local modifications" do
|
138
|
+
expect(subject.logger).to receive(:warn).with(/overwriting local modifications/i)
|
139
|
+
|
140
|
+
subject.sync(ref, force)
|
141
|
+
|
142
|
+
expect(subject.status(ref)).to eq :insync
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
context "when force != true" do
|
147
|
+
let(:force) { false }
|
148
|
+
|
149
|
+
it "warns and does not overwrite local modifications" do
|
150
|
+
expect(subject.logger).to receive(:warn).with(/skipping.*due to local modifications/i)
|
151
|
+
|
152
|
+
subject.sync(ref, force)
|
153
|
+
|
154
|
+
expect(subject.status(ref)).to eq :dirty
|
155
|
+
end
|
127
156
|
end
|
128
157
|
end
|
129
158
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r10k
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Thebo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|