pact_broker 2.77.0 → 2.80.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 +1 -0
- data/.github/workflows/test.yml +37 -11
- data/.rubocop.yml +37 -879
- data/.ruby-version +1 -1
- data/CHANGELOG.md +102 -0
- data/DEVELOPER_DOCUMENTATION.md +13 -0
- data/DEVELOPER_SETUP.md +6 -0
- data/Dockerfile +1 -1
- data/Gemfile +30 -28
- data/Rakefile +8 -6
- data/config.ru +11 -11
- data/config/boot.rb +6 -6
- data/db/ddl_statements/latest_pact_consumer_version_orders.rb +1 -1
- data/db/ddl_statements/latest_pact_publications_by_consumer_versions.rb +2 -2
- data/db/migrations/000001_create_pacticipant_table.rb +1 -1
- data/db/migrations/000002_create_versions_table.rb +1 -1
- data/db/migrations/000003_create_pacts_table.rb +1 -1
- data/db/migrations/000004_create_tags_table.rb +1 -1
- data/db/migrations/000007_increase_json_content_length.rb +1 -1
- data/db/migrations/000012_create_webhooks_table.rb +6 -6
- data/db/migrations/000015_create_pact_version_content.rb +4 -4
- data/db/migrations/000016_add_pact_content_foreign_key_to_pacts.rb +3 -3
- data/db/migrations/000017_migrate_json_content_to_pact_version_content_table.rb +2 -2
- data/db/migrations/000018_drop_json_content_column_from_pacts.rb +2 -2
- data/db/migrations/000019_make_pact_version_content_sha_not_nullable.rb +2 -2
- data/db/migrations/000020_add_pact_version_content_sha_to_all_pacts_view.rb +2 -2
- data/db/migrations/000021_recreate_latest_pacts_view.rb +2 -2
- data/db/migrations/000023_create_pact_versions_table.rb +3 -3
- data/db/migrations/000026_create_pact_publications.rb +3 -3
- data/db/migrations/000031_create_verifications.rb +1 -1
- data/db/migrations/000033_create_config_table.rb +3 -3
- data/db/migrations/000034_create_index_on_consumer_version_order.rb +3 -3
- data/db/migrations/000035_create_index_on_names.rb +2 -2
- data/db/migrations/000036_create_webhook_execution.rb +2 -2
- data/db/migrations/000037_create_labels_table.rb +1 -1
- data/db/migrations/000038_create_triggered_webhooks_table.rb +3 -3
- data/db/migrations/000041_migrate_execution_data.rb +3 -3
- data/db/migrations/000043_add_provider_version_to_verification.rb +1 -1
- data/db/migrations/000044_populate_verifications_provider_version_id.rb +9 -9
- data/db/migrations/20171112_add_test_results.rb +1 -1
- data/db/migrations/20171117_create_webhook_events.rb +3 -3
- data/db/migrations/20171118_create_webhook_events.rb +2 -2
- data/db/migrations/20180108_create_certificates_table.rb +3 -3
- data/db/migrations/20180109_migrate_trigger_type.rb +2 -2
- data/db/migrations/20180119_update_latest_triggered_webhooks.rb +1 -1
- data/db/migrations/20180123_create_tags_with_latest_flag.rb +1 -1
- data/db/migrations/20180130_create_materialized_matrix.rb +4 -4
- data/db/migrations/20180131_create_materialized_latest_matrix.rb +4 -4
- data/db/migrations/20180202_create_materialized_head_matrix.rb +4 -4
- data/db/migrations/20180205_drop_materialized_latest_matrix.rb +4 -4
- data/db/migrations/20180210_fix_latest_matrix_for_cv_and_pv_again.rb +2 -2
- data/db/migrations/20180311_optimise_head_matrix.rb +2 -3
- data/db/migrations/20180523_create_latest_verifications_for_consumer_version_tags.rb +1 -1
- data/db/migrations/20180524_create_latest_verifications_for_consumer_and_provider.rb +1 -1
- data/db/migrations/20180613_migrate_pacticipant_ids_for_verifications.rb +1 -1
- data/db/migrations/20180614_update_latest_verification_ids_for_consumer_and_provider.rb +1 -1
- data/db/migrations/20180616_migrate_consumer_ids_for_pact_publications.rb +1 -1
- data/db/migrations/20180720_create_latest_pact_publication_ids.rb +1 -1
- data/db/migrations/20180722_recreate_views.rb +1 -1
- data/db/migrations/20180723_create_latest_verification_ids.rb +6 -6
- data/db/migrations/20180729_create_latest_verification_ids_for_provider_versions.rb +1 -1
- data/db/migrations/20190509_create_version_sequence.rb +1 -1
- data/db/migrations/20190510_set_version_sequence.rb +1 -1
- data/db/migrations/20190524_set_webhooks_enabled.rb +1 -1
- data/db/migrations/20190603_migrate_webhook_headers.rb +1 -1
- data/db/migrations/20191025_optimise_latest_verification_ids_for_cv_tags.rb +1 -1
- data/db/migrations/20191028_optimise_latest_tagged_pact_cv_orders.rb +1 -1
- data/db/migrations/20191030_optimise_latest_pact_publications_by_consumer_versions_.rb +1 -1
- data/db/migrations/20191031_optimise_latest_verification_ids_for_consumer_version_tags.rb +1 -1
- data/db/migrations/20191101_create_head_pact_tags.rb +1 -1
- data/db/migrations/20200930_update_latest_triggered_webhooks.rb +2 -2
- data/db/migrations/20201023_create_verification_number_sequence.rb +1 -1
- data/db/migrations/20201024_create_version_order_sequence.rb +1 -1
- data/db/migrations/20201026_update_latest_verification_ids_for_consumer_and_provider.rb +2 -2
- data/db/migrations/20210115_add_webhook_foreign_key_indexes.rb +1 -1
- data/db/migrations/20210116_add_context_to_triggered_webhook.rb +1 -1
- data/db/migrations/20210202_add_created_at_to_head_pact_tags.rb +2 -2
- data/db/migrations/20210205_add_pacticipant_id_to_tag.rb +1 -1
- data/db/migrations/20210206_add_index_to_tags_and_versions.rb +1 -1
- data/db/migrations/20210207_optimise_latest_verification_ids_for_consumer_version_tags.rb +1 -1
- data/db/migrations/20210208_optimise_latest_tagged_pact_cv_orders.rb +1 -1
- data/db/migrations/20210210_create_environments_table.rb +16 -0
- data/db/migrations/20210216_create_deployed_versions_table.rb +18 -0
- data/db/migrations/20210226_set_deployment_columns_not_null.rb +31 -0
- data/db/migrations/20210301_add_pacticipant_columns.rb +10 -0
- data/db/migrations/20210413_create_currently_deployed_version_ids_table.rb +13 -0
- data/db/migrations/20210415_add_target_column_to_deployed_version.rb +21 -0
- data/db/migrations/20210419_create_released_versions_table.rb +17 -0
- data/db/migrations/20210529_add_main_branch_to_pacticipant.rb +18 -0
- data/db/migrations/20210608_add_uuid_to_webhook.rb +14 -0
- data/db/migrations/20210609_set_webhook_uuid.rb +11 -0
- data/db/migrations/20210702_drop_unused_columns_from_deployed_versions.rb +15 -0
- data/db/migrations/migration_helper.rb +3 -3
- data/db/test/backwards_compatibility/Gemfile +11 -11
- data/db/test/backwards_compatibility/Rakefile +17 -17
- data/db/test/backwards_compatibility/config.ru +6 -6
- data/db/test/backwards_compatibility/spec/publish_pact_spec.rb +13 -13
- data/db/test/backwards_compatibility/spec/spec_helper.rb +3 -3
- data/db/test/backwards_compatibility/spec/support/fixture_helpers.rb +2 -2
- data/db/test/backwards_compatibility/spec/support/request_helpers.rb +3 -4
- data/db/test/change_migration_strategy/Rakefile +6 -6
- data/db/test/change_migration_strategy/before/Gemfile +1 -1
- data/docker-compose-dev-postgres.yml +9 -1
- data/example/Gemfile +4 -4
- data/example/basic_auth/Gemfile +1 -1
- data/example/basic_auth/config.ru +7 -7
- data/example/config.ru +7 -7
- data/issue-reproduction/Dockerfile-pact-broker +1 -1
- data/lib/db.rb +18 -12
- data/lib/pact/doc/generator.rb +3 -3
- data/lib/pact/doc/interaction_view_model.rb +13 -13
- data/lib/pact/doc/markdown/consumer_contract_renderer.rb +4 -4
- data/lib/pact/doc/markdown/generator.rb +6 -6
- data/lib/pact/doc/markdown/interaction_renderer.rb +4 -4
- data/lib/pact/doc/sort_interactions.rb +0 -1
- data/lib/pact_broker.rb +4 -4
- data/lib/pact_broker/api.rb +102 -78
- data/lib/pact_broker/api/contracts/base_contract.rb +2 -2
- data/lib/pact_broker/api/contracts/dry_validation_predicates.rb +18 -1
- data/lib/pact_broker/api/contracts/dry_validation_workarounds.rb +3 -2
- data/lib/pact_broker/api/contracts/environment_schema.rb +49 -0
- data/lib/pact_broker/api/contracts/pacticipant_name_contract.rb +1 -1
- data/lib/pact_broker/api/contracts/pacticipant_name_validation.rb +2 -2
- data/lib/pact_broker/api/contracts/pacticipant_schema.rb +34 -0
- data/lib/pact_broker/api/contracts/publish_contracts_schema.rb +104 -0
- data/lib/pact_broker/api/contracts/put_pact_params_contract.rb +1 -1
- data/lib/pact_broker/api/contracts/request_validations.rb +2 -2
- data/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema.rb +70 -15
- data/lib/pact_broker/api/contracts/verifiable_pacts_query_schema.rb +3 -3
- data/lib/pact_broker/api/contracts/verification_contract.rb +2 -2
- data/lib/pact_broker/api/contracts/webhook_contract.rb +10 -7
- data/lib/pact_broker/api/decorators/base_decorator.rb +20 -5
- data/lib/pact_broker/api/decorators/basic_pacticipant_decorator.rb +1 -1
- data/lib/pact_broker/api/decorators/configuration.rb +2 -2
- data/lib/pact_broker/api/decorators/dashboard_decorator.rb +8 -8
- data/lib/pact_broker/api/decorators/dashboard_text_decorator.rb +3 -3
- data/lib/pact_broker/api/decorators/decorator_context.rb +1 -1
- data/lib/pact_broker/api/decorators/decorator_context_creator.rb +1 -1
- data/lib/pact_broker/api/decorators/deployed_version_decorator.rb +26 -0
- data/lib/pact_broker/api/decorators/deployed_versions_decorator.rb +20 -0
- data/lib/pact_broker/api/decorators/embedded_label_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/embedded_pacticipant_decorator.rb +17 -0
- data/lib/pact_broker/api/decorators/embedded_tag_decorator.rb +4 -4
- data/lib/pact_broker/api/decorators/embedded_version_decorator.rb +7 -2
- data/lib/pact_broker/api/decorators/environment_decorator.rb +51 -0
- data/lib/pact_broker/api/decorators/environments_decorator.rb +31 -0
- data/lib/pact_broker/api/decorators/extended_pact_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/extended_verification_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/integration_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/integrations_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/label_decorator.rb +5 -5
- data/lib/pact_broker/api/decorators/latest_pact_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/matrix_decorator.rb +26 -11
- data/lib/pact_broker/api/decorators/matrix_text_decorator.rb +5 -5
- data/lib/pact_broker/api/decorators/pact_collection_decorator.rb +6 -6
- data/lib/pact_broker/api/decorators/pact_decorator.rb +5 -5
- data/lib/pact_broker/api/decorators/pact_details_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/pact_pacticipant_decorator.rb +3 -3
- data/lib/pact_broker/api/decorators/pact_version_decorator.rb +3 -3
- data/lib/pact_broker/api/decorators/pact_versions_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/pact_webhooks_status_decorator.rb +6 -6
- data/lib/pact_broker/api/decorators/pacticipant_collection_decorator.rb +8 -8
- data/lib/pact_broker/api/decorators/pacticipant_decorator.rb +29 -13
- data/lib/pact_broker/api/decorators/pagination_links.rb +2 -2
- data/lib/pact_broker/api/decorators/provider_pacts_decorator.rb +2 -3
- data/lib/pact_broker/api/decorators/publish_contract_decorator.rb +19 -0
- data/lib/pact_broker/api/decorators/publish_contracts_decorator.rb +21 -0
- data/lib/pact_broker/api/decorators/publish_contracts_results_decorator.rb +55 -0
- data/lib/pact_broker/api/decorators/reason_decorator.rb +30 -14
- data/lib/pact_broker/api/decorators/relationships_csv_decorator.rb +3 -1
- data/lib/pact_broker/api/decorators/released_version_decorator.rb +25 -0
- data/lib/pact_broker/api/decorators/released_versions_decorator.rb +20 -0
- data/lib/pact_broker/api/decorators/representable_pact.rb +1 -1
- data/lib/pact_broker/api/decorators/tag_decorator.rb +6 -6
- data/lib/pact_broker/api/decorators/tagged_pact_versions_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/timestamps.rb +2 -2
- data/lib/pact_broker/api/decorators/triggered_webhook_decorator.rb +8 -6
- data/lib/pact_broker/api/decorators/triggered_webhooks_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/verifiable_pact_decorator.rb +4 -4
- data/lib/pact_broker/api/decorators/verifiable_pacts_decorator.rb +3 -3
- data/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator.rb +16 -9
- data/lib/pact_broker/api/decorators/verification_decorator.rb +6 -6
- data/lib/pact_broker/api/decorators/verification_summary_decorator.rb +4 -4
- data/lib/pact_broker/api/decorators/version_decorator.rb +38 -7
- data/lib/pact_broker/api/decorators/versions_decorator.rb +5 -5
- data/lib/pact_broker/api/decorators/webhook_decorator.rb +10 -8
- data/lib/pact_broker/api/decorators/webhook_execution_result_decorator.rb +7 -7
- data/lib/pact_broker/api/decorators/webhook_request_template_decorator.rb +1 -1
- data/lib/pact_broker/api/decorators/webhooks_decorator.rb +3 -3
- data/lib/pact_broker/api/pact_broker_urls.rb +125 -69
- data/lib/pact_broker/api/paths.rb +2 -2
- data/lib/pact_broker/api/renderers/html_pact_renderer.rb +16 -17
- data/lib/pact_broker/api/resources.rb +1 -1
- data/lib/pact_broker/api/resources/all_webhooks.rb +14 -6
- data/lib/pact_broker/api/resources/authentication.rb +1 -1
- data/lib/pact_broker/api/resources/authorization.rb +37 -0
- data/lib/pact_broker/api/resources/badge.rb +8 -8
- data/lib/pact_broker/api/resources/base_resource.rb +1 -1
- data/lib/pact_broker/api/resources/can_i_deploy.rb +13 -13
- data/lib/pact_broker/api/resources/can_i_deploy_badge.rb +7 -7
- data/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb +23 -18
- data/lib/pact_broker/api/resources/clean.rb +3 -3
- data/lib/pact_broker/api/resources/currently_deployed_versions_for_environment.rb +75 -0
- data/lib/pact_broker/api/resources/currently_supported_versions_for_environment.rb +70 -0
- data/lib/pact_broker/api/resources/dashboard.rb +3 -3
- data/lib/pact_broker/api/resources/default_base_resource.rb +47 -20
- data/lib/pact_broker/api/resources/deployed_version.rb +94 -0
- data/lib/pact_broker/api/resources/deployed_versions_for_version_and_environment.rb +89 -0
- data/lib/pact_broker/api/resources/environment.rb +76 -0
- data/lib/pact_broker/api/resources/environments.rb +79 -0
- data/lib/pact_broker/api/resources/error_handler.rb +4 -4
- data/lib/pact_broker/api/resources/error_response_body_generator.rb +3 -3
- data/lib/pact_broker/api/resources/error_test.rb +2 -2
- data/lib/pact_broker/api/resources/group.rb +2 -2
- data/lib/pact_broker/api/resources/index.rb +91 -70
- data/lib/pact_broker/api/resources/integration.rb +1 -1
- data/lib/pact_broker/api/resources/integrations.rb +3 -3
- data/lib/pact_broker/api/resources/label.rb +2 -2
- data/lib/pact_broker/api/resources/latest_pact.rb +5 -5
- data/lib/pact_broker/api/resources/latest_pacts.rb +1 -1
- data/lib/pact_broker/api/resources/latest_provider_pacts.rb +3 -3
- data/lib/pact_broker/api/resources/latest_verification_for_latest_pact.rb +5 -1
- data/lib/pact_broker/api/resources/latest_verification_for_pact.rb +5 -1
- data/lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb +5 -5
- data/lib/pact_broker/api/resources/latest_version.rb +1 -1
- data/lib/pact_broker/api/resources/matrix.rb +18 -13
- data/lib/pact_broker/api/resources/matrix_badge.rb +1 -1
- data/lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb +2 -2
- data/lib/pact_broker/api/resources/metadata_resource_methods.rb +2 -2
- data/lib/pact_broker/api/resources/metrics.rb +1 -1
- data/lib/pact_broker/api/resources/pact.rb +17 -27
- data/lib/pact_broker/api/resources/pact_content_diff.rb +3 -3
- data/lib/pact_broker/api/resources/pact_triggered_webhooks.rb +7 -3
- data/lib/pact_broker/api/resources/pact_version.rb +2 -2
- data/lib/pact_broker/api/resources/pact_versions.rb +3 -3
- data/lib/pact_broker/api/resources/pact_webhooks.rb +7 -8
- data/lib/pact_broker/api/resources/pact_webhooks_status.rb +2 -2
- data/lib/pact_broker/api/resources/pacticipant.rb +51 -15
- data/lib/pact_broker/api/resources/pacticipant_resource_methods.rb +1 -1
- data/lib/pact_broker/api/resources/{webhooks.rb → pacticipant_webhooks.rb} +12 -8
- data/lib/pact_broker/api/resources/pacticipants.rb +13 -8
- data/lib/pact_broker/api/resources/pacticipants_for_label.rb +2 -2
- data/lib/pact_broker/api/resources/previous_distinct_pact_version.rb +4 -4
- data/lib/pact_broker/api/resources/provider_pacts.rb +3 -3
- data/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +10 -6
- data/lib/pact_broker/api/resources/publish_contracts.rb +81 -0
- data/lib/pact_broker/api/resources/relationships.rb +2 -2
- data/lib/pact_broker/api/resources/released_version.rb +84 -0
- data/lib/pact_broker/api/resources/released_versions_for_version_and_environment.rb +94 -0
- data/lib/pact_broker/api/resources/tag.rb +1 -1
- data/lib/pact_broker/api/resources/tagged_pact_versions.rb +4 -4
- data/lib/pact_broker/api/resources/triggered_webhook_logs.rb +16 -8
- data/lib/pact_broker/api/resources/verification.rb +17 -7
- data/lib/pact_broker/api/resources/verification_triggered_webhooks.rb +7 -3
- data/lib/pact_broker/api/resources/verifications.rb +13 -18
- data/lib/pact_broker/api/resources/version.rb +49 -11
- data/lib/pact_broker/api/resources/versions.rb +6 -6
- data/lib/pact_broker/api/resources/webhook.rb +17 -9
- data/lib/pact_broker/api/resources/webhook_execution.rb +18 -14
- data/lib/pact_broker/api/resources/webhook_execution_methods.rb +31 -0
- data/lib/pact_broker/app.rb +37 -35
- data/lib/pact_broker/application_context.rb +5 -5
- data/lib/pact_broker/badges/service.rb +22 -22
- data/lib/pact_broker/build_http_options.rb +2 -2
- data/lib/pact_broker/certificates/service.rb +4 -4
- data/lib/pact_broker/config/load.rb +4 -4
- data/lib/pact_broker/config/repository.rb +1 -1
- data/lib/pact_broker/config/save.rb +4 -4
- data/lib/pact_broker/config/setting.rb +28 -24
- data/lib/pact_broker/config/space_delimited_integer_list.rb +3 -3
- data/lib/pact_broker/config/space_delimited_string_list.rb +3 -3
- data/lib/pact_broker/configuration.rb +27 -20
- data/lib/pact_broker/constants.rb +2 -2
- data/lib/pact_broker/contracts/contract_to_publish.rb +19 -0
- data/lib/pact_broker/contracts/contracts_publication_results.rb +14 -0
- data/lib/pact_broker/contracts/contracts_to_publish.rb +11 -0
- data/lib/pact_broker/contracts/notice.rb +21 -0
- data/lib/pact_broker/contracts/service.rb +264 -0
- data/lib/pact_broker/date_helper.rb +48 -46
- data/lib/pact_broker/db.rb +11 -7
- data/lib/pact_broker/db/clean.rb +4 -8
- data/lib/pact_broker/db/clean_incremental.rb +8 -6
- data/lib/pact_broker/db/data_migrations/delete_deprecated_webhook_executions.rb +1 -1
- data/lib/pact_broker/db/data_migrations/migrate_webhook_headers.rb +1 -1
- data/lib/pact_broker/db/data_migrations/set_consumer_ids_for_pact_publications.rb +1 -1
- data/lib/pact_broker/db/data_migrations/set_created_at_for_latest_pact_publications.rb +1 -1
- data/lib/pact_broker/db/data_migrations/set_created_at_for_latest_verifications.rb +1 -1
- data/lib/pact_broker/db/data_migrations/set_extra_columns_for_tags.rb +3 -3
- data/lib/pact_broker/db/data_migrations/set_latest_version_sequence_value.rb +1 -1
- data/lib/pact_broker/db/data_migrations/set_pacticipant_display_name.rb +23 -0
- data/lib/pact_broker/db/data_migrations/set_pacticipant_ids_for_verifications.rb +1 -1
- data/lib/pact_broker/db/data_migrations/set_pacticipant_main_branch.rb +53 -0
- data/lib/pact_broker/db/data_migrations/set_webhook_uuid.rb +24 -0
- data/lib/pact_broker/db/data_migrations/set_webhooks_enabled.rb +1 -1
- data/lib/pact_broker/db/delete_overwritten_data.rb +7 -7
- data/lib/pact_broker/db/log_quietener.rb +1 -1
- data/lib/pact_broker/db/migrate.rb +4 -4
- data/lib/pact_broker/db/migrate_data.rb +4 -1
- data/lib/pact_broker/db/models.rb +17 -12
- data/lib/pact_broker/db/seed_example_data.rb +9 -4
- data/lib/pact_broker/db/validate_encoding.rb +4 -4
- data/lib/pact_broker/db/version.rb +1 -1
- data/lib/pact_broker/deployments/currently_deployed_version_id.rb +30 -0
- data/lib/pact_broker/deployments/deployed_version.rb +115 -0
- data/lib/pact_broker/deployments/deployed_version_service.rb +85 -0
- data/lib/pact_broker/deployments/environment.rb +49 -0
- data/lib/pact_broker/deployments/environment_service.rb +52 -0
- data/lib/pact_broker/deployments/released_version.rb +83 -0
- data/lib/pact_broker/deployments/released_version_service.rb +47 -0
- data/lib/pact_broker/diagnostic/app.rb +8 -8
- data/lib/pact_broker/diagnostic/resources/base_resource.rb +2 -2
- data/lib/pact_broker/diagnostic/resources/dependencies.rb +3 -3
- data/lib/pact_broker/diagnostic/resources/heartbeat.rb +1 -1
- data/lib/pact_broker/doc/controllers/app.rb +10 -10
- data/lib/pact_broker/doc/views/can-i-deploy.markdown +4 -2
- data/lib/pact_broker/doc/views/index/environment.markdown +37 -0
- data/lib/pact_broker/doc/views/index/environments.markdown +53 -0
- data/lib/pact_broker/doc/views/index/latest-pact-versions.markdown +1 -1
- data/lib/pact_broker/doc/views/index/pacticipant-version-tag.markdown +1 -0
- data/lib/pact_broker/doc/views/index/pacticipants.markdown +25 -3
- data/lib/pact_broker/doc/views/index/publish-contracts.markdown +120 -0
- data/lib/pact_broker/doc/views/provider-pacts-for-verification.markdown +22 -11
- data/lib/pact_broker/doc/views/webhooks.markdown +5 -3
- data/lib/pact_broker/domain.rb +6 -6
- data/lib/pact_broker/domain/index_item.rb +27 -8
- data/lib/pact_broker/domain/label.rb +1 -2
- data/lib/pact_broker/domain/order_versions.rb +2 -2
- data/lib/pact_broker/domain/pact.rb +14 -7
- data/lib/pact_broker/domain/pacticipant.rb +27 -18
- data/lib/pact_broker/domain/tag.rb +5 -3
- data/lib/pact_broker/domain/verification.rb +8 -8
- data/lib/pact_broker/domain/version.rb +55 -10
- data/lib/pact_broker/domain/webhook.rb +14 -15
- data/lib/pact_broker/domain/webhook_request.rb +14 -18
- data/lib/pact_broker/errors.rb +7 -7
- data/lib/pact_broker/errors/error_logger.rb +3 -3
- data/lib/pact_broker/events/event.rb +5 -0
- data/lib/pact_broker/events/publisher.rb +9 -0
- data/lib/pact_broker/events/subscriber.rb +42 -0
- data/lib/pact_broker/feature_toggle.rb +2 -2
- data/lib/pact_broker/groups/service.rb +2 -2
- data/lib/pact_broker/hash_refinements.rb +12 -12
- data/lib/pact_broker/index/service.rb +69 -36
- data/lib/pact_broker/integrations/integration.rb +5 -5
- data/lib/pact_broker/integrations/service.rb +11 -7
- data/lib/pact_broker/labels/repository.rb +2 -2
- data/lib/pact_broker/labels/service.rb +1 -1
- data/lib/pact_broker/locale/en.yml +54 -14
- data/lib/pact_broker/logging.rb +3 -3
- data/lib/pact_broker/logging/default_formatter.rb +3 -3
- data/lib/pact_broker/matrix/aggregated_row.rb +4 -4
- data/lib/pact_broker/matrix/can_i_deploy_query_schema.rb +17 -2
- data/lib/pact_broker/matrix/deployment_status_summary.rb +78 -38
- data/lib/pact_broker/matrix/every_row.rb +2 -2
- data/lib/pact_broker/matrix/head_row.rb +2 -2
- data/lib/pact_broker/matrix/integration.rb +6 -6
- data/lib/pact_broker/matrix/parse_can_i_deploy_query.rb +19 -3
- data/lib/pact_broker/matrix/parse_query.rb +47 -24
- data/lib/pact_broker/matrix/query_builder.rb +10 -10
- data/lib/pact_broker/matrix/query_results.rb +9 -4
- data/lib/pact_broker/matrix/query_results_with_deployment_status_summary.rb +3 -3
- data/lib/pact_broker/matrix/quick_row.rb +32 -34
- data/lib/pact_broker/matrix/reason.rb +88 -1
- data/lib/pact_broker/matrix/repository.rb +137 -66
- data/lib/pact_broker/matrix/resolved_selector.rb +82 -7
- data/lib/pact_broker/matrix/row.rb +6 -6
- data/lib/pact_broker/matrix/service.rb +44 -14
- data/lib/pact_broker/matrix/unresolved_selector.rb +22 -2
- data/lib/pact_broker/messages.rb +17 -5
- data/lib/pact_broker/metrics/service.rb +16 -15
- data/lib/pact_broker/pacticipants/find_potential_duplicate_pacticipant_names.rb +5 -5
- data/lib/pact_broker/pacticipants/generate_display_name.rb +27 -0
- data/lib/pact_broker/pacticipants/repository.rb +34 -16
- data/lib/pact_broker/pacticipants/service.rb +19 -19
- data/lib/pact_broker/pacts/all_pact_publications.rb +6 -6
- data/lib/pact_broker/pacts/build_verifiable_pact_notices.rb +8 -8
- data/lib/pact_broker/pacts/content.rb +23 -21
- data/lib/pact_broker/pacts/create_formatted_diff.rb +3 -3
- data/lib/pact_broker/pacts/diff.rb +8 -8
- data/lib/pact_broker/pacts/eager_loaders.rb +1 -1
- data/lib/pact_broker/pacts/generate_interaction_sha.rb +2 -2
- data/lib/pact_broker/pacts/generate_sha.rb +10 -10
- data/lib/pact_broker/pacts/head_pact.rb +1 -1
- data/lib/pact_broker/pacts/latest_pact_publication_id_for_consumer_version.rb +2 -2
- data/lib/pact_broker/pacts/latest_pact_publications.rb +2 -2
- data/lib/pact_broker/pacts/latest_pact_publications_by_consumer_version.rb +1 -1
- data/lib/pact_broker/pacts/latest_tagged_pact_publications.rb +2 -2
- data/lib/pact_broker/pacts/lazy_loaders.rb +2 -2
- data/lib/pact_broker/pacts/merger.rb +2 -2
- data/lib/pact_broker/pacts/order_hash_keys.rb +1 -1
- data/lib/pact_broker/pacts/pact_params.rb +7 -7
- data/lib/pact_broker/pacts/pact_publication.rb +19 -13
- data/lib/pact_broker/pacts/pact_publication_dataset_module.rb +7 -49
- data/lib/pact_broker/pacts/pact_publication_selector_dataset_module.rb +70 -0
- data/lib/pact_broker/pacts/pact_publication_wip_dataset_module.rb +106 -0
- data/lib/pact_broker/pacts/pact_version.rb +46 -14
- data/lib/pact_broker/pacts/pacts_for_verification_repository.rb +51 -47
- data/lib/pact_broker/pacts/parse.rb +1 -1
- data/lib/pact_broker/pacts/placeholder_pact.rb +1 -1
- data/lib/pact_broker/pacts/repository.rb +27 -23
- data/lib/pact_broker/pacts/selected_pact.rb +5 -1
- data/lib/pact_broker/pacts/selector.rb +124 -6
- data/lib/pact_broker/pacts/selectors.rb +5 -1
- data/lib/pact_broker/pacts/service.rb +102 -32
- data/lib/pact_broker/pacts/sort_content.rb +14 -9
- data/lib/pact_broker/pacts/squash_pacts_for_verification.rb +0 -1
- data/lib/pact_broker/pacts/verifiable_pact.rb +5 -3
- data/lib/pact_broker/pacts/verifiable_pact_messages.rb +82 -37
- data/lib/pact_broker/policies.rb +1 -1
- data/lib/pact_broker/project_root.rb +2 -2
- data/lib/pact_broker/relationships/groupify.rb +1 -1
- data/lib/pact_broker/repositories.rb +9 -9
- data/lib/pact_broker/services.rb +53 -15
- data/lib/pact_broker/string_refinements.rb +10 -4
- data/lib/pact_broker/tags/eager_loaders.rb +2 -2
- data/lib/pact_broker/tags/head_pact_tags.rb +2 -2
- data/lib/pact_broker/tags/repository.rb +2 -2
- data/lib/pact_broker/tags/service.rb +1 -1
- data/lib/pact_broker/tags/tag_with_latest_flag.rb +2 -2
- data/lib/pact_broker/tasks.rb +5 -5
- data/lib/pact_broker/tasks/clean_task.rb +12 -12
- data/lib/pact_broker/tasks/data_migration_task.rb +4 -4
- data/lib/pact_broker/tasks/delete_overwritten_data_task.rb +8 -8
- data/lib/pact_broker/tasks/migration_task.rb +5 -5
- data/lib/pact_broker/tasks/version_task.rb +3 -3
- data/lib/pact_broker/test/http_test_data_builder.rb +72 -31
- data/lib/pact_broker/test/test_data_builder.rb +119 -52
- data/lib/pact_broker/ui.rb +3 -3
- data/lib/pact_broker/ui/app.rb +9 -9
- data/lib/pact_broker/ui/controllers/base_controller.rb +6 -6
- data/lib/pact_broker/ui/controllers/can_i_deploy.rb +9 -9
- data/lib/pact_broker/ui/controllers/clusters.rb +5 -5
- data/lib/pact_broker/ui/controllers/error_test.rb +3 -3
- data/lib/pact_broker/ui/controllers/groups.rb +4 -4
- data/lib/pact_broker/ui/controllers/index.rb +28 -15
- data/lib/pact_broker/ui/controllers/matrix.rb +11 -11
- data/lib/pact_broker/ui/controllers/pacts.rb +1 -1
- data/lib/pact_broker/ui/helpers/matrix_helper.rb +12 -8
- data/lib/pact_broker/ui/helpers/url_helper.rb +3 -3
- data/lib/pact_broker/ui/view_models/index_item.rb +29 -15
- data/lib/pact_broker/ui/view_models/index_items.rb +2 -2
- data/lib/pact_broker/ui/view_models/matrix_deployed_version.rb +37 -0
- data/lib/pact_broker/ui/view_models/matrix_line.rb +45 -11
- data/lib/pact_broker/ui/view_models/matrix_lines.rb +1 -1
- data/lib/pact_broker/ui/view_models/matrix_released_version.rb +37 -0
- data/lib/pact_broker/ui/view_models/matrix_tag.rb +3 -3
- data/lib/pact_broker/ui/views/index/show-with-tags.haml +60 -14
- data/lib/pact_broker/ui/views/index/show.haml +23 -2
- data/lib/pact_broker/ui/views/matrix/show.haml +33 -9
- data/lib/pact_broker/verifications/latest_verification_for_consumer_and_provider.rb +1 -1
- data/lib/pact_broker/verifications/latest_verification_for_consumer_version_tag.rb +1 -1
- data/lib/pact_broker/verifications/latest_verification_for_pact_version.rb +1 -1
- data/lib/pact_broker/verifications/latest_verification_id_for_pact_version_and_provider_version.rb +1 -1
- data/lib/pact_broker/verifications/repository.rb +9 -5
- data/lib/pact_broker/verifications/sequence.rb +2 -2
- data/lib/pact_broker/verifications/service.rb +33 -17
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/versions/eager_loaders.rb +6 -6
- data/lib/pact_broker/versions/latest_version.rb +1 -1
- data/lib/pact_broker/versions/parse_semantic_version.rb +2 -2
- data/lib/pact_broker/versions/repository.rb +47 -15
- data/lib/pact_broker/versions/sequence.rb +1 -1
- data/lib/pact_broker/versions/service.rb +25 -2
- data/lib/pact_broker/webhooks/check_host_whitelist.rb +1 -1
- data/lib/pact_broker/webhooks/event_listener.rb +86 -0
- data/lib/pact_broker/webhooks/execution.rb +3 -3
- data/lib/pact_broker/webhooks/execution_configuration.rb +1 -1
- data/lib/pact_broker/webhooks/execution_configuration_creator.rb +2 -2
- data/lib/pact_broker/webhooks/http_request_with_redacted_headers.rb +1 -1
- data/lib/pact_broker/webhooks/http_response_with_utf_8_safe_body.rb +1 -1
- data/lib/pact_broker/webhooks/job.rb +5 -5
- data/lib/pact_broker/webhooks/latest_triggered_webhook.rb +17 -2
- data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +57 -15
- data/lib/pact_broker/webhooks/redact_logs.rb +3 -3
- data/lib/pact_broker/webhooks/render.rb +4 -5
- data/lib/pact_broker/webhooks/repository.rb +69 -75
- data/lib/pact_broker/webhooks/service.rb +52 -134
- data/lib/pact_broker/webhooks/status.rb +3 -1
- data/lib/pact_broker/webhooks/trigger_service.rb +75 -70
- data/lib/pact_broker/webhooks/triggered_webhook.rb +15 -12
- data/lib/pact_broker/webhooks/webhook.rb +43 -6
- data/lib/pact_broker/webhooks/webhook_event.rb +7 -7
- data/lib/pact_broker/webhooks/webhook_execution_result.rb +8 -3
- data/lib/pact_broker/webhooks/webhook_request_logger.rb +9 -7
- data/lib/pact_broker/webhooks/webhook_request_template.rb +41 -6
- data/lib/rack/hal_browser.rb +1 -1
- data/lib/rack/hal_browser/redirect.rb +9 -9
- data/lib/rack/pact_broker/add_pact_broker_version_header.rb +2 -2
- data/lib/rack/pact_broker/convert_404_to_hal.rb +2 -2
- data/lib/rack/pact_broker/convert_file_extension_to_accept_header.rb +1 -1
- data/lib/rack/pact_broker/database_transaction.rb +3 -3
- data/lib/rack/pact_broker/invalid_uri_protection.rb +5 -5
- data/lib/rack/pact_broker/no_auth.rb +1 -1
- data/lib/rack/pact_broker/request_target.rb +8 -8
- data/lib/rack/pact_broker/reset_thread_data.rb +1 -1
- data/lib/rack/pact_broker/set_base_url.rb +35 -5
- data/lib/rack/pact_broker/ui_authentication.rb +3 -3
- data/lib/rack/pact_broker/ui_request_filter.rb +1 -1
- data/lib/sequel/extensions/statement_timeout.rb +9 -9
- data/pact_broker.gemspec +26 -25
- data/public/javascripts/clipboard.js +8 -2
- data/public/javascripts/matrix.js +11 -6
- data/public/stylesheets/index.css +14 -1
- data/regression/can_i_deploy_spec.rb +1 -1
- data/regression/index_spec.rb +3 -3
- data/regression/regression_helper.rb +9 -9
- data/scaffolding/README.md +23 -0
- data/scaffolding/run.rb +242 -0
- data/scaffolding/templates/decorator.rb.erb +13 -0
- data/scaffolding/templates/decorator_spec.erb.rb +0 -0
- data/scaffolding/templates/migration.erb +12 -0
- data/scaffolding/templates/model.erb +14 -0
- data/scaffolding/templates/repository.rb.erb +18 -0
- data/scaffolding/templates/repository_spec.rb.erb +9 -0
- data/scaffolding/templates/resource.erb +46 -0
- data/scaffolding/templates/resource_spec.rb.erb +78 -0
- data/scaffolding/templates/service.rb.erb +22 -0
- data/scaffolding/templates/service_spec.rb.erb +9 -0
- data/script/data/environments.rb +45 -0
- data/script/demonstrate-version-branches.rb +2 -2
- data/script/docker-container/test.sh +1 -1
- data/script/generate-certificates-for-webooks-certificate-spec.rb +1 -1
- data/script/insert-self-signed-certificate-from-url.rb +5 -5
- data/script/pry.rb +18 -12
- data/script/query.rb +5 -5
- data/script/reproduce-issue-can-i-deploy-ignore.rb +48 -0
- data/script/reproduce-issue-expand-currently-deployed.rb +47 -0
- data/script/reproduce-issue-starting-up.rb +12 -7
- data/script/reproduce-issue.rb +7 -2
- data/script/run-with-ssl.rb +8 -8
- data/script/seed-example-matrix.rb +11 -11
- data/script/seed-for-webhook-test.rb +22 -22
- data/script/seed-matrix.rb +20 -20
- data/script/seed.rb +25 -25
- data/script/test/approval-all.sh +6 -0
- data/script/webhook-server.ru +3 -3
- data/spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb +3 -3
- data/spec/features/can_i_deploy_spec.rb +1 -1
- data/spec/features/create_environment_spec.rb +47 -0
- data/spec/features/create_pacticipant_spec.rb +13 -7
- data/spec/features/create_tag_spec.rb +32 -0
- data/spec/features/create_version_spec.rb +40 -26
- data/spec/features/create_webhook_spec.rb +10 -10
- data/spec/features/delete_environment_spec.rb +16 -0
- data/spec/features/delete_label_spec.rb +1 -1
- data/spec/features/delete_pact_spec.rb +1 -1
- data/spec/features/delete_verification_spec.rb +3 -3
- data/spec/features/delete_version_spec.rb +1 -1
- data/spec/features/delete_webhook_spec.rb +5 -1
- data/spec/features/edit_webhook_spec.rb +8 -8
- data/spec/features/end_deployment_spec.rb +29 -0
- data/spec/features/end_support_spec.rb +67 -0
- data/spec/features/execute_unsaved_webhook_spec.rb +7 -10
- data/spec/features/execute_webhook_spec.rb +5 -5
- data/spec/features/get_can_i_deploy_badge_spec.rb +2 -2
- data/spec/features/get_currently_deployed_versions_for_environment_spec.rb +59 -0
- data/spec/features/get_currently_deployed_versions_for_version_spec.rb +27 -0
- data/spec/features/get_currently_supported_versions_for_environment_spec.rb +57 -0
- data/spec/features/get_dashboard_spec.rb +1 -1
- data/spec/features/get_deployed_versions_for_version_and_environment.rb +27 -0
- data/spec/features/get_diff_spec.rb +5 -5
- data/spec/features/get_environment_spec.rb +19 -0
- data/spec/features/get_environments_spec.rb +30 -0
- data/spec/features/get_integrations_dot_file_spec.rb +2 -2
- data/spec/features/get_integrations_spec.rb +1 -1
- data/spec/features/get_label_spec.rb +1 -1
- data/spec/features/get_latest_pact_badge_spec.rb +7 -7
- data/spec/features/get_latest_tagged_pact_badge_spec.rb +8 -8
- data/spec/features/get_latest_untagged_pact_badge_spec.rb +8 -8
- data/spec/features/get_latest_untagged_pact_spec.rb +1 -1
- data/spec/features/get_latest_verification_for_pact_spec.rb +2 -2
- data/spec/features/get_matrix_badge_spec.rb +10 -10
- data/spec/features/get_matrix_for_consumer_and_provider_spec.rb +3 -6
- data/spec/features/get_matrix_spec.rb +5 -5
- data/spec/features/get_pact_version.rb +2 -2
- data/spec/features/get_pact_versions_spec.rb +1 -1
- data/spec/features/get_previous_distinct_version.rb +5 -5
- data/spec/features/get_provider_pacts_for_verification_spec.rb +16 -5
- data/spec/features/get_released_versions_for_version_and_environment.rb +27 -0
- data/spec/features/get_tagged_pact_versions_spec.rb +1 -1
- data/spec/features/get_triggered_webhooks_for_pact_spec.rb +1 -1
- data/spec/features/get_triggered_webhooks_for_verification_spec.rb +1 -1
- data/spec/features/get_verifications_for_consumer_version_spec.rb +1 -1
- data/spec/features/get_version_spec.rb +2 -2
- data/spec/features/get_versions_spec.rb +2 -2
- data/spec/features/label_pacticipant_spec.rb +3 -3
- data/spec/features/merge_pact_spec.rb +8 -8
- data/spec/features/pending_pacts_with_tags_spec.rb +138 -0
- data/spec/features/publish_not_a_pact_spec.rb +5 -5
- data/spec/features/publish_pact_all_in_one_approval_spec.rb +72 -0
- data/spec/features/publish_pact_all_in_one_spec.rb +43 -0
- data/spec/features/publish_pact_spec.rb +41 -6
- data/spec/features/publish_verification_spec.rb +11 -11
- data/spec/features/record_deployment_spec.rb +93 -0
- data/spec/features/record_release_spec.rb +84 -0
- data/spec/features/record_undeployment_spec.rb +67 -0
- data/spec/features/tag_version_spec.rb +2 -2
- data/spec/features/update_environment_spec.rb +44 -0
- data/spec/features/update_matrix_spec.rb +5 -5
- data/spec/features/update_pacticipant_spec.rb +87 -12
- data/spec/features/update_version_spec.rb +155 -0
- data/spec/features/update_webhook_spec.rb +6 -6
- data/spec/features/wip_pacts_spec.rb +64 -43
- data/spec/fixtures/approvals/get_provider_pacts_for_verification.approved.json +57 -0
- data/spec/fixtures/approvals/modifiable_resources.approved.json +24 -3
- data/spec/fixtures/approvals/publish_contract_no_branch.approved.json +166 -0
- data/spec/fixtures/approvals/publish_contract_nothing_exists.approved.json +158 -0
- data/spec/fixtures/approvals/publish_contract_nothing_exists_with_webhook.approved.json +158 -0
- data/spec/fixtures/approvals/publish_contract_verification_already_exists.approved.json +149 -0
- data/spec/fixtures/approvals/publish_contract_with_validation_error.approved.json +42 -0
- data/spec/fixtures/approvals/publish_contracts_results_decorator.approved.json +61 -0
- data/spec/integration/app_spec.rb +41 -41
- data/spec/integration/ui/index_spec.rb +4 -4
- data/spec/integration/ui/matrix_spec.rb +3 -3
- data/spec/integration/webhooks/certificate_spec.rb +7 -7
- data/spec/lib/pact/doc/generator_spec.rb +7 -7
- data/spec/lib/pact/doc/interaction_view_model_spec.rb +16 -16
- data/spec/lib/pact/doc/markdown/consumer_contract_renderer_spec.rb +9 -9
- data/spec/lib/pact/doc/markdown/index_renderer_spec.rb +3 -3
- data/spec/lib/pact_broker/api/contracts/environment_schema_spec.rb +91 -0
- data/spec/lib/pact_broker/api/contracts/pacticipant_schema_spec.rb +46 -0
- data/spec/lib/pact_broker/api/contracts/publish_contracts_schema_spec.rb +114 -0
- data/spec/lib/pact_broker/api/contracts/put_pact_params_contract_spec.rb +6 -6
- data/spec/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema_combinations_spec.rb +76 -0
- data/spec/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema_spec.rb +158 -4
- data/spec/lib/pact_broker/api/contracts/verifiable_pacts_query_schema_spec.rb +1 -1
- data/spec/lib/pact_broker/api/contracts/verification_contract_spec.rb +4 -4
- data/spec/lib/pact_broker/api/contracts/webhook_contract_spec.rb +26 -26
- data/spec/lib/pact_broker/api/decorators/dashboard_decorator_spec.rb +30 -30
- data/spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb +2 -2
- data/spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb +5 -5
- data/spec/lib/pact_broker/api/decorators/embedded_version_decorator_spec.rb +3 -3
- data/spec/lib/pact_broker/api/decorators/extended_pact_decorator_spec.rb +17 -17
- data/spec/lib/pact_broker/api/decorators/integration_decorator_spec.rb +3 -3
- data/spec/lib/pact_broker/api/decorators/integrations_decorator_spec.rb +3 -3
- data/spec/lib/pact_broker/api/decorators/label_decorator_spec.rb +2 -2
- data/spec/lib/pact_broker/api/decorators/latest_pact_decorator_spec.rb +4 -4
- data/spec/lib/pact_broker/api/decorators/matrix_decorator_spec.rb +50 -25
- data/spec/lib/pact_broker/api/decorators/pact_collection_decorator_spec.rb +6 -6
- data/spec/lib/pact_broker/api/decorators/pact_decorator_spec.rb +25 -25
- data/spec/lib/pact_broker/api/decorators/pact_version_decorator_spec.rb +22 -17
- data/spec/lib/pact_broker/api/decorators/pact_webhooks_status_decorator_spec.rb +17 -14
- data/spec/lib/pact_broker/api/decorators/pacticipant_collection_decorator_spec.rb +7 -7
- data/spec/lib/pact_broker/api/decorators/pacticipant_decorator_spec.rb +63 -50
- data/spec/lib/pact_broker/api/decorators/provider_pacts_decorator_spec.rb +7 -7
- data/spec/lib/pact_broker/api/decorators/publish_contracts_results_decorator_spec.rb +53 -0
- data/spec/lib/pact_broker/api/decorators/reason_decorator_spec.rb +27 -8
- data/spec/lib/pact_broker/api/decorators/relationships_csv_decorator_spec.rb +4 -4
- data/spec/lib/pact_broker/api/decorators/representable_pact_spec.rb +7 -7
- data/spec/lib/pact_broker/api/decorators/tag_decorator_spec.rb +4 -4
- data/spec/lib/pact_broker/api/decorators/tagged_pact_versions_decorator_spec.rb +4 -4
- data/spec/lib/pact_broker/api/decorators/triggered_webhook_decorator_spec.rb +18 -15
- data/spec/lib/pact_broker/api/decorators/triggered_webhooks_decorator_spec.rb +5 -5
- data/spec/lib/pact_broker/api/decorators/verifiable_pact_decorator_spec.rb +11 -11
- data/spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb +3 -3
- data/spec/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator_spec.rb +44 -1
- data/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb +15 -15
- data/spec/lib/pact_broker/api/decorators/verification_summary_decorator_spec.rb +9 -9
- data/spec/lib/pact_broker/api/decorators/version_decorator_spec.rb +93 -48
- data/spec/lib/pact_broker/api/decorators/versions_decorator_spec.rb +7 -7
- data/spec/lib/pact_broker/api/decorators/webhook_decorator_spec.rb +59 -59
- data/spec/lib/pact_broker/api/decorators/webhook_execution_result_decorator_spec.rb +15 -15
- data/spec/lib/pact_broker/api/decorators/webhook_request_template_decorator_spec.rb +13 -13
- data/spec/lib/pact_broker/api/decorators/webhooks_decorator_spec.rb +10 -10
- data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +36 -10
- data/spec/lib/pact_broker/api/renderers/html_pact_renderer_spec.rb +30 -30
- data/spec/lib/pact_broker/api/renderers/integrations_dot_renderer_spec.rb +4 -4
- data/spec/lib/pact_broker/api/resources/all_webhooks_spec.rb +32 -41
- data/spec/lib/pact_broker/api/resources/badge_spec.rb +17 -17
- data/spec/lib/pact_broker/api/resources/can_i_deploy_badge_spec.rb +6 -6
- data/spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb +9 -9
- data/spec/lib/pact_broker/api/resources/can_i_deploy_spec.rb +7 -7
- data/spec/lib/pact_broker/api/resources/dashboard_spec.rb +1 -1
- data/spec/lib/pact_broker/api/resources/default_base_resource_approval_spec.rb +12 -11
- data/spec/lib/pact_broker/api/resources/default_base_resource_spec.rb +25 -24
- data/spec/lib/pact_broker/api/resources/error_response_body_generator_spec.rb +11 -11
- data/spec/lib/pact_broker/api/resources/group_spec.rb +11 -11
- data/spec/lib/pact_broker/api/resources/latest_pact_spec.rb +15 -15
- data/spec/lib/pact_broker/api/resources/latest_provider_pacts_spec.rb +6 -6
- data/spec/lib/pact_broker/api/resources/latest_verifications_for_consumer_version_spec.rb +8 -8
- data/spec/lib/pact_broker/api/resources/matrix_badge_spec.rb +1 -1
- data/spec/lib/pact_broker/api/resources/matrix_spec.rb +10 -10
- data/spec/lib/pact_broker/api/resources/pact_spec.rb +24 -24
- data/spec/lib/pact_broker/api/resources/pact_triggered_webhooks_spec.rb +4 -4
- data/spec/lib/pact_broker/api/resources/pacticipant_spec.rb +2 -5
- data/spec/lib/pact_broker/api/resources/{webhooks_spec.rb → pacticipant_webhooks_spec.rb} +19 -19
- data/spec/lib/pact_broker/api/resources/pacticipants_spec.rb +18 -22
- data/spec/lib/pact_broker/api/resources/provider_pacts_for_verification_spec.rb +17 -17
- data/spec/lib/pact_broker/api/resources/provider_pacts_spec.rb +8 -8
- data/spec/lib/pact_broker/api/resources/released_version_spec.rb +61 -0
- data/spec/lib/pact_broker/api/resources/tag_spec.rb +3 -3
- data/spec/lib/pact_broker/api/resources/tagged_pact_versions_spec.rb +7 -7
- data/spec/lib/pact_broker/api/resources/triggered_webhook_logs_spec.rb +9 -6
- data/spec/lib/pact_broker/api/resources/verification_spec.rb +76 -7
- data/spec/lib/pact_broker/api/resources/verification_triggered_webhooks_spec.rb +4 -4
- data/spec/lib/pact_broker/api/resources/verifications_spec.rb +22 -28
- data/spec/lib/pact_broker/api/resources/webhook_execution_result_spec.rb +56 -0
- data/spec/lib/pact_broker/api/resources/webhook_execution_spec.rb +10 -10
- data/spec/lib/pact_broker/api/resources/webhook_spec.rb +15 -15
- data/spec/lib/pact_broker/app_spec.rb +43 -43
- data/spec/lib/pact_broker/badges/service_spec.rb +6 -6
- data/spec/lib/pact_broker/build_http_options_spec.rb +5 -5
- data/spec/lib/pact_broker/certificates/service_spec.rb +7 -7
- data/spec/lib/pact_broker/config/load_spec.rb +11 -11
- data/spec/lib/pact_broker/config/save_and_load_spec.rb +2 -2
- data/spec/lib/pact_broker/config/save_spec.rb +29 -29
- data/spec/lib/pact_broker/config/space_delimited_integer_list_spec.rb +1 -1
- data/spec/lib/pact_broker/config/space_delimited_string_list_spec.rb +1 -1
- data/spec/lib/pact_broker/configuration_spec.rb +9 -9
- data/spec/lib/pact_broker/contracts/service_spec.rb +108 -0
- data/spec/lib/pact_broker/db/clean_incremental_spec.rb +12 -11
- data/spec/lib/pact_broker/db/clean_old_spec.rb +2 -4
- data/spec/lib/pact_broker/db/clean_spec.rb +5 -7
- data/spec/lib/pact_broker/db/data_migrations/migrate_webhook_headers_spec.rb +1 -1
- data/spec/lib/pact_broker/db/data_migrations/set_consumer_ids_for_pact_publications_spec.rb +6 -6
- data/spec/lib/pact_broker/db/data_migrations/set_latest_version_sequence_value_spec.rb +8 -8
- data/spec/lib/pact_broker/db/data_migrations/set_pacticipant_main_branch_spec.rb +41 -0
- data/spec/lib/pact_broker/db/delete_overwritten_data_spec.rb +1 -1
- data/spec/lib/pact_broker/db/log_quietener_spec.rb +1 -1
- data/spec/lib/pact_broker/db/validate_encoding_spec.rb +8 -8
- data/spec/lib/pact_broker/deployments/deployed_version_spec.rb +109 -0
- data/spec/lib/pact_broker/deployments/environment_service_spec.rb +37 -0
- data/spec/lib/pact_broker/deployments/environment_spec.rb +27 -0
- data/spec/lib/pact_broker/diagnostic/resources/dependencies_spec.rb +9 -9
- data/spec/lib/pact_broker/diagnostic/resources/heartbeat_spec.rb +5 -5
- data/spec/lib/pact_broker/doc/controllers/app_spec.rb +4 -4
- data/spec/lib/pact_broker/doc/coverage_spec.rb +5 -5
- data/spec/lib/pact_broker/domain/group_spec.rb +7 -7
- data/spec/lib/pact_broker/domain/index_item_spec.rb +3 -3
- data/spec/lib/pact_broker/domain/order_versions_spec.rb +26 -26
- data/spec/lib/pact_broker/domain/pact_spec.rb +3 -3
- data/spec/lib/pact_broker/domain/tag_spec.rb +1 -1
- data/spec/lib/pact_broker/domain/verification_spec.rb +3 -3
- data/spec/lib/pact_broker/domain/version_spec.rb +118 -7
- data/spec/lib/pact_broker/domain/webhook_request_spec.rb +36 -36
- data/spec/lib/pact_broker/domain/webhook_spec.rb +11 -11
- data/spec/lib/pact_broker/errors/error_logger_spec.rb +4 -4
- data/spec/lib/pact_broker/errors_spec.rb +7 -8
- data/spec/lib/pact_broker/events/subscriber_spec.rb +43 -0
- data/spec/lib/pact_broker/feature_toggle_spec.rb +9 -9
- data/spec/lib/pact_broker/groups/service_spec.rb +8 -8
- data/spec/lib/pact_broker/hash_refinements_spec.rb +1 -1
- data/spec/lib/pact_broker/index/service_spec.rb +13 -14
- data/spec/lib/pact_broker/integrations/integration_spec.rb +1 -1
- data/spec/lib/pact_broker/integrations/service_spec.rb +17 -6
- data/spec/lib/pact_broker/labels/repository_spec.rb +2 -2
- data/spec/lib/pact_broker/labels/service_spec.rb +1 -1
- data/spec/lib/pact_broker/matrix/aggregated_row_spec.rb +14 -14
- data/spec/lib/pact_broker/matrix/can_i_deploy_query_schema_spec.rb +72 -0
- data/spec/lib/pact_broker/matrix/deployment_status_summary_spec.rb +100 -20
- data/spec/lib/pact_broker/matrix/every_row_spec.rb +5 -5
- data/spec/lib/pact_broker/matrix/head_row_spec.rb +1 -1
- data/spec/lib/pact_broker/matrix/integration_environment_spec.rb +175 -0
- data/spec/lib/pact_broker/matrix/integration_ignore_spec.rb +226 -0
- data/spec/lib/pact_broker/matrix/integration_spec.rb +11 -13
- data/spec/lib/pact_broker/matrix/parse_can_i_deploy_query_spec.rb +49 -0
- data/spec/lib/pact_broker/matrix/parse_query_spec.rb +28 -6
- data/spec/lib/pact_broker/matrix/quick_row_spec.rb +7 -7
- data/spec/lib/pact_broker/matrix/repository_dependency_spec.rb +2 -2
- data/spec/lib/pact_broker/matrix/repository_query_limit_spec.rb +9 -9
- data/spec/lib/pact_broker/matrix/repository_spec.rb +44 -211
- data/spec/lib/pact_broker/matrix/row_spec.rb +7 -7
- data/spec/lib/pact_broker/matrix/service_spec.rb +83 -20
- data/spec/lib/pact_broker/messages_spec.rb +6 -6
- data/spec/lib/pact_broker/metrics/service_spec.rb +1 -1
- data/spec/lib/pact_broker/pacticipants/find_potential_duplicate_pacticipant_names_spec.rb +10 -10
- data/spec/lib/pact_broker/pacticipants/generate_display_name_spec.rb +39 -0
- data/spec/lib/pact_broker/pacticipants/repository_spec.rb +86 -15
- data/spec/lib/pact_broker/pacticipants/service_spec.rb +27 -73
- data/spec/lib/pact_broker/pacts/build_verifiable_pact_notices_spec.rb +10 -10
- data/spec/lib/pact_broker/pacts/content_spec.rb +55 -55
- data/spec/lib/pact_broker/pacts/create_formatted_diff_spec.rb +10 -10
- data/spec/lib/pact_broker/pacts/diff_spec.rb +23 -23
- data/spec/lib/pact_broker/pacts/generate_interaction_sha_spec.rb +1 -1
- data/spec/lib/pact_broker/pacts/generate_sha_spec.rb +7 -7
- data/spec/lib/pact_broker/pacts/latest_tagged_pact_publications_spec.rb +1 -1
- data/spec/lib/pact_broker/pacts/merger_spec.rb +7 -7
- data/spec/lib/pact_broker/pacts/metadata_spec.rb +3 -3
- data/spec/lib/pact_broker/pacts/pact_params_spec.rb +12 -12
- data/spec/lib/pact_broker/pacts/pact_publication_dataset_module_spec.rb +8 -8
- data/spec/lib/pact_broker/pacts/pact_publication_selector_dataset_module_spec.rb +120 -0
- data/spec/lib/pact_broker/pacts/pact_publication_spec.rb +9 -9
- data/spec/lib/pact_broker/pacts/pact_version_spec.rb +47 -3
- data/spec/lib/pact_broker/pacts/repository_find_for_currently_deployed_spec.rb +124 -0
- data/spec/lib/pact_broker/pacts/repository_find_for_currently_supported_releases_spec.rb +159 -0
- data/spec/lib/pact_broker/pacts/repository_find_for_verification_fallback_spec.rb +1 -1
- data/spec/lib/pact_broker/pacts/repository_find_for_verification_spec.rb +19 -19
- data/spec/lib/pact_broker/pacts/repository_find_wip_pact_versions_for_provider_branch_spec.rb +59 -1
- data/spec/lib/pact_broker/pacts/repository_find_wip_pact_versions_for_provider_spec.rb +81 -22
- data/spec/lib/pact_broker/pacts/repository_spec.rb +39 -39
- data/spec/lib/pact_broker/pacts/selected_pact_spec.rb +1 -1
- data/spec/lib/pact_broker/pacts/selector_spec.rb +14 -11
- data/spec/lib/pact_broker/pacts/selectors_spec.rb +3 -3
- data/spec/lib/pact_broker/pacts/service_find_for_verification_spec.rb +5 -5
- data/spec/lib/pact_broker/pacts/service_spec.rb +111 -39
- data/spec/lib/pact_broker/pacts/sort_content_spec.rb +21 -8
- data/spec/lib/pact_broker/pacts/squash_pacts_for_verification_spec.rb +3 -3
- data/spec/lib/pact_broker/pacts/verifiable_pact_messages_spec.rb +99 -35
- data/spec/lib/pact_broker/relationships/groupify_spec.rb +12 -12
- data/spec/lib/pact_broker/tags/repository_spec.rb +2 -2
- data/spec/lib/pact_broker/tags/service_spec.rb +2 -2
- data/spec/lib/pact_broker/ui/controllers/can_i_deploy_spec.rb +1 -1
- data/spec/lib/pact_broker/ui/controllers/clusters_spec.rb +3 -3
- data/spec/lib/pact_broker/ui/controllers/index_spec.rb +47 -8
- data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +9 -9
- data/spec/lib/pact_broker/ui/view_models/index_items_spec.rb +3 -3
- data/spec/lib/pact_broker/ui/view_models/matrix_deployed_version_spec.rb +29 -0
- data/spec/lib/pact_broker/verifications/pseudo_branch_status_spec.rb +5 -5
- data/spec/lib/pact_broker/verifications/repository_spec.rb +4 -4
- data/spec/lib/pact_broker/verifications/sequence_spec.rb +1 -1
- data/spec/lib/pact_broker/verifications/service_spec.rb +30 -25
- data/spec/lib/pact_broker/verifications/summary_for_consumer_version_spec.rb +6 -6
- data/spec/lib/pact_broker/versions/abbreviate_number_spec.rb +5 -5
- data/spec/lib/pact_broker/versions/parse_semantic_version_spec.rb +2 -2
- data/spec/lib/pact_broker/versions/repository_spec.rb +16 -6
- data/spec/lib/pact_broker/versions/service_spec.rb +1 -1
- data/spec/lib/pact_broker/webhooks/check_host_whitelist_spec.rb +1 -1
- data/spec/lib/pact_broker/webhooks/execution_configuration_spec.rb +1 -1
- data/spec/lib/pact_broker/webhooks/job_spec.rb +10 -10
- data/spec/lib/pact_broker/webhooks/pact_and_verification_parameters_spec.rb +16 -0
- data/spec/lib/pact_broker/webhooks/redact_logs_spec.rb +1 -1
- data/spec/lib/pact_broker/webhooks/render_spec.rb +19 -10
- data/spec/lib/pact_broker/webhooks/repository_spec.rb +203 -177
- data/spec/lib/pact_broker/webhooks/service_spec.rb +37 -243
- data/spec/lib/pact_broker/webhooks/status_spec.rb +5 -5
- data/spec/lib/pact_broker/webhooks/trigger_service_spec.rb +252 -127
- data/spec/lib/pact_broker/webhooks/triggered_webhook_spec.rb +2 -2
- data/spec/lib/pact_broker/webhooks/webhook_request_logger_spec.rb +11 -11
- data/spec/lib/pact_broker/webhooks/webhook_request_template_spec.rb +70 -28
- data/spec/lib/pact_broker/webhooks/webhook_spec.rb +2 -5
- data/spec/lib/rack/hal_browser/redirect_spec.rb +18 -18
- data/spec/lib/rack/pact_broker/add_pact_broker_version_header_spec.rb +3 -3
- data/spec/lib/rack/pact_broker/database_transaction_spec.rb +10 -15
- data/spec/lib/rack/pact_broker/invalid_uri_protection_spec.rb +2 -2
- data/spec/lib/rack/pact_broker/request_target_spec.rb +5 -5
- data/spec/lib/rack/pact_broker/set_base_url_spec.rb +86 -0
- data/spec/lib/rack/pact_broker/use_when_spec.rb +6 -6
- data/spec/lib/sequel/plugins/insert_ignore_spec.rb +2 -2
- data/spec/lib/sequel/plugins/upsert_spec.rb +3 -3
- data/spec/lib/webmachine/rack_adapter_monkey_patch_spec.rb +7 -8
- data/spec/migrations/23_pact_versions_spec.rb +11 -13
- data/spec/migrations/24_populate_pact_contents_spec.rb +7 -7
- data/spec/migrations/34_latest_tagged_pacts_spec.rb +23 -23
- data/spec/migrations/34_pact_revisions_spec.rb +10 -10
- data/spec/migrations/41_migrate_execution_data_spec.rb +11 -11
- data/spec/migrations/42_delete_ophan_webhook_data_spec.rb +17 -17
- data/spec/migrations/44_add_provider_version_to_verification_spec.rb +9 -9
- data/spec/migrations/50_create_latest_matrix_spec.rb +15 -15
- data/spec/migrations/change_migration_strategy_spec.rb +21 -21
- data/spec/migrations/rollback_spec.rb +2 -0
- data/spec/service_consumers/hal_relation_proxy_app.rb +30 -7
- data/spec/service_consumers/pact_helper.rb +24 -11
- data/spec/service_consumers/provider_states_for_pact_broker_client.rb +101 -18
- data/spec/service_consumers/provider_states_for_pact_broker_client_2.rb +36 -0
- data/spec/service_consumers/provider_states_for_pact_ruby.rb +64 -64
- data/spec/spec_helper.rb +13 -25
- data/spec/support/approvals.rb +9 -7
- data/spec/support/database.rb +8 -4
- data/spec/support/database_cleaner.rb +2 -2
- data/spec/support/fixture_helpers.rb +1 -1
- data/spec/support/logging.rb +2 -2
- data/spec/support/metadata_test_server.rb +7 -7
- data/spec/support/migration_helpers.rb +1 -1
- data/spec/support/rack_helpers.rb +20 -0
- data/spec/support/rspec_matchers.rb +1 -1
- data/spec/support/shared_context.rb +1 -1
- data/spec/support/shared_examples_for_responses.rb +15 -4
- data/spec/support/simplecov.rb +20 -7
- data/spec/support/ssl_pact_broker_server.rb +8 -8
- data/spec/support/ssl_webhook_server.rb +8 -8
- data/spec/support/test_data_builder.rb +1 -1
- data/spec/support/verification_job.rb +8 -8
- data/spec/support/webhook_endpoint_middleware.rb +4 -4
- data/tasks/audit.rake +1 -1
- data/tasks/database.rb +23 -23
- data/tasks/database/annotate.rb +2 -2
- data/tasks/database/table_dependency_calculator.rb +1 -1
- data/tasks/db.rake +34 -39
- data/tasks/development.rake +38 -6
- data/tasks/docker_database.rb +9 -9
- data/tasks/pact.rake +5 -5
- data/tasks/release.rake +2 -2
- data/tasks/rspec.rake +16 -16
- data/tasks/test_db.rake +11 -11
- data/vendor/hal-browser/styles.css +6 -0
- metadata +209 -21
- data/.travis.yml +0 -31
- data/lib/pact_broker/domain/webhook_request_header.rb +0 -13
- data/lib/webmachine/rack_adapter_monkey_patch.rb +0 -38
- data/spec/lib/pact_broker/domain/pacticipant_spec.rb +0 -26
@@ -0,0 +1,44 @@
|
|
1
|
+
require "pact_broker/api/pact_broker_urls"
|
2
|
+
|
3
|
+
describe "Updating an environment" do
|
4
|
+
before do
|
5
|
+
td.create_environment("test", uuid: "1234", contacts: [ { name: "Foo" } ] )
|
6
|
+
end
|
7
|
+
let(:path) { PactBroker::Api::PactBrokerUrls.environment_url(td.and_return(:environment)) }
|
8
|
+
let(:headers) { {"CONTENT_TYPE" => "application/json"} }
|
9
|
+
let(:response_body) { JSON.parse(last_response.body, symbolize_names: true)}
|
10
|
+
let(:environment_hash) do
|
11
|
+
{
|
12
|
+
name: "test",
|
13
|
+
production: false,
|
14
|
+
displayName: "Testing"
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
subject { put(path, environment_hash.to_json, headers) }
|
19
|
+
|
20
|
+
it { is_expected.to be_a_hal_json_success_response }
|
21
|
+
|
22
|
+
it "returns the updated environment" do
|
23
|
+
subject
|
24
|
+
expect(response_body[:displayName]).to eq "Testing"
|
25
|
+
expect(response_body[:contacts]).to be nil
|
26
|
+
end
|
27
|
+
|
28
|
+
context "when the environment doesn't exist" do
|
29
|
+
let(:path) { "/environments/5678" }
|
30
|
+
|
31
|
+
it "returns a 404" do
|
32
|
+
expect(subject.status).to eq 404
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context "with invalid params" do
|
37
|
+
let(:environment_hash) { {} }
|
38
|
+
|
39
|
+
it "returns a 400 response" do
|
40
|
+
expect(subject.status).to be 400
|
41
|
+
expect(response_body[:errors]).to_not be nil
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -89,7 +89,7 @@ describe "Creating a resource that affects the matrix" do
|
|
89
89
|
let(:td) { TestDataBuilder.new }
|
90
90
|
let(:response_body_json) { JSON.parse(subject.body) }
|
91
91
|
|
92
|
-
subject { put(path, nil, {
|
92
|
+
subject { put(path, nil, {"CONTENT_TYPE" => "application/json"}); last_response }
|
93
93
|
|
94
94
|
context "creating a tag" do
|
95
95
|
before do
|
@@ -108,10 +108,10 @@ describe "Creating a resource that affects the matrix" do
|
|
108
108
|
end
|
109
109
|
|
110
110
|
context "creating a pact" do
|
111
|
-
let(:pact_content) { load_fixture(
|
111
|
+
let(:pact_content) { load_fixture("foo-bar.json") }
|
112
112
|
let(:path) { "/pacts/provider/Bar/consumer/Foo/versions/1.2.3" }
|
113
113
|
|
114
|
-
subject { put path, pact_content, {
|
114
|
+
subject { put path, pact_content, {"CONTENT_TYPE" => "application/json"}; last_response }
|
115
115
|
|
116
116
|
it "adds the relevant lines to the matrix" do
|
117
117
|
expect{ subject }.to change{ PactBroker::Matrix::Row.count }.by(1)
|
@@ -125,11 +125,11 @@ describe "Creating a resource that affects the matrix" do
|
|
125
125
|
context "creating a verification" do
|
126
126
|
let(:td) { TestDataBuilder.new }
|
127
127
|
let(:path) { "/pacts/provider/Bar/consumer/Foo/pact-version/#{pact.pact_version_sha}/verification-results" }
|
128
|
-
let(:verification_content) { load_fixture(
|
128
|
+
let(:verification_content) { load_fixture("verification.json") }
|
129
129
|
let(:parsed_response_body) { JSON.parse(subject.body) }
|
130
130
|
let(:pact) { td.pact }
|
131
131
|
|
132
|
-
subject { post path, verification_content, {
|
132
|
+
subject { post path, verification_content, {"CONTENT_TYPE" => "application/json" }; last_response }
|
133
133
|
|
134
134
|
before do
|
135
135
|
td.create_pact_with_hierarchy("Foo", "1", "Bar")
|
@@ -1,23 +1,98 @@
|
|
1
|
-
describe "
|
1
|
+
describe "Update a pacticipant" do
|
2
2
|
|
3
|
-
let(:request_body) { {
|
3
|
+
let(:request_body) { {"repositoryUrl" => "http://foo"} }
|
4
4
|
let(:path) { "/pacticipants/Some%20Consumer" }
|
5
|
-
let(:
|
5
|
+
let(:response_body_hash) { JSON.parse(subject.body, symbolize_names: true) }
|
6
6
|
|
7
|
-
|
7
|
+
context "with a PUT" do
|
8
|
+
let(:request_body_hash) do
|
9
|
+
{
|
10
|
+
repositoryUrl: "http://foo",
|
11
|
+
repositoryName: "name",
|
12
|
+
repositoryNamespace: "org",
|
13
|
+
mainBranch: "main"
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
subject { put(path, request_body_hash.to_json, { "CONTENT_TYPE" => "application/json" }) }
|
18
|
+
|
19
|
+
context "when the pacticipant exists" do
|
20
|
+
before do
|
21
|
+
td.create_pacticipant("Some Consumer")
|
22
|
+
end
|
8
23
|
|
9
|
-
|
24
|
+
it { is_expected.to be_a_hal_json_success_response }
|
10
25
|
|
11
|
-
|
12
|
-
|
26
|
+
it "updates the properties" do
|
27
|
+
expect(response_body_hash).to include(request_body_hash)
|
28
|
+
end
|
29
|
+
|
30
|
+
context "with only some of the properties set" do
|
31
|
+
let(:request_body_hash) do
|
32
|
+
{
|
33
|
+
repositoryUrl: "http://foo",
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
it "blanks out the missing ones" do
|
38
|
+
expect(response_body_hash[:repositoryName]).to be nil
|
39
|
+
end
|
40
|
+
end
|
13
41
|
end
|
14
|
-
|
15
|
-
|
16
|
-
|
42
|
+
|
43
|
+
context "when the pacticipant does not exist" do
|
44
|
+
it { is_expected.to be_a_404_response }
|
17
45
|
end
|
18
46
|
|
19
|
-
|
20
|
-
|
47
|
+
context "with application/merge-patch+json" do
|
48
|
+
subject { put(path, request_body.to_json, {"CONTENT_TYPE" => "application/merge-patch+json" }) }
|
49
|
+
|
50
|
+
its(:status) { is_expected.to eq 415 }
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
context "with a PATCH" do
|
56
|
+
subject { patch(path, request_body.to_json, {"CONTENT_TYPE" => "application/json" }) }
|
57
|
+
|
58
|
+
context "when the pacticipant exists" do
|
59
|
+
before do
|
60
|
+
td.create_pacticipant("Some Consumer", repository_name: "existing")
|
61
|
+
end
|
62
|
+
|
63
|
+
it "returns a 200 OK" do
|
64
|
+
puts subject.body unless subject.status == 200
|
65
|
+
expect(subject.status).to be 200
|
66
|
+
end
|
67
|
+
|
68
|
+
it "leaves any existing properties that were not defined" do
|
69
|
+
expect(response_body_hash[:repositoryName]).to eq "existing"
|
70
|
+
end
|
71
|
+
|
72
|
+
it "returns a json body with the updated pacticipant" do
|
73
|
+
expect(subject.headers["Content-Type"]).to eq "application/hal+json;charset=utf-8"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context "with application/merge-patch+json" do
|
78
|
+
before do
|
79
|
+
td.create_pacticipant("Some Consumer", repository_name: "existing")
|
80
|
+
end
|
81
|
+
|
82
|
+
subject { patch(path, request_body.to_json, {"CONTENT_TYPE" => "application/merge-patch+json" }) }
|
83
|
+
|
84
|
+
it "returns a 200 OK" do
|
85
|
+
puts subject.body unless subject.status == 200
|
86
|
+
expect(subject.status).to be 200
|
87
|
+
end
|
88
|
+
|
89
|
+
it "leaves any existing properties that were not defined" do
|
90
|
+
expect(response_body_hash[:repositoryName]).to eq "existing"
|
91
|
+
end
|
92
|
+
|
93
|
+
it "returns a json body with the updated pacticipant" do
|
94
|
+
expect(subject.headers["Content-Type"]).to eq "application/hal+json;charset=utf-8"
|
95
|
+
end
|
21
96
|
end
|
22
97
|
end
|
23
98
|
end
|
@@ -0,0 +1,155 @@
|
|
1
|
+
describe "Updating a pacticipant version" do
|
2
|
+
let(:path) { "/pacticipants/Foo/versions/1234" }
|
3
|
+
let(:headers) { { "CONTENT_TYPE" => content_type } }
|
4
|
+
let(:content_type) { "application/merge-patch+json" }
|
5
|
+
let(:response_body) { JSON.parse(subject.body, symbolize_names: true)}
|
6
|
+
let(:version_hash) do
|
7
|
+
{
|
8
|
+
buildUrl: "http://build"
|
9
|
+
}
|
10
|
+
end
|
11
|
+
|
12
|
+
context "with a PATCH" do
|
13
|
+
subject { patch(path, version_hash.to_json, headers) }
|
14
|
+
|
15
|
+
context "when the version already exists" do
|
16
|
+
before do
|
17
|
+
td.subtract_day
|
18
|
+
.create_consumer("Foo")
|
19
|
+
.create_consumer_version("1234", branch: original_branch, build_url: "original-build-url")
|
20
|
+
.create_consumer_version_tag("dev")
|
21
|
+
end
|
22
|
+
let(:original_branch) { "original-branch" }
|
23
|
+
|
24
|
+
let(:version_hash) { { buildUrl: "new-build-url" } }
|
25
|
+
|
26
|
+
it "returns a 200" do
|
27
|
+
expect(subject.status).to be 200
|
28
|
+
end
|
29
|
+
|
30
|
+
it "does not overwrites any properties that weren't specified" do
|
31
|
+
expect(response_body[:branch]).to eq "original-branch"
|
32
|
+
expect(response_body[:buildUrl]).to eq "new-build-url"
|
33
|
+
end
|
34
|
+
|
35
|
+
context "when the same not null branch is specified" do
|
36
|
+
let(:version_hash) { { branch: "original-branch" } }
|
37
|
+
|
38
|
+
its(:status) { is_expected.to eq 200 }
|
39
|
+
end
|
40
|
+
|
41
|
+
context "when the existing version has a branch, and the new branch is different", skip: true do
|
42
|
+
let(:version_hash) { { branch: "new-branch" } }
|
43
|
+
|
44
|
+
its(:status) { is_expected.to eq 409 }
|
45
|
+
|
46
|
+
it "returns an error" do
|
47
|
+
expect(response_body[:errors][:branch].first).to include "cannot be changed"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
context "when the existing version has a branch, and the new branch is nil", skip: true do
|
52
|
+
let(:version_hash) { { branch: nil } }
|
53
|
+
|
54
|
+
its(:status) { is_expected.to eq 409 }
|
55
|
+
|
56
|
+
it "returns an error" do
|
57
|
+
expect(response_body[:errors][:branch].first).to include "cannot be changed"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context "when the existing version does not have a branch, and the new branch is specified" do
|
62
|
+
let(:original_branch) { nil }
|
63
|
+
|
64
|
+
its(:status) { is_expected.to eq 200 }
|
65
|
+
end
|
66
|
+
|
67
|
+
context "when the existing version does not have a branch, and the new branch is also nil" do
|
68
|
+
let(:original_branch) { nil }
|
69
|
+
let(:version_hash) { { branch: nil } }
|
70
|
+
|
71
|
+
its(:status) { is_expected.to eq 200 }
|
72
|
+
end
|
73
|
+
|
74
|
+
context "when no tags are specified" do
|
75
|
+
it "does not change the tags" do
|
76
|
+
expect { subject }.to_not change { PactBroker::Domain::Version.for("Foo", "1234").tags }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
context "when tags are specified" do
|
81
|
+
let(:version_hash) { { tags: [ { name: "main" }] } }
|
82
|
+
|
83
|
+
it "overwrites the tags" do
|
84
|
+
expect(response_body[:_embedded][:tags].size).to eq 1
|
85
|
+
expect(response_body[:_embedded][:tags].first[:name]).to eq "main"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
it "does not change the created date" do
|
90
|
+
expect { subject }.to_not change { PactBroker::Domain::Version.for("Foo", "1234").created_at }
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
context "when using a PATCH with application/json" do
|
95
|
+
let(:content_type) { "application/json" }
|
96
|
+
|
97
|
+
its(:status) { is_expected.to eq 415 }
|
98
|
+
end
|
99
|
+
|
100
|
+
context "when using a PUT with application/merge-patch+json" do
|
101
|
+
subject { put(path, version_hash.to_json, headers) }
|
102
|
+
|
103
|
+
its(:status) { is_expected.to eq 415 }
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
context "with a PUT" do
|
108
|
+
let(:content_type) { "application/json" }
|
109
|
+
|
110
|
+
subject { put(path, version_hash.to_json, headers) }
|
111
|
+
|
112
|
+
context "when the version already exists" do
|
113
|
+
before do
|
114
|
+
td.subtract_day
|
115
|
+
.create_consumer("Foo")
|
116
|
+
.create_consumer_version("1234", branch: "original-branch", build_url: "original-build-url")
|
117
|
+
.create_consumer_version_tag("dev")
|
118
|
+
end
|
119
|
+
|
120
|
+
context "when the branch is attempted to be changed", skip: true do
|
121
|
+
let(:version_hash) { { branch: "new-branch" } }
|
122
|
+
|
123
|
+
its(:status) { is_expected.to eq 409 }
|
124
|
+
end
|
125
|
+
|
126
|
+
context "when the branch is not attempted to be changed" do
|
127
|
+
let(:version_hash) { { branch: "original-branch" } }
|
128
|
+
|
129
|
+
it "overwrites the direct properties and blanks out any unprovided ones" do
|
130
|
+
expect(response_body[:branch]).to eq "original-branch"
|
131
|
+
expect(response_body).to_not have_key(:buildUrl)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
context "when no tags are specified" do
|
136
|
+
it "does not change the tags" do
|
137
|
+
expect { subject }.to_not change { PactBroker::Domain::Version.for("Foo", "1234").tags }
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
context "when tags are specified" do
|
142
|
+
let(:version_hash) { { branch: "original-branch", tags: [ { name: "main" }] } }
|
143
|
+
|
144
|
+
it "overwrites the tags" do
|
145
|
+
expect(response_body[:_embedded][:tags].size).to eq 1
|
146
|
+
expect(response_body[:_embedded][:tags].first[:name]).to eq "main"
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
it "does not change the created date" do
|
151
|
+
expect { subject }.to_not change { PactBroker::Domain::Version.for("Foo", "1234").created_at }
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "support/test_data_builder"
|
2
2
|
|
3
3
|
describe "Updating a webhook" do
|
4
4
|
let(:webhook) do
|
@@ -8,7 +8,7 @@ describe "Updating a webhook" do
|
|
8
8
|
.and_return(:webhook)
|
9
9
|
end
|
10
10
|
|
11
|
-
let(:headers) { {
|
11
|
+
let(:headers) { {"CONTENT_TYPE" => "application/json"} }
|
12
12
|
let(:response_body) { JSON.parse(last_response.body, symbolize_names: true)}
|
13
13
|
let(:webhook_json) { webhook_hash.to_json }
|
14
14
|
let(:webhook_hash) do
|
@@ -19,16 +19,16 @@ describe "Updating a webhook" do
|
|
19
19
|
},
|
20
20
|
enabled: false,
|
21
21
|
events: [{
|
22
|
-
name:
|
22
|
+
name: "contract_published"
|
23
23
|
}],
|
24
24
|
request: {
|
25
|
-
method:
|
26
|
-
url:
|
25
|
+
method: "POST",
|
26
|
+
url: "https://example.org",
|
27
27
|
headers: {
|
28
28
|
:"Content-Type" => "application/json"
|
29
29
|
},
|
30
30
|
body: {
|
31
|
-
a:
|
31
|
+
a: "body"
|
32
32
|
}
|
33
33
|
}
|
34
34
|
}
|
@@ -1,14 +1,15 @@
|
|
1
1
|
RSpec.describe "the lifecycle of a WIP pact" do
|
2
|
-
let(:pact_content_1) { { interactions: [{ some:
|
3
|
-
let(:pact_content_2) { { interactions: [{ some:
|
4
|
-
let(:pact_content_3) { { interactions: [{ some:
|
2
|
+
let(:pact_content_1) { { interactions: [{ some: "interaction"}] }.to_json }
|
3
|
+
let(:pact_content_2) { { interactions: [{ some: "other interaction"}] }.to_json }
|
4
|
+
let(:pact_content_3) { { interactions: [{ some: "other other interaction"}] }.to_json }
|
5
5
|
let(:request_headers) { { "CONTENT_TYPE" => "application/json", "HTTP_ACCEPT" => "application/hal+json"} }
|
6
6
|
let(:provider_version_number) { "2" }
|
7
7
|
let(:pacts_for_verification_request_body) do
|
8
8
|
{
|
9
9
|
consumerVersionSelectors: [ { tag: "master", latest: true } ],
|
10
10
|
providerVersionTags: ["master"],
|
11
|
-
includeWipPactsSince: start_date
|
11
|
+
includeWipPactsSince: start_date,
|
12
|
+
includePendingStatus: true
|
12
13
|
}.to_json
|
13
14
|
end
|
14
15
|
|
@@ -91,7 +92,8 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
91
92
|
{
|
92
93
|
consumerVersionSelectors: [ { tag: consumer_version_tag || provider_version_tag, latest: true, fallbackTag: "master" } ],
|
93
94
|
providerVersionTags: [provider_version_tag],
|
94
|
-
includeWipPactsSince: start_date
|
95
|
+
includeWipPactsSince: start_date,
|
96
|
+
includePendingStatus: true
|
95
97
|
}.to_json
|
96
98
|
end
|
97
99
|
|
@@ -99,8 +101,6 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
99
101
|
context "a pact published afer the specified date, with a tag that is not specified explictly in the 'pacts for verification' request" do
|
100
102
|
describe "when it is first published" do
|
101
103
|
it "is included in the list of pacts to verify as a WIP pact" do
|
102
|
-
create_initial_provider_version_on_master
|
103
|
-
|
104
104
|
publish_pact_with_master_tag
|
105
105
|
publish_pact_with_feature_tag
|
106
106
|
|
@@ -111,8 +111,6 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
111
111
|
|
112
112
|
describe "when it is verified unsuccessfully" do
|
113
113
|
it "is still included as a WIP pact" do
|
114
|
-
create_initial_provider_version_on_master
|
115
|
-
|
116
114
|
# CONSUMER BUILD
|
117
115
|
# publish pact
|
118
116
|
publish_pact_with_master_tag
|
@@ -140,17 +138,16 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
140
138
|
|
141
139
|
describe "when it is verified successfully while included as a WIP pact" do
|
142
140
|
it "is still included as a WIP pact" do
|
143
|
-
create_initial_provider_version_on_master
|
144
|
-
|
145
141
|
# CONSUMER BUILD
|
146
142
|
publish_pact_with_master_tag
|
147
143
|
publish_pact_with_feature_tag
|
148
144
|
|
149
|
-
# PROVIDER BUILD
|
145
|
+
# PROVIDER BUILD - master
|
150
146
|
# fetch pacts to verify
|
151
147
|
pacts_for_verification_response = get_pacts_for_verification
|
152
148
|
pact_url = wip_pact_url_from(pacts_for_verification_response)
|
153
149
|
pact_response = get_pact(pact_url)
|
150
|
+
expect(wip_pacts_from(pacts_for_verification_response).first["verificationProperties"]["pending"]).to be true
|
154
151
|
|
155
152
|
# verify pact... success!
|
156
153
|
|
@@ -158,19 +155,19 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
158
155
|
verification_results_url = verification_results_url_from(pact_response)
|
159
156
|
publish_verification_results_with_tag_master(verification_results_url, true)
|
160
157
|
|
161
|
-
# ANOTHER PROVIDER BUILD 2
|
158
|
+
# ANOTHER PROVIDER BUILD 2 - master
|
162
159
|
# get pacts for verification
|
163
160
|
# publish successful verification results
|
164
161
|
pacts_for_verification_response = get_pacts_for_verification
|
165
162
|
# still wip
|
166
163
|
expect(wip_pacts_from(pacts_for_verification_response).size).to eq 1
|
164
|
+
# still pending - but maybe it should not be?
|
165
|
+
expect(wip_pacts_from(pacts_for_verification_response).first["verificationProperties"]["pending"]).to be true
|
167
166
|
end
|
168
167
|
end
|
169
168
|
|
170
169
|
describe "when it is verified successfully when included explicitly" do
|
171
170
|
it "is no longer included as a WIP pact" do
|
172
|
-
create_initial_provider_version_on_master
|
173
|
-
|
174
171
|
# CONSUMER BUILD
|
175
172
|
publish_pact_with_master_tag
|
176
173
|
publish_pact_with_feature_tag
|
@@ -178,6 +175,7 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
178
175
|
# PROVIDER BUILD
|
179
176
|
# fetch pacts to verify
|
180
177
|
pacts_for_verification_response = get_pacts_for_verification
|
178
|
+
expect(wip_pacts_from(pacts_for_verification_response).size).to eq 1
|
181
179
|
pact_url = wip_pact_url_from(pacts_for_verification_response)
|
182
180
|
pact_response = get_pact(pact_url)
|
183
181
|
|
@@ -202,8 +200,6 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
202
200
|
|
203
201
|
describe "a feature branching scenario" do
|
204
202
|
it "keeps being WIP until the branch is merged" do
|
205
|
-
create_initial_provider_version_on_master
|
206
|
-
|
207
203
|
# CONSUMER BUILD - master
|
208
204
|
publish_pact_with_master_tag
|
209
205
|
|
@@ -235,8 +231,8 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
235
231
|
|
236
232
|
# however feat-x pact is no longer pending because it has a successful verification from master!!!
|
237
233
|
# Question: do we want this behaviour? Or should pending use the same logic?
|
238
|
-
expect(wip_pacts_from(pacts_for_verification_response).first[
|
239
|
-
expect(wip_pacts_from(pacts_for_verification_response).first[
|
234
|
+
expect(wip_pacts_from(pacts_for_verification_response).first["verificationProperties"]["wip"]).to be true
|
235
|
+
expect(wip_pacts_from(pacts_for_verification_response).first["verificationProperties"]["pending"]).to be true
|
240
236
|
|
241
237
|
# verify pact... success!
|
242
238
|
|
@@ -259,13 +255,31 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
259
255
|
end
|
260
256
|
end
|
261
257
|
|
262
|
-
describe "a feature branching scenario with
|
263
|
-
it "
|
264
|
-
|
258
|
+
describe "a feature branching scenario with multiple provider feature branches" do
|
259
|
+
it "is WIP on a second feature branch even if the first feature branch successfully verified it" do
|
260
|
+
# CONSUMER BUILD - feature branch
|
261
|
+
publish_pact_with_feature_tag
|
265
262
|
|
266
|
-
#
|
267
|
-
|
263
|
+
# PROVIDER BUILD for feature branch 1
|
264
|
+
# fetch pacts to verify
|
265
|
+
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-1", "master"))
|
266
|
+
pact_response = get_pact(wip_pact_url_from(pacts_for_verification_response))
|
267
|
+
|
268
|
+
# verify pact... success!
|
269
|
+
|
270
|
+
# publish success verification results
|
271
|
+
publish_verification_results("1", "feat-1", verification_results_url_from(pact_response), true)
|
272
|
+
|
273
|
+
# ANOTHER PROVIDER BUILD on a different new feature branch
|
274
|
+
# fetch pacts to verify
|
275
|
+
sleep 1 if ::DB.mysql?
|
276
|
+
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-2", "master"))
|
277
|
+
expect(wip_pacts_from(pacts_for_verification_response).size).to eq 1
|
278
|
+
end
|
279
|
+
end
|
268
280
|
|
281
|
+
describe "a feature branching scenario with matching feature branches" do
|
282
|
+
it "stays wip on master even after it has been successfully verified on the provider's feature branch" do
|
269
283
|
# CONSUMER BUILD - feature branch
|
270
284
|
publish_pact_with_feature_tag
|
271
285
|
|
@@ -283,7 +297,7 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
283
297
|
|
284
298
|
# PROVIDER BUILD - on a matching feature branch
|
285
299
|
# fetch pacts to verify
|
286
|
-
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-x"))
|
300
|
+
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-x", "feat-x"))
|
287
301
|
# pact is not WIP because it has been explicitly included
|
288
302
|
expect(wip_pacts_from(pacts_for_verification_response).size).to eq 0
|
289
303
|
pact_url = pact_urls_from(pacts_for_verification_response).first
|
@@ -303,36 +317,42 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
303
317
|
end
|
304
318
|
|
305
319
|
describe "when a brand new provider branch is created" do
|
306
|
-
it "does not include any
|
307
|
-
create_initial_provider_version_on_master
|
308
|
-
|
320
|
+
it "does not include any pacts already successfully verified by another branch before this branch was created" do
|
309
321
|
# CONSUMER BUILD - master
|
310
322
|
publish_pact_with_master_tag
|
311
323
|
|
324
|
+
# PROVIDER BUILD - master
|
325
|
+
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("master", "master"))
|
326
|
+
|
327
|
+
# verify master pact successfully from provider master branch
|
328
|
+
pact_url = pact_urls_from(pacts_for_verification_response).first
|
329
|
+
pact_response = get_pact(pact_url)
|
330
|
+
verification_results_url = verification_results_url_from(pact_response)
|
331
|
+
publish_verification_results("1", "master", verification_results_url, true)
|
332
|
+
sleep 1 if ::DB.mysql?
|
333
|
+
|
312
334
|
# CONSUMER BUILD - feature branch
|
313
335
|
publish_pact_with_feature_tag
|
314
336
|
|
315
337
|
# PROVIDER BUILD - brand new feature branch
|
316
338
|
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-y", "master"))
|
317
|
-
expect(wip_pacts_from(pacts_for_verification_response).size).to eq
|
339
|
+
expect(wip_pacts_from(pacts_for_verification_response).size).to eq 1
|
318
340
|
|
319
|
-
# verify
|
320
|
-
pact_url = pact_urls_from(pacts_for_verification_response).first
|
321
|
-
pact_response = get_pact(pact_url)
|
341
|
+
# verify feature pact successfully
|
342
|
+
# pact_url = pact_urls_from(pacts_for_verification_response).first
|
343
|
+
# pact_response = get_pact(pact_url)
|
322
344
|
|
323
|
-
# publish successful results from feature branch
|
324
|
-
verification_results_url = verification_results_url_from(pact_response)
|
325
|
-
publish_verification_results("2", "feat-y", verification_results_url, true)
|
345
|
+
# # publish successful results from feature branch
|
346
|
+
# verification_results_url = verification_results_url_from(pact_response)
|
347
|
+
# publish_verification_results("2", "feat-y", verification_results_url, true)
|
326
348
|
|
327
|
-
# PROVIDER BUILD 2 - feature branch
|
328
|
-
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-y", "master"))
|
329
|
-
# still no wip pacts
|
330
|
-
expect(wip_pacts_from(pacts_for_verification_response).size).to eq 0
|
349
|
+
# # PROVIDER BUILD 2 - feature branch
|
350
|
+
# pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-y", "master"))
|
351
|
+
# # still no wip pacts
|
352
|
+
# expect(wip_pacts_from(pacts_for_verification_response).size).to eq 0
|
331
353
|
end
|
332
354
|
|
333
355
|
it "does include any subsequently created new pacts" do
|
334
|
-
create_initial_provider_version_on_master
|
335
|
-
|
336
356
|
# CONSUMER BUILD - master
|
337
357
|
publish_pact_with_master_tag
|
338
358
|
|
@@ -341,7 +361,8 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
341
361
|
|
342
362
|
# PROVIDER BUILD - brand new feature branch
|
343
363
|
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-y", "master"))
|
344
|
-
expect(wip_pacts_from(pacts_for_verification_response).size).to eq
|
364
|
+
expect(wip_pacts_from(pacts_for_verification_response).size).to eq 1
|
365
|
+
|
345
366
|
# verify master pact successfully (creates a new provider version with tag feat-y)
|
346
367
|
pact_url = pact_urls_from(pacts_for_verification_response).first
|
347
368
|
pact_response = get_pact(pact_url)
|
@@ -356,7 +377,7 @@ RSpec.describe "the lifecycle of a WIP pact" do
|
|
356
377
|
# CONSUMER BUILD - another feature branch
|
357
378
|
publish_pact_with_feature_tag("4", "feat-z", pact_content_3)
|
358
379
|
|
359
|
-
# PROVIDER BUILD -
|
380
|
+
# PROVIDER BUILD - new feature branch again
|
360
381
|
pacts_for_verification_response = get_pacts_for_verification(build_pacts_for_verification_request_body("feat-y", "master"))
|
361
382
|
expect(wip_pacts_from(pacts_for_verification_response).size).to eq 2
|
362
383
|
end
|