pact_broker 1.16.0 → 1.17.0
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/.ruby-version +1 -1
 - data/.travis.yml +3 -3
 - data/CHANGELOG.md +7 -0
 - data/README.md +4 -4
 - data/example/config.ru +5 -2
 - data/lib/pact_broker/api.rb +2 -2
 - data/lib/pact_broker/api/resources/index.rb +5 -0
 - data/lib/pact_broker/doc/views/publish-pact.markdown +34 -0
 - data/lib/pact_broker/version.rb +1 -1
 - data/pact_broker.gemspec +1 -1
 - metadata +4 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 704a8bf131bce7c4214d8933e1d31573a4fc6a71
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b2f82bc870f1b576beffbd95f10048675f29aa54
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b14cd135db0e688740d2b3538b335f1bd6f1b08d75b3e48e6f188190931b31a6a2122ed9fc73077b82641c100ac1c5854be79de1fee4018fa3af65d65b71b688
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: '004048b7e344b12ba5051eabdabeff73f5faeb2f37e0acfb512c3025bb8699fd84361b6fe65fe76f12a6e3a54233c48b667bc7115a8b0541c8f515c27da294b7'
         
     | 
    
        data/.ruby-version
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            2.3. 
     | 
| 
      
 1 
     | 
    
         
            +
            2.3.4
         
     | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -2,6 +2,13 @@ Do this to generate your change history 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
                $ git log --pretty=format:'  * %h - %s (%an, %ad)' vX.Y.Z..HEAD
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
            #### 1.17.0 (2017-04-26)
         
     | 
| 
      
 6 
     | 
    
         
            +
            * 5cbb9da - Added pb:publish-pact to HAL index (Beth Skurrie, Wed Apr 26 08:39:15 2017 +1000)
         
     | 
| 
      
 7 
     | 
    
         
            +
            * 36842d1 - Set database connection timezone to UTC in example config.ru (Beth Skurrie, Tue Apr 25 16:18:58 2017 +1000)
         
     | 
| 
      
 8 
     | 
    
         
            +
            * c7589c9 - Use latest ruby-2.3.4 for development. (Tan Le, Mon Apr 24 23:05:27 2017 +1000)
         
     | 
| 
      
 9 
     | 
    
         
            +
            * 46b87f9 - Use latest ruby patches for CI. (Tan Le, Mon Apr 24 23:00:12 2017 +1000)
         
     | 
| 
      
 10 
     | 
    
         
            +
            * 7c17c62 - Required at least ruby-2.2.0 as we move along ruby release schedule. (Tan Le, Mon Apr 24 22:54:52 2017 +1000)
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
       5 
12 
     | 
    
         
             
            #### 1.16.0 (2017-04-10)
         
     | 
| 
       6 
13 
     | 
    
         
             
            * 990575f - Added HTML content type for request to get a specific version of a pact. As per request in https://github.com/bethesque/pact_broker/issues/82 (Beth Skurrie, Mon Apr 10 15:34:28 2017 +1000)
         
     | 
| 
       7 
14 
     | 
    
         
             
            * b47b8d8 - Use /versions rather than /version in test endpoint. Singular will be deprecated. (Beth Skurrie, Fri Apr 7 16:03:19 2017 +1000)
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -66,7 +66,7 @@ Paste the pact URL into a browser to view a HTML version of the pact. 
     | 
|
| 
       66 
66 
     | 
    
         | 
| 
       67 
67 
     | 
    
         
             
            #### HAL browser
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
       69 
     | 
    
         
            -
            Use the embedded HAL browser to  
     | 
| 
      
 69 
     | 
    
         
            +
            Use the embedded HAL browser to navigate the API.
         
     | 
| 
       70 
70 
     | 
    
         
             
            * * *
         
     | 
| 
       71 
71 
     | 
    
         
             
            <img src="https://raw.githubusercontent.com/wiki/bethesque/pact_broker/images/hal_browser.png"/>
         
     | 
| 
       72 
72 
     | 
    
         | 
| 
         @@ -80,7 +80,7 @@ Use the HAL browser to view documentation as you browse. 
     | 
|
| 
       80 
80 
     | 
    
         | 
| 
       81 
