kpm 0.10.0 → 0.10.1

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: ee0a0c6bd9401fa083710541772db690618749d31ea65a6531aee02bfcbc075b
4
- data.tar.gz: b46b7a3777be07cd3b6ca5be05ef5c76504e4c8ca7e54938487c42b017b251c7
3
+ metadata.gz: d052b9c73fbb831cf7469a3f57ae21dfe733ededd65541f7b693117b857d4f7c
4
+ data.tar.gz: a76a44cac1de427a83183be0d1d271f8f79e35f0945d9722576363a5644be690
5
5
  SHA512:
6
- metadata.gz: f1d274c79ad9762432a649c144d32f4365cc93ab57f841a58293c666d432895056872882b1edee2b1e6493e83a5f27d719825f490f8ca594188c906665253cf4
7
- data.tar.gz: 9fbe10b774582a2bf60f534b134d1180109efcd18ff8dc6cc901de74a4e9ee1ee8e11416c5848cee4a7658b3703c67d2c93c590804ec9a25500e9902a7f6189d
6
+ metadata.gz: f8c51c778cd35a93b2416c8eed3ba9e43d9307ab1df9b6d066ca67384b17c17b32f612445ce102433b261057a137fe5b95b13be5366ec73a79eeb40cedd588ba
7
+ data.tar.gz: b634baf2edc85f1f0f0880dc4d1c81deb434affe7ee4065825f31fcffa53fe9f6a62fc5849e93b00d44cf9da64952a3e9c0431d89e73e6edd58541bd47175619
@@ -0,0 +1,21 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ killbill:
5
+ network_mode: host
6
+ image: killbill/killbill:0.22.1
7
+ environment:
8
+ - KILLBILL_CATALOG_URI=SpyCarAdvanced.xml
9
+ - KILLBILL_DAO_URL=jdbc:mysql://0.0.0.0:3306/killbill
10
+ - KILLBILL_DAO_USER=root
11
+ - KILLBILL_DAO_PASSWORD=root
12
+ - KILLBILL_SERVER_TEST_MODE=true
13
+ - KILLBILL_INVOICE_SANITY_SAFETY_BOUND_ENABLED=false
14
+ - KILLBILL_INVOICE_MAX_DAILY_NUMBER_OF_ITEMS_SAFETY_BOUND=-1
15
+ depends_on:
16
+ - db
17
+ db:
18
+ network_mode: host
19
+ image: killbill/mariadb:0.22
20
+ environment:
21
+ - MYSQL_ROOT_PASSWORD=root
@@ -9,7 +9,11 @@ module KPM
9
9
  module NexusFacade
10
10
  class CloudsmithApiCalls < NexusApiCallsV2
11
11
  def pull_artifact_endpoint(coordinates)
12
- version_artifact_details = parent_get_artifact_info(coordinates)
12
+ version_artifact_details = begin
13
+ parent_get_artifact_info(coordinates)
14
+ rescue StandardError
15
+ ''
16
+ end
13
17
 
14
18
  # For SNAPSHOTs, we need to figure out the version used as part of the filename
15
19
  filename_version = begin
@@ -27,8 +31,6 @@ module KPM
27
31
 
28
32
  alias parent_get_artifact_info get_artifact_info
29
33
  def get_artifact_info(coordinates)
30
- super
31
-
32
34
  _, versioned_artifact, coords = build_base_path_and_coords(coordinates)
33
35
  sha1 = get_sha1(coordinates)
34
36
  "<artifact-resolution>
@@ -13,7 +13,7 @@
13
13
  :versions:
14
14
  :0.18: 4.2.5
15
15
  :0.20: 6.0.1
16
- :0.22: 7.0.8
16
+ :0.22: 7.1.1
17
17
  :avatax:
18
18
  :type: :java
19
19
  :versions:
@@ -80,4 +80,4 @@
80
80
  :stripe:
81
81
  :type: :java
82
82
  :versions:
83
- :0.22: 7.2.0
83
+ :0.22: 7.3.0
data/lib/kpm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KPM
4
- VERSION = '0.10.0'
4
+ VERSION = '0.10.1'
5
5
  end
data/pom.xml CHANGED
@@ -22,7 +22,7 @@
22
22
  <modelVersion>4.0.0</modelVersion>
23
23
  <groupId>org.kill-bill.billing.installer</groupId>
24
24
  <artifactId>kpm</artifactId>
25
- <version>0.10.0</version>
25
+ <version>0.10.1</version>
26
26
  <packaging>pom</packaging>
27
27
  <name>KPM</name>
28
28
  <description>KPM: the Kill Bill Package Manager</description>
@@ -24,17 +24,86 @@ describe KPM::NexusFacade, skip_me_if_nil: ENV['CLOUDSMITH_TOKEN'].nil? do
24
24
  expect { nexus_remote.search_for_artifacts(coordinates) }.to raise_exception(NoMethodError, 'Cloudsmith has no search support')
