pact_broker 2.52.1 → 2.52.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/db/migrations/20180828_create_latest_versions.rb +1 -1
- data/lib/pact_broker/api/resources/pacticipants.rb +3 -2
- data/lib/pact_broker/hash_refinements.rb +4 -0
- data/lib/pact_broker/test/test_data_builder.rb +7 -2
- data/lib/pact_broker/ui/view_models/matrix_line.rb +1 -1
- data/lib/pact_broker/version.rb +1 -1
- data/spec/migrations/rollback_spec.rb +6 -0
- data/spec/service_consumers/provider_states_for_pact_broker_client.rb +11 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afd447b5cac167d4f764356d1c15c826a7de019d1871c684853ef602862cf387
|
4
|
+
data.tar.gz: '07328be4c8851d55e5a5834f69ce83e22df99c93cf83a21a657e1587f7afd8b3'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b8420208b660677ba8f93373346ad39e80069ba282dd9ebd7206bf65ebdf05f7803c303c1e6e0a4ebc7f69d3ff6ea2b55ecfe4e56a2735975827bad26e10370
|
7
|
+
data.tar.gz: fecbcc5f5a4824d2dc3669d6bb4bb15456ad1434031dad96e71bd571e9f92fd73d1b90b142f0d0359d6943ab618768ba607f99119fa61ffb56f75f6fb8e29ef3
|
data/CHANGELOG.md
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at pact-support@googlegroups.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
74
|
+
|
75
|
+
For answers to common questions about this code of conduct, see
|
76
|
+
https://www.contributor-covenant.org/faq
|
@@ -1,12 +1,13 @@
|
|
1
1
|
require 'pact_broker/api/resources/base_resource'
|
2
2
|
require 'pact_broker/api/decorators/pacticipant_decorator'
|
3
3
|
require 'pact_broker/domain/pacticipant'
|
4
|
+
require 'pact_broker/hash_refinements'
|
4
5
|
|
5
6
|
module PactBroker
|
6
7
|
module Api
|
7
8
|
module Resources
|
8
|
-
|
9
9
|
class Pacticipants < BaseResource
|
10
|
+
using PactBroker::HashRefinements
|
10
11
|
|
11
12
|
def content_types_provided
|
12
13
|
[["application/hal+json", :to_json]]
|
@@ -32,7 +33,7 @@ module PactBroker
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def from_json
|
35
|
-
created_model = pacticipant_service.create(params)
|
36
|
+
created_model = pacticipant_service.create(params.symbolize_keys.snakecase_keys.slice(:name, :repository_url))
|
36
37
|
response.body = decorator_for(created_model).to_json(user_options: decorator_context)
|
37
38
|
end
|
38
39
|
|
@@ -204,6 +204,7 @@ module PactBroker
|
|
204
204
|
params.delete(:comment)
|
205
205
|
json_content = params[:json_content] || default_json_content
|
206
206
|
pact_version_sha = params[:pact_version_sha] || generate_pact_version_sha(json_content)
|
207
|
+
pact_versions_count_before = PactBroker::Pacts::PactVersion.count
|
207
208
|
@pact = PactBroker::Pacts::Repository.new.create(
|
208
209
|
version_id: @consumer_version.id,
|
209
210
|
consumer_id: @consumer.id,
|
@@ -211,8 +212,9 @@ module PactBroker
|
|
211
212
|
pact_version_sha: pact_version_sha,
|
212
213
|
json_content: prepare_json_content(json_content),
|
213
214
|
)
|
215
|
+
pact_versions_count_after = PactBroker::Pacts::PactVersion.count
|
214
216
|
set_created_at_if_set(params[:created_at], :pact_publications, id: @pact.id)
|
215
|
-
set_created_at_if_set(params[:created_at], :pact_versions, sha: @pact.pact_version_sha)
|
217
|
+
set_created_at_if_set(params[:created_at], :pact_versions, sha: @pact.pact_version_sha) if pact_versions_count_after > pact_versions_count_before
|
216
218
|
set_created_at_if_set(params[:created_at], :latest_pact_publication_ids_for_consumer_versions, consumer_version_id: @consumer_version.id)
|
217
219
|
@pact = PactBroker::Pacts::PactPublication.find(id: @pact.id).to_domain
|
218
220
|
self
|
@@ -424,7 +426,10 @@ module PactBroker
|
|
424
426
|
def set_created_at_if_set created_at, table_name, selector
|
425
427
|
date_to_set = created_at || @now
|
426
428
|
if date_to_set
|
427
|
-
Sequel::Model.db[table_name].where(selector
|
429
|
+
Sequel::Model.db[table_name].where(selector).update(created_at: date_to_set)
|
430
|
+
if Sequel::Model.db.schema(table_name).any?{ |col| col.first == :updated_at }
|
431
|
+
Sequel::Model.db[table_name].where(selector.keys.first => selector.values.first).update(updated_at: date_to_set)
|
432
|
+
end
|
428
433
|
end
|
429
434
|
end
|
430
435
|
|
data/lib/pact_broker/version.rb
CHANGED
@@ -244,4 +244,15 @@ Pact.provider_states_for "Pact Broker Client" do
|
|
244
244
|
.create_webhook(uuid: "696c5f93-1b7f-44bc-8d03-59440fcaa9a0")
|
245
245
|
end
|
246
246
|
end
|
247
|
+
|
248
|
+
provider_state "the pacticipant relations are present" do
|
249
|
+
no_op
|
250
|
+
end
|
251
|
+
|
252
|
+
provider_state "a pacticipant with name Foo exists" do
|
253
|
+
set_up do
|
254
|
+
TestDataBuilder.new
|
255
|
+
.create_consumer("Foo")
|
256
|
+
end
|
257
|
+
end
|
247
258
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.52.
|
4
|
+
version: 2.52.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Skurrie
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-04-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -624,6 +624,7 @@ files:
|
|
624
624
|
- ".ruby-version"
|
625
625
|
- ".travis.yml"
|
626
626
|
- CHANGELOG.md
|
627
|
+
- CODE_OF_CONDUCT.md
|
627
628
|
- CONTRIBUTING.md
|
628
629
|
- DEVELOPER_DOCUMENTATION.md
|
629
630
|
- DEVELOPER_SETUP.md
|
@@ -1540,6 +1541,7 @@ files:
|
|
1540
1541
|
- spec/migrations/44_add_provider_version_to_verification_spec.rb
|
1541
1542
|
- spec/migrations/50_create_latest_matrix_spec.rb
|
1542
1543
|
- spec/migrations/change_migration_strategy_spec.rb
|
1544
|
+
- spec/migrations/rollback_spec.rb
|
1543
1545
|
- spec/service_consumers/hal_relation_proxy_app.rb
|
1544
1546
|
- spec/service_consumers/pact_helper.rb
|
1545
1547
|
- spec/service_consumers/provider_states_for_pact_broker_client.rb
|
@@ -1639,8 +1641,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1639
1641
|
- !ruby/object:Gem::Version
|
1640
1642
|
version: '0'
|
1641
1643
|
requirements: []
|
1642
|
-
|
1643
|
-
rubygems_version: 2.7.6
|
1644
|
+
rubygems_version: 3.1.2
|
1644
1645
|
signing_key:
|
1645
1646
|
specification_version: 4
|
1646
1647
|
summary: See description
|
@@ -1920,6 +1921,7 @@ test_files:
|
|
1920
1921
|
- spec/migrations/44_add_provider_version_to_verification_spec.rb
|
1921
1922
|
- spec/migrations/50_create_latest_matrix_spec.rb
|
1922
1923
|
- spec/migrations/change_migration_strategy_spec.rb
|
1924
|
+
- spec/migrations/rollback_spec.rb
|
1923
1925
|
- spec/service_consumers/hal_relation_proxy_app.rb
|
1924
1926
|
- spec/service_consumers/pact_helper.rb
|
1925
1927
|
- spec/service_consumers/provider_states_for_pact_broker_client.rb
|