81 
     | 
    
         
             
            ### To have a play around on your local machine
         
     | 
| 
       82 
82 
     | 
    
         | 
| 
       83 
     | 
    
         
            -
            * Install ruby  
     | 
| 
      
 83 
     | 
    
         
            +
            * Install ruby 2.2.0 or later and bundler >= 1.12.0
         
     | 
| 
       84 
84 
     | 
    
         
             
            * Run `git clone git@github.com:bethesque/pact_broker.git && cd pact_broker/example`
         
     | 
| 
       85 
85 
     | 
    
         
             
            * Run `bundle`
         
     | 
| 
       86 
86 
     | 
    
         
             
            * Run `bundle exec rackup -p 8080`
         
     | 
| 
         @@ -99,9 +99,9 @@ the [Hosted Pact Broker](https://pact.dius.com.au/?utm_source=github&utm_campaig 
     | 
|
| 
       99 
99 
     | 
    
         | 
| 
       100 
100 
     | 
    
         
             
            You can use the [Pact Broker Docker container][docker] or [Terraform on AWS][terraform] or to roll your own...
         
     | 
| 
       101 
101 
     | 
    
         | 
| 
       102 
     | 
    
         
            -
            * Create a database using a product that is supported by the Sequel gem (listed on this page http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html). The migrations have been tested on MySQL and PostgreSQL - your  
     | 
| 
      
 102 
     | 
    
         
            +
            * Create a database using a product that is supported by the Sequel gem (listed on this page http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html). The migrations have been tested on MySQL and PostgreSQL - your mileage will vary on other databases.
         
     | 
| 
       103 
103 
     | 
    
         
             
            * __Note:__ It is recommended to use __PostgreSQL__ as it will support JSON search features that are planned in a future release, however MySQL the other [semi supported](https://github.com/bethesque/pact_broker/issues/33) database.
         
     | 
| 
       104 
     | 
    
         
            -
            * Install ruby  
     | 
| 
      
 104 
     | 
    
         
            +
            * Install ruby 2.2.0 or later and bundler >= 1.12.0
         
     | 
| 
       105 
105 
     | 
    
         
             
            * Copy the [example](/example) directory to the location you want to install the application.
         
     | 
| 
       106 
106 
     | 
    
         
             
            * Modify the config.ru and Gemfile as desired (eg. choose database driver gem, set your database credentials. Use the "pg" gem if using Postgres.)
         
     | 
| 
       107 
107 
     | 
    
         
             
            * Please ensure you use `encoding: 'utf8'` in your Sequel options to avoid encoding issues.
         
     | 
    
        data/example/config.ru
    CHANGED
    
    | 
         @@ -9,11 +9,13 @@ require 'pact_broker' 
     | 
|
| 
       9 
9 
     | 
    
         
             
            DATABASE_CREDENTIALS = {adapter: "sqlite", database: "pact_broker_database.sqlite3", :encoding => 'utf8'}
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            # For postgres:
         
     | 
| 
      
 12 
     | 
    
         
            +
            #
         
     | 
| 
       12 
13 
     | 
    
         
             
            # $ psql postgres
         
     | 
| 
       13 
14 
     | 
    
         
             
            # > create database pact_broker;
         
     | 
| 
       14 
15 
     | 
    
         
             
            # > CREATE USER pact_broker WITH PASSWORD 'pact_broker';
         
     | 
| 
       15 
16 
     | 
    
         
             
            # > GRANT ALL PRIVILEGES ON DATABASE pact_broker to pact_broker;
         
     | 
| 
       16 
     | 
    
         
            -
            # 
     | 
| 
      
 17 
     | 
    
         
            +
            #
         
     | 
| 
      
 18 
     | 
    
         
            +
            # DATABASE_CREDENTIALS = {adapter: "postgres", database: "pact_broker", username: 'pact_broker', password: 'pact_broker', :encoding => 'utf8'}
         
     | 
| 
       17 
19 
     | 
    
         | 
| 
       18 
20 
     | 
    
         
             
            # Have a look at the Sequel documentation to make decisions about things like connection pooling
         
     | 
| 
       19 
21 
     | 
    
         
             
            # and connection validation.
         
     | 
| 
         @@ -24,6 +26,7 @@ app = PactBroker::App.new do | config | 
     | 
|
| 
       24 
26 
     | 
    
         
             
              # config.auto_migrate_db = true
         
     | 
| 
       25 
27 
     | 
    
         
             
              # config.use_hal_browser = true
         
     | 
| 
       26 
28 
     | 
    
         
             
              config.database_connection = Sequel.connect(DATABASE_CREDENTIALS.merge(:logger => config.logger))
         
     | 
| 
      
 29 
     | 
    
         
            +
              config.database_connection.timezone = :utc
         
     | 
| 
       27 
30 
     | 
    
         
             
            end
         
     | 
| 
       28 
31 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
            run app
         
     | 
| 
      
 32 
     | 
    
         
            +
            run app
         
     | 
    
        data/lib/pact_broker/api.rb
    CHANGED
    
    | 
         @@ -37,8 +37,8 @@ module PactBroker 
     | 
|
| 
       37 
37 
     | 
    
         
             
                    # Todo, rename /version/ to /versions
         
     | 
| 
       38 
38 
     | 
    
         
             
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'latest'], Api::Resources::LatestPact
         
     | 
| 
       39 
39 
     | 
    
         
             
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'latest', :tag], Api::Resources::LatestPact
         
     | 
| 
       40 
     | 
    
         
            -
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'version', :consumer_version_number], Api::Resources::Pact 
     | 
| 
       41 
     | 
    
         
            -
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'versions', :consumer_version_number], Api::Resources::Pact
         
     | 
| 
      
 40 
     | 
    
         
            +
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'version', :consumer_version_number], Api::Resources::Pact
         
     | 
| 
      
 41 
     | 
    
         
            +
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'versions', :consumer_version_number], Api::Resources::Pact # Not the standard URL, but keep for backwards compatibility
         
     | 
| 
       42 
42 
     | 
    
         
             
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'versions'], Api::Resources::PactVersions
         
     | 
| 
       43 
43 
     | 
    
         
             
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'version', :consumer_version_number, 'previous-distinct'], Api::Resources::PreviousDistinctPactVersion
         
     | 
| 
       44 
44 
     | 
    
         
             
                    add ['pacts', 'provider', :provider_name, 'consumer', :consumer_name, 'version', :consumer_version_number, 'diff', 'previous-distinct'], Api::Resources::PactContentDiff
         
     | 
| 
         @@ -24,6 +24,11 @@ module PactBroker 
     | 
|
| 
       24 
24 
     | 
    
         
             
                            title: 'Index',
         
     | 
| 
       25 
25 
     | 
    
         
             
                            templated: false
         
     | 
| 
       26 
26 
     | 
    
         
             
                          },
         
     | 
| 
      
 27 
     | 
    
         
            +
                          'pb:publish-pact' => {
         
     | 
| 
      
 28 
     | 
    
         
            +
                            href: base_url + '/pacts/provider/{provider}/consumer/{consumer}/version/{consumerApplicationVersion}',
         
     | 
| 
      
 29 
     | 
    
         
            +
                            title: 'Publish a pact',
         
     | 
| 
      
 30 
     | 
    
         
            +
                            templated: true
         
     | 
| 
      
 31 
     | 
    
         
            +
                          },
         
     | 
| 
       27 
32 
     | 
    
         
             
                          'pb:latest-pact-versions' =>
         
     | 
| 
       28 