25
25
  }
26
26
 
27
- it {
28
- response = nil
29
- expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
30
- expect(REXML::Document.new(response).elements['//version'].text).to eq(coordinates_map[:version])
31
- }
27
+ # Upload as: cloudsmith push maven -v --group-id com.mycompany.app --artifact-id my-app --packaging pom --version 1.2.3 org/repo my-app-1.2.3.pom
28
+ # <project>
29
+ # <modelVersion>4.0.0</modelVersion>
30
+ # <groupId>com.mycompany.app</groupId>
31
+ # <artifactId>my-app</artifactId>
32
+ # <version>1.2.3</version>
33
+ # <packaging>pom</packaging>
34
+ # </project>
35
+ context 'when pulling release artifact' do
36
+ let(:coordinates_map) do
37
+ { version: '1.2.3',
38
+ group_id: 'com.mycompany.app',
39
+ artifact_id: 'my-app',
40
+ packaging: 'pom',
41
+ classifier: nil }
42
+ end
43
+ let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
32
44
 
33
- it {
34
- response = nil
35
- destination = Dir.mktmpdir('artifact')
36
- expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
37
- destination = File.join(File.expand_path(destination), response[:file_name])
38
- expect(File.read(destination)).to match(/org.kill-bill.billing/)
39
- }
45
+ it {
46
+ response = nil
47
+ expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
48
+ parsed_doc = REXML::Document.new(response)
49
+ expect(parsed_doc.elements['//version'].text).to eq('1.2.3')
50
+ expect(parsed_doc.elements['//repositoryPath'].text).to eq('/com/mycompany/app/1.2.3/my-app-1.2.3.pom')
51
+ expect(parsed_doc.elements['//snapshot'].text).to eq('false')
52
+ }
53
+
54
+ it {
55
+ response = nil
56
+ destination = Dir.mktmpdir('artifact')
57
+ expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
58
+ destination = File.join(File.expand_path(destination), response[:file_name])
59
+ parsed_pom = REXML::Document.new(File.read(destination))
60
+ expect(parsed_pom.elements['//groupId'].text).to eq('com.mycompany.app')
61
+ expect(parsed_pom.elements['//artifactId'].text).to eq('my-app')
62
+ expect(parsed_pom.elements['//version'].text).to eq('1.2.3')
63
+ }
64
+ end
65
+
66
+ # File uploaded twice (the first doesn't have any <properties>)
67
+ # <project>
68
+ # <modelVersion>4.0.0</modelVersion>
69
+ # <groupId>com.mycompany.app</groupId>
70
+ # <artifactId>my-app</artifactId>
71
+ # <version>1.2.4-SNAPSHOT</version>
72
+ # <packaging>pom</packaging>
73
+ # <properties>
74
+ # <for-kpm>true</for-kpm>
75
+ # </properties>
76
+ # </project>
77
+ context 'when pulling SNAPSHOT artifact' do
78
+ let(:coordinates_map) do
79
+ { version: '1.2.4-SNAPSHOT',
80
+ group_id: 'com.mycompany.app',
81
+ artifact_id: 'my-app',
82
+ packaging: 'pom',
83
+ classifier: nil }
84
+ end
85
+ let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
86
+
87
+ it {
88
+ response = nil
89
+ expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
90
+ parsed_doc = REXML::Document.new(response)
91
+ expect(parsed_doc.elements['//version'].text).to eq('1.2.4-SNAPSHOT')
92
+ expect(parsed_doc.elements['//repositoryPath'].text).to eq('/com/mycompany/app/1.2.4-SNAPSHOT/my-app-1.2.4-SNAPSHOT.pom')
93
+ expect(parsed_doc.elements['//snapshot'].text).to eq('true')
94
+ }
95
+
96
+ it {
97
+ response = nil
98
+ destination = Dir.mktmpdir('artifact')
99
+ expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
100
+ destination = File.join(File.expand_path(destination), response[:file_name])
101
+ parsed_pom = REXML::Document.new(File.read(destination))
102
+ expect(parsed_pom.elements['//groupId'].text).to eq('com.mycompany.app')
103
+ expect(parsed_pom.elements['//artifactId'].text).to eq('my-app')
104
+ expect(parsed_pom.elements['//version'].text).to eq('1.2.4-SNAPSHOT')
105
+ # Verify that if multiple SNAPSHOTs are uploaded, the last one is downloaded (the first one doesn't have <properties>)
106
+ expect(parsed_pom.elements['//properties/for-kpm'].text).to eq('true')
107
+ }
108
+ end
40
109
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-22 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -122,6 +122,7 @@ files:
122
122
  - README.adoc
123
123
  - Rakefile
124
124
  - bin/kpm
125
+ - docker/docker-compose.ci.mysql.yml
125
126
  - install_example.yml
126
127
  - kpm.gemspec
127
128
  - lib/kpm.rb