pact_broker 2.67.0 → 2.71.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release_gem.yml +7 -1
- data/.github/workflows/test.yml +74 -0
- data/CHANGELOG.md +57 -0
- data/DEVELOPER_SETUP.md +6 -0
- data/Dockerfile +4 -3
- data/Gemfile +7 -2
- data/ISSUES.md +23 -0
- data/config/database.yml +14 -0
- data/db/ddl_statements/latest_verification_ids_for_consumer_and_provider.rb +25 -0
- data/db/migrations/20180524_create_latest_verifications_for_consumer_and_provider.rb +4 -11
- data/db/migrations/20180614_update_latest_verification_ids_for_consumer_and_provider.rb +6 -18
- data/db/migrations/20201023_create_verification_number_sequence.rb +20 -0
- data/db/migrations/20201024_create_version_order_sequence.rb +20 -0
- data/db/migrations/20201026_update_latest_verification_ids_for_consumer_and_provider.rb +14 -0
- data/docker-compose-issue-repro.yml +22 -0
- data/issue-reproduction/Dockerfile-pact-broker +42 -0
- data/lib/db.rb +4 -0
- data/lib/pact/doc/interaction_view_model.rb +12 -0
- data/lib/pact/doc/markdown/interaction.erb +3 -3
- data/lib/pact/doc/markdown/interaction_renderer.rb +2 -1
- data/lib/pact_broker/api/decorators/pact_decorator.rb +8 -0
- data/lib/pact_broker/api/resources/clean.rb +36 -0
- data/lib/pact_broker/api/resources/group.rb +5 -1
- data/lib/pact_broker/api/resources/label.rb +0 -1
- data/lib/pact_broker/api/resources/pact_content_diff.rb +1 -1
- data/lib/pact_broker/api/resources/webhooks.rb +1 -1
- data/lib/pact_broker/app.rb +2 -2
- data/lib/pact_broker/configuration.rb +3 -0
- data/lib/pact_broker/db/clean.rb +34 -11
- data/lib/pact_broker/db/clean_incremental.rb +107 -0
- data/lib/pact_broker/doc/views/integrations.markdown +5 -1
- data/lib/pact_broker/domain/tag.rb +69 -8
- data/lib/pact_broker/domain/verification.rb +6 -0
- data/lib/pact_broker/domain/version.rb +35 -1
- data/lib/pact_broker/domain/webhook_request.rb +2 -1
- data/lib/pact_broker/logging.rb +7 -0
- data/lib/pact_broker/matrix/deployment_status_summary.rb +1 -1
- data/lib/pact_broker/matrix/unresolved_selector.rb +12 -0
- data/lib/pact_broker/pacts/all_pact_publications.rb +1 -3
- data/lib/pact_broker/pacts/latest_pact_publications.rb +15 -0
- data/lib/pact_broker/pacts/metadata.rb +5 -1
- data/lib/pact_broker/pacts/pact_publication.rb +7 -1
- data/lib/pact_broker/pacts/repository.rb +4 -2
- data/lib/pact_broker/pacts/verifiable_pact_messages.rb +1 -1
- data/lib/pact_broker/tasks/clean_task.rb +42 -4
- data/lib/pact_broker/test/http_test_data_builder.rb +168 -0
- data/lib/pact_broker/verifications/repository.rb +16 -9
- data/lib/pact_broker/verifications/sequence.rb +21 -16
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/versions/sequence.rb +21 -17
- data/lib/pact_broker/webhooks/triggered_webhook.rb +6 -0
- data/pact_broker.gemspec +1 -1
- data/script/docker/db-start.sh +1 -1
- data/script/reproduce-issue.rb +43 -0
- data/spec/fixtures/approvals/modifiable_resources.approved.json +3 -0
- data/spec/lib/pact/doc/interaction_view_model_spec.rb +46 -0
- data/spec/lib/pact/doc/markdown/consumer_contract_renderer_spec.rb +11 -0
- data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +1 -1
- data/spec/lib/pact_broker/api/resources/default_base_resource_spec.rb +7 -2
- data/spec/lib/pact_broker/api/resources/group_spec.rb +9 -7
- data/spec/lib/pact_broker/db/clean_incremental_spec.rb +111 -0
- data/spec/lib/pact_broker/db/clean_spec.rb +4 -8
- data/spec/lib/pact_broker/db/delete_overwritten_data_spec.rb +1 -1
- data/spec/lib/pact_broker/domain/tag_spec.rb +46 -0
- data/spec/lib/pact_broker/domain/verification_spec.rb +13 -0
- data/spec/lib/pact_broker/domain/version_spec.rb +23 -0
- data/spec/lib/pact_broker/domain/webhook_request_spec.rb +1 -1
- data/spec/lib/pact_broker/matrix/integration_spec.rb +1 -1
- data/spec/lib/pact_broker/pacts/pact_publication_spec.rb +3 -1
- data/spec/lib/pact_broker/pacts/repository_find_wip_pact_versions_for_provider_spec.rb +14 -1
- data/spec/lib/pact_broker/verifications/sequence_spec.rb +48 -22
- data/spec/support/markdown_pact_v3.json +44 -0
- data/tasks/database.rb +8 -0
- metadata +24 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7fe157577be6cdfb603e4607b174224781db0b9b2ee7ccb1325cdda50ce129d
|
4
|
+
data.tar.gz: 9e28ef38f281ac6d6dbf1879d3794a8f915cb78bb8a82c464c7273ac9f8522dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e5d4d249f691a3e03725e3b827f4044eb2fde360cd0dd9128fce61a4442288083f825f654473cf1a3220745460675036951242cc801211eda258369e38eeb09
|
7
|
+
data.tar.gz: f8b9f3bdbfe42ca21291b41588ae4b3be15ca53efaec275e5356d8363dfa181e592942cb5e13bbd492fadb61d231cee68aaed009fef559c0645bc4debc4137c1
|
@@ -19,11 +19,17 @@ jobs:
|
|
19
19
|
# checkInterval: 15
|
20
20
|
# env:
|
21
21
|
# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
22
|
-
-
|
22
|
+
- id: release-gem
|
23
|
+
uses: pact-foundation/release-gem@v0.0.11
|
23
24
|
env:
|
24
25
|
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_API_KEY }}'
|
25
26
|
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
26
27
|
INCREMENT: '${{ github.event.client_payload.increment }}'
|
28
|
+
outputs:
|
29
|
+
gem_name: "${{ steps.release-gem.outputs.gem_name }}"
|
30
|
+
version: "${{ steps.release-gem.outputs.version }}"
|
31
|
+
increment: "${{ steps.release-gem.outputs.increment }}"
|
32
|
+
|
27
33
|
notify-gem-released:
|
28
34
|
needs: release
|
29
35
|
strategy:
|
@@ -0,0 +1,74 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
sqlite:
|
7
|
+
runs-on: "ubuntu-latest"
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby_version: ["2.7"]
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- uses: actions/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: ${{ matrix.ruby_version }}
|
16
|
+
- run: "bundle install"
|
17
|
+
- run: "bundle exec rake"
|
18
|
+
postgres:
|
19
|
+
runs-on: "ubuntu-latest"
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby_version: ["2.5", "2.7"]
|
23
|
+
services:
|
24
|
+
postgres:
|
25
|
+
image: postgres
|
26
|
+
env:
|
27
|
+
POSTGRES_PASSWORD: postgres
|
28
|
+
options: >-
|
29
|
+
--health-cmd pg_isready
|
30
|
+
--health-interval 10s
|
31
|
+
--health-timeout 5s
|
32
|
+
--health-retries 5
|
33
|
+
ports:
|
34
|
+
- 5432:5432
|
35
|
+
steps:
|
36
|
+
- uses: actions/checkout@v2
|
37
|
+
- uses: actions/setup-ruby@v1
|
38
|
+
with:
|
39
|
+
ruby-version: ${{ matrix.ruby_version }}
|
40
|
+
- run: "bundle install"
|
41
|
+
env:
|
42
|
+
INSTALL_PG: "true"
|
43
|
+
- run: "bundle exec rake"
|
44
|
+
env:
|
45
|
+
DATABASE_ADAPTER: github_actions_postgres
|
46
|
+
INSTALL_PG: "true"
|
47
|
+
mysql:
|
48
|
+
runs-on: "ubuntu-latest"
|
49
|
+
strategy:
|
50
|
+
matrix:
|
51
|
+
ruby_version: ["2.7"]
|
52
|
+
steps:
|
53
|
+
- uses: actions/checkout@v2
|
54
|
+
- uses: actions/setup-ruby@v1
|
55
|
+
with:
|
56
|
+
ruby-version: ${{ matrix.ruby_version }}
|
57
|
+
- uses: mirromutth/mysql-action@v1.1
|
58
|
+
with:
|
59
|
+
host port: 3306 # Optional, default value is 3306. The port of host
|
60
|
+
#container port: 3307 # Optional, default value is 3306. The port of container
|
61
|
+
character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
|
62
|
+
collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
|
63
|
+
mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL
|
64
|
+
mysql database: 'pact_broker' # Optional, default value is "test". The specified database which will be create
|
65
|
+
mysql root password: 'pact_broker' # Required if "mysql user" is empty, default is empty. The root superuser password
|
66
|
+
mysql user: 'pact_broker' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too
|
67
|
+
mysql password: 'pact_broker' # Required if "mysql user" exists. The password for the "mysql user"
|
68
|
+
- run: "bundle install"
|
69
|
+
env:
|
70
|
+
INSTALL_MYSQL: "true"
|
71
|
+
- run: "bundle exec rake"
|
72
|
+
env:
|
73
|
+
DATABASE_ADAPTER: github_actions_mysql
|
74
|
+
INSTALL_MYSQL: "true"
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,60 @@
|
|
1
|
+
<a name="v2.71.0"></a>
|
2
|
+
### v2.71.0 (2020-11-28)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* allow clean to be performed in dry run mode ([a7a18fde](/../../commit/a7a18fde))
|
7
|
+
|
8
|
+
<a name="v2.70.0"></a>
|
9
|
+
### v2.70.0 (2020-11-28)
|
10
|
+
|
11
|
+
#### Features
|
12
|
+
|
13
|
+
* allow limit to be applied to clean task ([d29e5c62](/../../commit/d29e5c62))
|
14
|
+
* optimise the query to load the tags with latest flags ([bc47613f](/../../commit/bc47613f))
|
15
|
+
* optimise query to find head tags for a pact ([67309e37](/../../commit/67309e37))
|
16
|
+
|
17
|
+
* **wip pacts**
|
18
|
+
* experimental feature - if no provider versions exist, consider all head pacts wip ([a635cc53](/../../commit/a635cc53))
|
19
|
+
|
20
|
+
#### Bug Fixes
|
21
|
+
|
22
|
+
* return empty body when group csv is requested for a pacticipant that does not have any integrations ([fb4e28ce](/../../commit/fb4e28ce))
|
23
|
+
|
24
|
+
<a name="v2.69.0"></a>
|
25
|
+
### v2.69.0 (2020-11-24)
|
26
|
+
|
27
|
+
#### Features
|
28
|
+
|
29
|
+
* **wip**
|
30
|
+
* keep pacts as WIP when verified via the pactUrl passed though the webhook template parameters - experimental. ([a9b3fef0](/../../commit/a9b3fef0))
|
31
|
+
|
32
|
+
* add link to the pact content version ([8eefba5f](/../../commit/8eefba5f))
|
33
|
+
* display V3 provider states in HTML (#357) ([8e06a7f2](/../../commit/8e06a7f2))
|
34
|
+
* optimise query for determining latest verification for consumer and provider ([7889b051](/../../commit/7889b051))
|
35
|
+
|
36
|
+
#### Bug Fixes
|
37
|
+
|
38
|
+
* return a 404 when the base pact for a pact diff doesn't exist ([74d3644d](/../../commit/74d3644d))
|
39
|
+
* Add consumer name to inclusion reason log (#358) ([82901891](/../../commit/82901891))
|
40
|
+
|
41
|
+
<a name="v2.68.1"></a>
|
42
|
+
### v2.68.1 (2020-10-24)
|
43
|
+
|
44
|
+
#### Bug Fixes
|
45
|
+
|
46
|
+
* set default User-Agent header in webhook requests ([caa71f9b](/../../commit/caa71f9b))
|
47
|
+
|
48
|
+
<a name="v2.68.0"></a>
|
49
|
+
### v2.68.0 (2020-10-23)
|
50
|
+
|
51
|
+
#### Features
|
52
|
+
|
53
|
+
* use a sequence for the version order on postgres ([da497a76](/../../commit/da497a76))
|
54
|
+
* only cascade apps for 404s (not 405s) ([4e1b3083](/../../commit/4e1b3083))
|
55
|
+
* use a sequence for the verification number on postgres ([b8f029ee](/../../commit/b8f029ee))
|
56
|
+
* optimise query to find latest verification for pact ([db17ef5a](/../../commit/db17ef5a))
|
57
|
+
|
1
58
|
<a name="v2.67.0"></a>
|
2
59
|
### v2.67.0 (2020-10-16)
|
3
60
|
|
data/DEVELOPER_SETUP.md
CHANGED
@@ -28,6 +28,12 @@ This allows you to open a shell to a development environment where you can run t
|
|
28
28
|
|
29
29
|
Remember to rebuild the image if you change any of the gems or gem versions.
|
30
30
|
|
31
|
+
* Run the server on the docker image
|
32
|
+
|
33
|
+
```sh
|
34
|
+
docker run --rm -v $(PWD):/home -w /home --entrypoint /bin/sh -p 9292:9292 -it pact_broker:dev /usr/local/bin/start
|
35
|
+
```
|
36
|
+
|
31
37
|
### With native install
|
32
38
|
|
33
39
|
* You will need to install Ruby 2.5, and preferably a ruby version manager. I recommend using [chruby][chruby] and [ruby-install][ruby-install].
|
data/Dockerfile
CHANGED
@@ -26,6 +26,7 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
|
|
26
26
|
|
27
27
|
|
28
28
|
COPY Gemfile /home/Gemfile
|
29
|
+
COPY Gemfile.lock /home/Gemfile.lock
|
29
30
|
COPY pact_broker.gemspec /home/pact_broker.gemspec
|
30
31
|
COPY lib/pact_broker/version.rb /home/lib/pact_broker/version.rb
|
31
32
|
COPY .gitignore /home/.gitignore
|
@@ -33,9 +34,9 @@ COPY .gitignore /home/.gitignore
|
|
33
34
|
RUN gem install bundler -v '~>2.0.0' \
|
34
35
|
&& bundle install --jobs 3 --retry 3
|
35
36
|
|
36
|
-
RUN echo '#!/bin/sh' >> /
|
37
|
-
RUN echo 'bundle exec rackup -o 0.0.0.0 -p 9292' >> /
|
38
|
-
RUN chmod +x /
|
37
|
+
RUN echo '#!/bin/sh' >> /usr/local/bin/start
|
38
|
+
RUN echo 'bundle exec rackup -o 0.0.0.0 -p 9292' >> /usr/local/bin/start
|
39
|
+
RUN chmod +x /usr/local/bin/start
|
39
40
|
|
40
41
|
RUN echo '#!/bin/sh' >> /home/init-db.sh
|
41
42
|
RUN echo 'bundle exec rake db:prepare:test' >> /home/init-db.sh
|
data/Gemfile
CHANGED
@@ -18,14 +18,15 @@ group :test do
|
|
18
18
|
gem 'rspec-pact-matchers', '~>0.1'
|
19
19
|
gem 'bundler-audit', '~>0.4'
|
20
20
|
gem 'fakefs', '~>0.4'
|
21
|
-
gem 'webmock', '~>
|
21
|
+
gem 'webmock', '~>3.9'
|
22
22
|
gem 'rspec', '~>3.0'
|
23
23
|
gem 'rspec-its', '~>1.2'
|
24
24
|
gem 'database_cleaner', '~>1.8', '>= 1.8.1'
|
25
25
|
gem 'timecop', '~> 0.9'
|
26
26
|
gem 'faraday', '~>0.15'
|
27
|
+
gem 'faraday_middleware', '~> 0.14'
|
27
28
|
gem 'docker-api', '~>1.34'
|
28
|
-
gem 'approvals', '
|
29
|
+
gem 'approvals', '>=0.0.1', '<1.0.0'
|
29
30
|
end
|
30
31
|
|
31
32
|
if ENV['INSTALL_MYSQL'] == "true"
|
@@ -35,3 +36,7 @@ end
|
|
35
36
|
if ENV['INSTALL_PG'] == 'true'
|
36
37
|
gem 'pg', '~>1.2'
|
37
38
|
end
|
39
|
+
|
40
|
+
if ENV['X_PACT_DEVELOPMENT'] == 'true'
|
41
|
+
gem 'pact-support', path: '../pact-support'
|
42
|
+
end
|
data/ISSUES.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Issues
|
2
|
+
|
3
|
+
## Reproducing an issue
|
4
|
+
|
5
|
+
In [script/reproduce-issue.rb](script/reproduce-issue.rb) you will find a fluent API that allows you to simulate client libraries interacting with the Pact Broker.
|
6
|
+
|
7
|
+
You can use it to easily reproduce issues.
|
8
|
+
|
9
|
+
To use it:
|
10
|
+
|
11
|
+
* Run the Pact Broker using the latest development code:
|
12
|
+
|
13
|
+
```
|
14
|
+
docker-compose -f docker-compose-issue-repro.yml up --build pact-broker
|
15
|
+
```
|
16
|
+
|
17
|
+
* Run the reproduction script.
|
18
|
+
|
19
|
+
```
|
20
|
+
docker-compose -f docker-compose-issue-repro.yml up repro-issue
|
21
|
+
```
|
22
|
+
|
23
|
+
You can modify `script/reproduce-issue.rb` and then re-run it with the change applied.
|
data/config/database.yml
CHANGED
@@ -36,6 +36,20 @@ test:
|
|
36
36
|
<<: *default
|
37
37
|
adapter: mysql2
|
38
38
|
host: "192.168.0.9"
|
39
|
+
github_actions_postgres:
|
40
|
+
adapter: postgres
|
41
|
+
database: postgres
|
42
|
+
username: postgres
|
43
|
+
password: postgres
|
44
|
+
host: localhost
|
45
|
+
port: "5432"
|
46
|
+
github_actions_mysql:
|
47
|
+
adapter: mysql2
|
48
|
+
database: pact_broker
|
49
|
+
username: pact_broker
|
50
|
+
password: pact_broker
|
51
|
+
host: localhost
|
52
|
+
port: 3306
|
39
53
|
|
40
54
|
development:
|
41
55
|
default:
|
@@ -0,0 +1,25 @@
|
|
1
|
+
LATEST_VERIFICATION_IDS_FOR_CONSUMER_AND_PROVIDER_V1 = "select
|
2
|
+
pv.pacticipant_id as provider_id,
|
3
|
+
lpp.consumer_id,
|
4
|
+
max(v.id) as latest_verification_id
|
5
|
+
from verifications v
|
6
|
+
join latest_pact_publications_by_consumer_versions lpp
|
7
|
+
on v.pact_version_id = lpp.pact_version_id
|
8
|
+
join versions pv
|
9
|
+
on v.provider_version_id = pv.id
|
10
|
+
group by pv.pacticipant_id, lpp.consumer_id"
|
11
|
+
|
12
|
+
LATEST_VERIFICATION_IDS_FOR_CONSUMER_AND_PROVIDER_V2 = "select
|
13
|
+
provider_id,
|
14
|
+
consumer_id,
|
15
|
+
max(id) as latest_verification_id
|
16
|
+
from verifications v
|
17
|
+
group by provider_id, consumer_id"
|
18
|
+
|
19
|
+
|
20
|
+
LATEST_VERIFICATION_IDS_FOR_CONSUMER_AND_PROVIDER_V3 = "select
|
21
|
+
provider_id,
|
22
|
+
consumer_id,
|
23
|
+
max(verification_id) as latest_verification_id
|
24
|
+
from latest_verification_id_for_pact_version_and_provider_version v
|
25
|
+
group by provider_id, consumer_id"
|
@@ -1,17 +1,10 @@
|
|
1
|
+
require_relative '../ddl_statements/latest_verification_ids_for_consumer_and_provider'
|
2
|
+
|
1
3
|
Sequel.migration do
|
2
4
|
up do
|
3
|
-
# The latest verification id for each consumer
|
5
|
+
# The latest verification id for each consumer/provider
|
4
6
|
create_view(:latest_verification_ids_for_consumer_and_provider,
|
5
|
-
|
6
|
-
pv.pacticipant_id as provider_id,
|
7
|
-
lpp.consumer_id,
|
8
|
-
max(v.id) as latest_verification_id
|
9
|
-
from verifications v
|
10
|
-
join latest_pact_publications_by_consumer_versions lpp
|
11
|
-
on v.pact_version_id = lpp.pact_version_id
|
12
|
-
join versions pv
|
13
|
-
on v.provider_version_id = pv.id
|
14
|
-
group by pv.pacticipant_id, lpp.consumer_id")
|
7
|
+
LATEST_VERIFICATION_IDS_FOR_CONSUMER_AND_PROVIDER_V1)
|
15
8
|
|
16
9
|
# The most recent verification for each consumer/consumer version tag/provider
|
17
10
|
latest_verifications = from(:verifications)
|
@@ -1,27 +1,15 @@
|
|
1
|
+
require_relative '../ddl_statements/latest_verification_ids_for_consumer_and_provider'
|
2
|
+
|
1
3
|
Sequel.migration do
|
2
4
|
up do
|
3
|
-
# The latest verification id for each consumer
|
5
|
+
# The latest verification id for each consumer/provider
|
4
6
|
create_or_replace_view(:latest_verification_ids_for_consumer_and_provider,
|
5
|
-
|
6
|
-
provider_id,
|
7
|
-
consumer_id,
|
8
|
-
max(id) as latest_verification_id
|
9
|
-
from verifications v
|
10
|
-
group by provider_id, consumer_id")
|
7
|
+
LATEST_VERIFICATION_IDS_FOR_CONSUMER_AND_PROVIDER_V2)
|
11
8
|
end
|
12
9
|
|
13
10
|
down do
|
14
|
-
# The latest verification id for each consumer
|
11
|
+
# The latest verification id for each consumer/provider
|
15
12
|
create_or_replace_view(:latest_verification_ids_for_consumer_and_provider,
|
16
|
-
|
17
|
-
pv.pacticipant_id as provider_id,
|
18
|
-
lpp.consumer_id,
|
19
|
-
max(v.id) as latest_verification_id
|
20
|
-
from verifications v
|
21
|
-
join latest_pact_publications_by_consumer_versions lpp
|
22
|
-
on v.pact_version_id = lpp.pact_version_id
|
23
|
-
join versions pv
|
24
|
-
on v.provider_version_id = pv.id
|
25
|
-
group by pv.pacticipant_id, lpp.consumer_id")
|
13
|
+
LATEST_VERIFICATION_IDS_FOR_CONSUMER_AND_PROVIDER_V1)
|
26
14
|
end
|
27
15
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'migration_helper'
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
if PactBroker::MigrationHelper.postgres?
|
6
|
+
row = from(:verification_sequence_number).select(:value).limit(1).first
|
7
|
+
start = row ? row[:value] + 100 : 1
|
8
|
+
run("CREATE SEQUENCE verification_number_sequence START WITH #{start}")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
down do
|
13
|
+
if PactBroker::MigrationHelper.postgres?
|
14
|
+
nextval = execute("SELECT nextval('verification_number_sequence') as val") { |v| v.first["val"].to_i }
|
15
|
+
# Add a safety margin!
|
16
|
+
from(:verification_sequence_number).update(value: nextval + 100)
|
17
|
+
run("DROP SEQUENCE verification_number_sequence")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'migration_helper'
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
if PactBroker::MigrationHelper.postgres?
|
6
|
+
row = from(:version_sequence_number).select(:value).limit(1).first
|
7
|
+
start = row ? row[:value] + 100 : 1
|
8
|
+
run("CREATE SEQUENCE version_order_sequence START WITH #{start}")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
down do
|
13
|
+
if PactBroker::MigrationHelper.postgres?
|
14
|
+
nextval = execute("SELECT nextval('version_order_sequence') as val") { |v| v.first["val"].to_i }
|
15
|
+
# Add a safety margin!
|
16
|
+
from(:version_sequence_number).update(value: nextval + 100)
|
17
|
+
run("DROP SEQUENCE version_order_sequence")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require_relative 'migration_helper'
|
2
|
+
require_relative '../ddl_statements/latest_verification_ids_for_consumer_and_provider'
|
3
|
+
|
4
|
+
Sequel.migration do
|
5
|
+
up do
|
6
|
+
create_or_replace_view(:latest_verification_ids_for_consumer_and_provider,
|
7
|
+
LATEST_VERIFICATION_IDS_FOR_CONSUMER_AND_PROVIDER_V3)
|
8
|
+
end
|
9
|
+
|
10
|
+
down do
|
11
|
+
create_or_replace_view(:latest_verification_ids_for_consumer_and_provider,
|
12
|
+
LATEST_VERIFICATION_IDS_FOR_CONSUMER_AND_PROVIDER_V2)
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
version: "3"
|
2
|
+
|
3
|
+
services:
|
4
|
+
pact-broker:
|
5
|
+
build: .
|
6
|
+
ports:
|
7
|
+
- "9292:9292"
|
8
|
+
entrypoint: /usr/local/bin/start
|
9
|
+
environment:
|
10
|
+
- RACK_ENV=production
|
11
|
+
volumes:
|
12
|
+
- $PWD:/home
|
13
|
+
|
14
|
+
repro-issue:
|
15
|
+
build: .
|
16
|
+
depends_on:
|
17
|
+
- pact-broker
|
18
|
+
command: dockerize -wait http://pact-broker:9292 -timeout 30s /home/script/reproduce-issue.rb
|
19
|
+
environment:
|
20
|
+
- PACT_BROKER_BASE_URL=http://pact-broker:9292
|
21
|
+
volumes:
|
22
|
+
- $PWD:/home
|
@@ -0,0 +1,42 @@
|
|
1
|
+
FROM ruby:2.5.3-alpine
|
2
|
+
|
3
|
+
RUN apk update \
|
4
|
+
&& apk --no-cache add \
|
5
|
+
"build-base>=0.5" \
|
6
|
+
"bash>=4.4" \
|
7
|
+
"ca-certificates>=20190108" \
|
8
|
+
"git>=2.20" \
|
9
|
+
"postgresql-dev>=11.3" \
|
10
|
+
"sqlite-dev>=3.28" \
|
11
|
+
"sqlite>=3.28" \
|
12
|
+
"tzdata>=2019" \
|
13
|
+
"mariadb-dev>=10.3" \
|
14
|
+
&& rm -rf /var/cache/apk/*
|
15
|
+
|
16
|
+
RUN apk add --no-cache openssl less
|
17
|
+
|
18
|
+
ENV DOCKERIZE_VERSION v0.6.1
|
19
|
+
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
20
|
+
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
21
|
+
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
|
22
|
+
|
23
|
+
|
24
|
+
WORKDIR /home
|
25
|
+
|
26
|
+
COPY Gemfile /home/Gemfile
|
27
|
+
COPY pact_broker.gemspec /home/pact_broker.gemspec
|
28
|
+
COPY lib/pact_broker/version.rb /home/lib/pact_broker/version.rb
|
29
|
+
COPY .gitignore /home/.gitignore
|
30
|
+
|
31
|
+
RUN gem install bundler -v '~>2.0.0' \
|
32
|
+
&& bundle install --jobs 3 --retry 3
|
33
|
+
|
34
|
+
COPY lib /home/lib
|
35
|
+
COPY db /home/db
|
36
|
+
COPY public /home/public
|
37
|
+
COPY tasks /home/tasks
|
38
|
+
COPY config.ru /home/config.ru
|
39
|
+
COPY Rakefile /home/Rakefile
|
40
|
+
COPY script /home/script
|
41
|
+
|
42
|
+
RUN ls /home
|