33 
     | 
    
         
             
                          {
         
     | 
| 
       29 
34 
     | 
    
         
             
                            href: base_url + '/pacts/latest',
         
     | 
| 
         @@ -0,0 +1,34 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Publish a pact
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Allowed methods: PUT
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            A pact is published to the broker using a combination of the provider name, the consumer name, and the consumer application version. The consumer application version will be used to determine which revision of the pact is the "latest" to return to the provider for verification, and will allow you to determine which versions of the consumer and provider are compatible with each other.
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            The pact generated by your passing consumer tests should be published to the broker during each CI build. Tools exist for this exist in most languages that have an implementation of pact.
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            Example:
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                PUT http://broker/provider/Bar/consumer/Foo/version/1.2.104
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                {
         
     | 
| 
      
 14 
     | 
    
         
            +
                  "consumer": {
         
     | 
| 
      
 15 
     | 
    
         
            +
                    "name": "Bar"
         
     | 
| 
      
 16 
     | 
    
         
            +
                  },
         
     | 
| 
      
 17 
     | 
    
         
            +
                  "provider": {
         
     | 
| 
      
 18 
     | 
    
         
            +
                    "name": "Foo"
         
     | 
| 
      
 19 
     | 
    
         
            +
                  },
         
     | 
| 
      
 20 
     | 
    
         
            +
                  "interactions": [
         
     | 
| 
      
 21 
     | 
    
         
            +
                    {
         
     | 
| 
      
 22 
     | 
    
         
            +
                      "description" : "a request for something",
         
     | 
| 
      
 23 
     | 
    
         
            +
                      "provider_state": "something exists",
         
     | 
| 
      
 24 
     | 
    
         
            +
                      "request": {
         
     | 
| 
      
 25 
     | 
    
         
            +
                        "method": "get",
         
     | 
| 
      
 26 
     | 
    
         
            +
                        "path" : "/something"
         
     | 
| 
      
 27 
     | 
    
         
            +
                      },
         
     | 
| 
      
 28 
     | 
    
         
            +
                      "response": {
         
     | 
| 
      
 29 
     | 
    
         
            +
                        "status": 200,
         
     | 
| 
      
 30 
     | 
    
         
            +
                        "body" : "something"
         
     | 
| 
      
 31 
     | 
    
         
            +
                      }
         
     | 
| 
      
 32 
     | 
    
         
            +
                    }
         
     | 
| 
      
 33 
     | 
    
         
            +
                  ]
         
     | 
| 
      
 34 
     | 
    
         
            +
                }
         
     | 
    
        data/lib/pact_broker/version.rb
    CHANGED
    
    
    
        data/pact_broker.gemspec
    CHANGED
    
    | 
         @@ -12,7 +12,7 @@ Gem::Specification.new do |gem| 
     | 
|
| 
       12 
12 
     | 
    
         
             
              gem.summary       = %q{See description}
         
     | 
| 
       13 
13 
     | 
    
         
             
              gem.homepage      = "https://github.com/bethesque/pact_broker"
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
              gem.required_ruby_version = '>= 2.0'
         
     | 
| 
      
 15 
     | 
    
         
            +
              gem.required_ruby_version = '>= 2.2.0'
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
              gem.files         = `git ls-files`.split($/)
         
     | 
| 
       18 
18 
     | 
    
         
             
              gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
         
     | 
    
        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: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.17.0
         
     | 
| 
       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: 2017-04- 
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2017-04-25 00:00:00.000000000 Z
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies:
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       16 
16 
     | 
    
         
             
              name: httparty
         
     | 
| 
         @@ -473,6 +473,7 @@ files: 
     | 
|
| 
       473 
473 
     | 
    
         
             
            - lib/pact_broker/doc/views/pact-webhooks.markdown
         
     | 
| 
       474 
474 
     | 
    
         
             
            - lib/pact_broker/doc/views/pacticipants.markdown
         
     | 
| 
       475 
475 
     | 
    
         
             
            - lib/pact_broker/doc/views/provider.markdown
         
     | 
| 
      
 476 
     | 
    
         
            +
            - lib/pact_broker/doc/views/publish-pact.markdown
         
     | 
| 
       476 
477 
     | 
    
         
             
            - lib/pact_broker/doc/views/self.markdown
         
     | 
| 
       477 
478 
     | 
    
         
             
            - lib/pact_broker/doc/views/tag-prod-version.markdown
         
     | 
| 
       478 
479 
     | 
    
         
             
            - lib/pact_broker/doc/views/tag-version.markdown
         
     | 
| 
         @@ -720,7 +721,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       720 
721 
     | 
    
         
             
              requirements:
         
     | 
| 
       721 
722 
     | 
    
         
             
              - - ">="
         
     | 
| 
       722 
723 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       723 
     | 
    
         
            -
                  version:  
     | 
| 
      
 724 
     | 
    
         
            +
                  version: 2.2.0
         
     | 
| 
       724 
725 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       725 
726 
     | 
    
         
             
              requirements:
         
     | 
| 
       726 
727 
     | 
    
         
             
              - - ">="
         
     |