manifestly 2.3.5 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47dda06e6e700b317780d75c6c00a33530d965cc
4
- data.tar.gz: 6609152fec2cacd952a22f56512cb0da18da349c
3
+ metadata.gz: 50e16c5ca04e57fbe559ae1320d7be6ff4698657
4
+ data.tar.gz: 79b8b5a9fc98b0e7cd6e9aeb7f62c08e4a725f02
5
5
  SHA512:
6
- metadata.gz: ab10f14fa3e9867b39eff764bebcac01e35ce62abe2b7056055dd20dd0a36c08393d5926285be3acb072c5933cb907b137b35c3af8275371d8a03f22a582538e
7
- data.tar.gz: 43c6081ac7133ef7bef7f500c11dcfec53a39ac6cbc3eb9e68426abaadb595a8121c27c2d54e0b8d27f716c0efcc87c853e6e7a68dbdb3a781fe8b8cff267a12
6
+ metadata.gz: fb5405e348c4476facc9462f6e03cedfeb994899c87c761363e49b38b93e5ea3d2eb73248fef0caf03370d11e5b1268cc5a7a95fed181d73fc8350795e9236f7
7
+ data.tar.gz: 04bcb082f5a1b47d55da807ccd10a8fe9d606c1c1e7820c2f7677a1301b38732d947f73069728631f81cacbe4bfd5fbbb9fdd65bf8cfb9eebacaefced5b31e12
@@ -326,6 +326,17 @@ module Manifestly
326
326
  When you run this command, the tag is immediately pushed to the upstream
327
327
  manifest repository.
328
328
 
329
+ Implementation note: if you look at the underlying git repository, you'll
330
+ see that tags are stored as the value you provided prepended with a
331
+ timestamp, some random characters (for uniqueness), and the filename
332
+ being tagged. These unique tags are never removed and are what are used
333
+ by Manifestly, e.g. in the `find` command. However, to make direct use
334
+ of the manifest repository easier, we also use moving tags that just
335
+ consist of the tag value you provide prepended by the filename being
336
+ tagged. Each time you put tag `blah` on a sha for a file `my.manifest`,
337
+ a `my.manifest/blah` tag will move to that sha in the underlying manifest
338
+ git repo.
339
+
329
340
  #{Rainbow("Examples:").bright}
330
341
 
331
342
  $> manifestly tag --repo=org/repo --sha=fe10b5fdb9 --tag=release-to-qa --message="howdy"
@@ -371,6 +382,10 @@ module Manifestly
371
382
  You can limit the number of returned SHAs with the `--limit` flag.
372
383
  Otherwise, all matching SHAs are returned.
373
384
 
385
+ Implementation note: only pays attention to the unique versions of tags
386
+ created through manifestly, not to the "plain" tags that exist to support
387
+ direct use of the manifest git repo.
388
+
374
389
  #{Rainbow("Examples:").bright}
375
390
 
376
391
  $> manifestly find --tag=release-to-qa --repo=org/some_repo --repo-file=foo\x5
@@ -192,15 +192,21 @@ module Manifestly
192
192
  raise(ShaAlreadyTagged) if existing_shas.any?{|existing| existing.match(/#{options[:sha]}/)}
193
193
 
194
194
  filename = get_commit_filename(options[:sha])
195
- tag = "#{Time.now.utc.strftime("%Y%m%d-%H%M%S.%6N")}/#{::SecureRandom.hex(2)}/#{filename}/#{options[:tag]}"
196
- git.add_tag(tag, options[:sha], {annotate: true, message: options[:message], f: true})
197
- git.push('origin', "refs/tags/#{tag}", f: true) if options[:push]
195
+
196
+ plain_tag = "#{filename}/#{options[:tag]}"
197
+ git.add_tag(plain_tag, options[:sha], {annotate: true, message: options[:message], f: true})
198
+ git.push('origin', "refs/tags/#{plain_tag}", f: true) if options[:push]
199
+
200
+ unique_tag = "#{Time.now.utc.strftime("%Y%m%d-%H%M%S.%6N")}/#{::SecureRandom.hex(2)}/#{filename}/#{options[:tag]}"
201
+ git.add_tag(unique_tag, options[:sha], {annotate: true, message: options[:message], f: true})
202
+ git.push('origin', "refs/tags/#{unique_tag}", f: true) if options[:push]
198
203
  end
199
204
 
200
205
  def get_shas_with_tag(options={})
201
206
  options[:file] ||= ".*"
202
207
  options[:order] ||= :descending
203
208
 
209
+ # only look for the unique tags, not the plain ones
204
210
  pattern = /.*\/#{options[:file]}\/#{options[:tag]}/
205
211
 
206
212
  tag_objects = git.tags.select{|tag| tag.name.match(pattern)}
@@ -1,3 +1,3 @@
1
1
  module Manifestly
2
- VERSION = "2.3.5"
2
+ VERSION = "2.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manifestly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Slavinsky
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2016-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor