pact_broker 2.15.0 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +7 -3
  3. data/CHANGELOG.md +53 -0
  4. data/DEVELOPER_DOCUMENTATION.md +28 -1
  5. data/DEVELOPER_SETUP.md +1 -1
  6. data/README.md +8 -5
  7. data/db/migrations/000004_create_tags_table.rb +1 -1
  8. data/db/migrations/000050_create_latest_matrix.rb +1 -0
  9. data/db/migrations/20180122_create_head_pact_publications.rb +21 -0
  10. data/db/migrations/20180123_create_tags_with_latest_flag.rb +28 -0
  11. data/db/migrations/20180129_create_latest_matrix_for_cv_and_pv.rb +91 -0
  12. data/db/migrations/20180130_create_materialized_matrix.rb +35 -0
  13. data/db/migrations/20180131_create_materialized_latest_matrix.rb +35 -0
  14. data/db/migrations/20180201_create_head_matrix.rb +33 -0
  15. data/db/migrations/20180202_create_materialized_head_matrix.rb +34 -0
  16. data/db/migrations/20180203_fix_head_matrix.rb +36 -0
  17. data/db/migrations/20180204_fix_latest_matrix_for_cv_and_pv.rb +57 -0
  18. data/db/migrations/20180205_drop_materialized_latest_matrix.rb +36 -0
  19. data/db/migrations/20180206_recreate_head_matrix_rename_consumer_tag_name.rb +68 -0
  20. data/db/migrations/20180207_recreate_head_matrix_union_all.rb +60 -0
  21. data/db/migrations/20180208_add_cv_tag_name_index_to_mat_head_matrix.rb +7 -0
  22. data/db/migrations/20180209_recreate_latest_matrix_for_cv_and_pv_union_all.rb +54 -0
  23. data/db/migrations/20180210_fix_latest_matrix_for_cv_and_pv_again.rb +53 -0
  24. data/db/migrations/migration_helper.rb +8 -0
  25. data/db/test/backwards_compatibility/Rakefile +1 -1
  26. data/example/pact_broker_database.sqlite3 +0 -0
  27. data/lib/pact_broker/api.rb +1 -0
  28. data/lib/pact_broker/api/decorators/dashboard_decorator.rb +163 -0
  29. data/lib/pact_broker/api/decorators/dashboard_text_decorator.rb +50 -0
  30. data/lib/pact_broker/api/decorators/matrix_decorator.rb +21 -16
  31. data/lib/pact_broker/api/decorators/pacticipant_decorator.rb +1 -0
  32. data/lib/pact_broker/api/pact_broker_urls.rb +29 -0
  33. data/lib/pact_broker/api/resources/base_resource.rb +3 -0
  34. data/lib/pact_broker/api/resources/dashboard.rb +38 -0
  35. data/lib/pact_broker/api/resources/label.rb +0 -1
  36. data/lib/pact_broker/api/resources/tag.rb +0 -1
  37. data/lib/pact_broker/dashboard/service.rb +0 -0
  38. data/lib/pact_broker/domain/index_item.rb +16 -5
  39. data/lib/pact_broker/index/service.rb +69 -4
  40. data/lib/pact_broker/matrix/head_row.rb +11 -0
  41. data/lib/pact_broker/matrix/latest_row.rb +2 -16
  42. data/lib/pact_broker/matrix/repository.rb +56 -11
  43. data/lib/pact_broker/matrix/row.rb +166 -6
  44. data/lib/pact_broker/matrix/service.rb +5 -0
  45. data/lib/pact_broker/tags/tag_with_latest_flag.rb +18 -0
  46. data/lib/pact_broker/ui/controllers/index.rb +5 -2
  47. data/lib/pact_broker/ui/controllers/matrix.rb +3 -3
  48. data/lib/pact_broker/ui/view_models/index_item.rb +13 -5
  49. data/lib/pact_broker/ui/view_models/matrix_line.rb +77 -8
  50. data/lib/pact_broker/ui/view_models/matrix_lines.rb +17 -0
  51. data/lib/pact_broker/ui/view_models/matrix_tag.rb +42 -0
  52. data/lib/pact_broker/ui/views/index/show-with-tags.haml +26 -14
  53. data/lib/pact_broker/ui/views/index/show.haml +9 -8
  54. data/lib/pact_broker/ui/views/matrix/show.haml +46 -15
  55. data/lib/pact_broker/verifications/latest_verifications_by_consumer_version.rb +1 -0
  56. data/lib/pact_broker/verifications/repository.rb +4 -4
  57. data/lib/pact_broker/version.rb +1 -1
  58. data/lib/pact_broker/versions/abbreviate_number.rb +14 -0
  59. data/pact_broker.gemspec +3 -2
  60. data/public/images/logo@2x.png +0 -0
  61. data/public/javascripts/matrix.js +5 -0
  62. data/public/stylesheets/index.css +33 -1
  63. data/public/stylesheets/matrix.css +9 -0
  64. data/script/db-spec.sh +1 -1
  65. data/spec/features/get_dashboard_spec.rb +29 -0
  66. data/spec/fixtures/dashboard.json +83 -0
  67. data/spec/lib/pact_broker/api/decorators/dashboard_decorator_spec.rb +89 -0
  68. data/spec/lib/pact_broker/api/decorators/matrix_decorator_spec.rb +30 -26
  69. data/spec/lib/pact_broker/api/resources/dashboard_spec.rb +16 -0
  70. data/spec/lib/pact_broker/api/resources/group_spec.rb +1 -0
  71. data/spec/lib/pact_broker/index/service_spec.rb +146 -32
  72. data/spec/lib/pact_broker/matrix/repository_spec.rb +48 -1
  73. data/spec/lib/pact_broker/matrix/row_spec.rb +59 -0
  74. data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +17 -12
  75. data/spec/lib/pact_broker/versions/abbreviate_number_spec.rb +22 -0
  76. data/spec/migrations/20180201_create_head_matrix_spec.rb +132 -0
  77. data/spec/migrations/23_pact_versions_spec.rb +2 -2
  78. data/spec/migrations/50_create_latest_matrix_spec.rb +84 -16
  79. data/spec/migrations/change_migration_strategy_spec.rb +1 -1
  80. data/spec/service_consumers/pact_helper.rb +4 -1
  81. data/spec/spec_helper.rb +1 -0
  82. data/spec/support/migration_helpers.rb +1 -1
  83. data/spec/support/rspec_match_hash.rb +6 -2
  84. data/spec/support/shared_examples_for_responses.rb +1 -1
  85. data/spec/support/test_data_builder.rb +61 -11
  86. metadata +57 -6
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact_broker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.0
4
+ version: 2.16.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: 2018-02-26 00:00:00.000000000 Z
13
+ date: 2018-03-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -94,14 +94,14 @@ dependencies:
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '4.23'
97
+ version: '5.6'
98
98
  type: :runtime
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '4.23'
104
+ version: '5.6'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: webmachine
107
107
  requirement: !ruby/object:Gem::Requirement
@@ -218,14 +218,14 @@ dependencies:
218
218
  requirements:
219
219
  - - "~>"
220
220
  - !ruby/object:Gem::Version
221
- version: '4.0'
221
+ version: '5.0'
222
222
  type: :runtime
223
223
  prerelease: false
224
224
  version_requirements: !ruby/object:Gem::Requirement
225
225
  requirements:
226
226
  - - "~>"
227
227
  - !ruby/object:Gem::Version
228
- version: '4.0'
228
+ version: '5.0'
229
229
  - !ruby/object:Gem::Dependency
230
230
  name: sucker_punch
231
231
  requirement: !ruby/object:Gem::Requirement
@@ -296,6 +296,20 @@ dependencies:
296
296
  - - "~>"
297
297
  - !ruby/object:Gem::Version
298
298
  version: '1.14'
299
+ - !ruby/object:Gem::Dependency
300
+ name: rspec-pact-matchers
301
+ requirement: !ruby/object:Gem::Requirement
302
+ requirements:
303
+ - - "~>"
304
+ - !ruby/object:Gem::Version
305
+ version: '0.1'
306
+ type: :development
307
+ prerelease: false
308
+ version_requirements: !ruby/object:Gem::Requirement
309
+ requirements:
310
+ - - "~>"
311
+ - !ruby/object:Gem::Version
312
+ version: '0.1'
299
313
  - !ruby/object:Gem::Dependency
300
314
  name: bundler-audit
301
315
  requirement: !ruby/object:Gem::Requirement
@@ -582,6 +596,21 @@ files:
582
596
  - db/migrations/20180108_create_certificates_table.rb
583
597
  - db/migrations/20180109_migrate_trigger_type.rb
584
598
  - db/migrations/20180119_update_latest_triggered_webhooks.rb
599
+ - db/migrations/20180122_create_head_pact_publications.rb
600
+ - db/migrations/20180123_create_tags_with_latest_flag.rb
601
+ - db/migrations/20180129_create_latest_matrix_for_cv_and_pv.rb
602
+ - db/migrations/20180130_create_materialized_matrix.rb
603
+ - db/migrations/20180131_create_materialized_latest_matrix.rb
604
+ - db/migrations/20180201_create_head_matrix.rb
605
+ - db/migrations/20180202_create_materialized_head_matrix.rb
606
+ - db/migrations/20180203_fix_head_matrix.rb
607
+ - db/migrations/20180204_fix_latest_matrix_for_cv_and_pv.rb
608
+ - db/migrations/20180205_drop_materialized_latest_matrix.rb
609
+ - db/migrations/20180206_recreate_head_matrix_rename_consumer_tag_name.rb
610
+ - db/migrations/20180207_recreate_head_matrix_union_all.rb
611
+ - db/migrations/20180208_add_cv_tag_name_index_to_mat_head_matrix.rb
612
+ - db/migrations/20180209_recreate_latest_matrix_for_cv_and_pv_union_all.rb
613
+ - db/migrations/20180210_fix_latest_matrix_for_cv_and_pv_again.rb
585
614
  - db/migrations/migration_helper.rb
586
615
  - db/pact_broker_database.sqlite3
587
616
  - db/test/backwards_compatibility/.rspec
@@ -646,6 +675,8 @@ files:
646
675
  - lib/pact_broker/api/decorators.rb
647
676
  - lib/pact_broker/api/decorators/base_decorator.rb
648
677
  - lib/pact_broker/api/decorators/basic_pacticipant_decorator.rb
678
+ - lib/pact_broker/api/decorators/dashboard_decorator.rb
679
+ - lib/pact_broker/api/decorators/dashboard_text_decorator.rb
649
680
  - lib/pact_broker/api/decorators/decorator_context.rb
650
681
  - lib/pact_broker/api/decorators/embedded_label_decorator.rb
651
682
  - lib/pact_broker/api/decorators/embedded_tag_decorator.rb
@@ -682,6 +713,7 @@ files:
682
713
  - lib/pact_broker/api/resources/authentication.rb
683
714
  - lib/pact_broker/api/resources/badge.rb
684
715
  - lib/pact_broker/api/resources/base_resource.rb
716
+ - lib/pact_broker/api/resources/dashboard.rb
685
717
  - lib/pact_broker/api/resources/group.rb
686
718
  - lib/pact_broker/api/resources/index.rb
687
719
  - lib/pact_broker/api/resources/label.rb
@@ -723,6 +755,7 @@ files:
723
755
  - lib/pact_broker/config/setting.rb
724
756
  - lib/pact_broker/configuration.rb
725
757
  - lib/pact_broker/constants.rb
758
+ - lib/pact_broker/dashboard/service.rb
726
759
  - lib/pact_broker/date_helper.rb
727
760
  - lib/pact_broker/db.rb
728
761
  - lib/pact_broker/db/migrate.rb
@@ -770,6 +803,7 @@ files:
770
803
  - lib/pact_broker/labels/service.rb
771
804
  - lib/pact_broker/locale/en.yml
772
805
  - lib/pact_broker/logging.rb
806
+ - lib/pact_broker/matrix/head_row.rb
773
807
  - lib/pact_broker/matrix/latest_row.rb
774
808
  - lib/pact_broker/matrix/parse_query.rb
775
809
  - lib/pact_broker/matrix/repository.rb
@@ -798,6 +832,7 @@ files:
798
832
  - lib/pact_broker/services.rb
799
833
  - lib/pact_broker/tags/repository.rb
800
834
  - lib/pact_broker/tags/service.rb
835
+ - lib/pact_broker/tags/tag_with_latest_flag.rb
801
836
  - lib/pact_broker/tasks.rb
802
837
  - lib/pact_broker/tasks/migration_task.rb
803
838
  - lib/pact_broker/tasks/version_task.rb
@@ -813,6 +848,8 @@ files:
813
848
  - lib/pact_broker/ui/view_models/index_item.rb
814
849
  - lib/pact_broker/ui/view_models/index_items.rb
815
850
  - lib/pact_broker/ui/view_models/matrix_line.rb
851
+ - lib/pact_broker/ui/view_models/matrix_lines.rb
852
+ - lib/pact_broker/ui/view_models/matrix_tag.rb
816
853
  - lib/pact_broker/ui/views/clusters/show.haml
817
854
  - lib/pact_broker/ui/views/groups/show.html.erb
818
855
  - lib/pact_broker/ui/views/index/show-with-tags.haml
@@ -826,6 +863,7 @@ files:
826
863
  - lib/pact_broker/verifications/summary_for_consumer_version.rb
827
864
  - lib/pact_broker/verifications/verification_status.rb
828
865
  - lib/pact_broker/version.rb
866
+ - lib/pact_broker/versions/abbreviate_number.rb
829
867
  - lib/pact_broker/versions/parse_semantic_version.rb
830
868
  - lib/pact_broker/versions/repository.rb
831
869
  - lib/pact_broker/versions/service.rb
@@ -867,6 +905,7 @@ files:
867
905
  - public/images/doc-matrix.svg
868
906
  - public/images/doc-text.svg
869
907
  - public/images/favicon.ico
908
+ - public/images/logo@2x.png
870
909
  - public/images/pact-changed-orange.svg
871
910
  - public/images/pact-failed-red.svg
872
911
  - public/images/pact-unknown-lightgrey.svg
@@ -911,6 +950,7 @@ files:
911
950
  - spec/features/delete_webhook_spec.rb
912
951
  - spec/features/edit_webhook_spec.rb
913
952
  - spec/features/execute_webhook_spec.rb
953
+ - spec/features/get_dashboard_spec.rb
914
954
  - spec/features/get_diff_spec.rb
915
955
  - spec/features/get_label_spec.rb
916
956
  - spec/features/get_latest_pact_badge_spec.rb
@@ -948,6 +988,7 @@ files:
948
988
  - spec/fixtures/certificates/key.pem
949
989
  - spec/fixtures/certificates/self-signed.badssl.com.pem
950
990
  - spec/fixtures/consumer-provider.json
991
+ - spec/fixtures/dashboard.json
951
992
  - spec/fixtures/renderer_pact.json
952
993
  - spec/fixtures/update_pacticipant.json
953
994
  - spec/fixtures/updated_pacticipant.json
@@ -964,6 +1005,7 @@ files:
964
1005
  - spec/lib/pact_broker/api/contracts/put_pact_params_contract_spec.rb
965
1006
  - spec/lib/pact_broker/api/contracts/verification_contract_spec.rb
966
1007
  - spec/lib/pact_broker/api/contracts/webhook_contract_spec.rb
1008
+ - spec/lib/pact_broker/api/decorators/dashboard_decorator_spec.rb
967
1009
  - spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
968
1010
  - spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
969
1011
  - spec/lib/pact_broker/api/decorators/embedded_version_decorator_spec.rb
@@ -990,6 +1032,7 @@ files:
990
1032
  - spec/lib/pact_broker/api/renderers/html_pact_renderer_spec.rb
991
1033
  - spec/lib/pact_broker/api/resources/badge_spec.rb
992
1034
  - spec/lib/pact_broker/api/resources/base_resource_spec.rb
1035
+ - spec/lib/pact_broker/api/resources/dashboard_spec.rb
993
1036
  - spec/lib/pact_broker/api/resources/group_spec.rb
994
1037
  - spec/lib/pact_broker/api/resources/latest_pact_spec.rb
995
1038
  - spec/lib/pact_broker/api/resources/latest_verifications_for_consumer_version_spec.rb
@@ -1056,6 +1099,7 @@ files:
1056
1099
  - spec/lib/pact_broker/verifications/service_spec.rb
1057
1100
  - spec/lib/pact_broker/verifications/summary_for_consumer_version_spec.rb
1058
1101
  - spec/lib/pact_broker/verifications/verification_status_spec.rb
1102
+ - spec/lib/pact_broker/versions/abbreviate_number_spec.rb
1059
1103
  - spec/lib/pact_broker/versions/parse_semantic_version_spec.rb
1060
1104
  - spec/lib/pact_broker/versions/repository_spec.rb
1061
1105
  - spec/lib/pact_broker/versions/service_spec.rb
@@ -1069,6 +1113,7 @@ files:
1069
1113
  - spec/lib/rack/pact_broker/add_pact_broker_version_header_spec.rb
1070
1114
  - spec/lib/rack/pact_broker/database_transaction_spec.rb
1071
1115
  - spec/lib/rack/pact_broker/invalid_uri_protection_spec.rb
1116
+ - spec/migrations/20180201_create_head_matrix_spec.rb
1072
1117
  - spec/migrations/23_pact_versions_spec.rb
1073
1118
  - spec/migrations/24_populate_pact_contents_spec.rb
1074
1119
  - spec/migrations/34_latest_tagged_pacts_spec.rb
@@ -1175,6 +1220,7 @@ test_files:
1175
1220
  - spec/features/delete_webhook_spec.rb
1176
1221
  - spec/features/edit_webhook_spec.rb
1177
1222
  - spec/features/execute_webhook_spec.rb
1223
+ - spec/features/get_dashboard_spec.rb
1178
1224
  - spec/features/get_diff_spec.rb
1179
1225
  - spec/features/get_label_spec.rb
1180
1226
  - spec/features/get_latest_pact_badge_spec.rb
@@ -1212,6 +1258,7 @@ test_files:
1212
1258
  - spec/fixtures/certificates/key.pem
1213
1259
  - spec/fixtures/certificates/self-signed.badssl.com.pem
1214
1260
  - spec/fixtures/consumer-provider.json
1261
+ - spec/fixtures/dashboard.json
1215
1262
  - spec/fixtures/renderer_pact.json
1216
1263
  - spec/fixtures/update_pacticipant.json
1217
1264
  - spec/fixtures/updated_pacticipant.json
@@ -1228,6 +1275,7 @@ test_files:
1228
1275
  - spec/lib/pact_broker/api/contracts/put_pact_params_contract_spec.rb
1229
1276
  - spec/lib/pact_broker/api/contracts/verification_contract_spec.rb
1230
1277
  - spec/lib/pact_broker/api/contracts/webhook_contract_spec.rb
1278
+ - spec/lib/pact_broker/api/decorators/dashboard_decorator_spec.rb
1231
1279
  - spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
1232
1280
  - spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
1233
1281
  - spec/lib/pact_broker/api/decorators/embedded_version_decorator_spec.rb
@@ -1254,6 +1302,7 @@ test_files:
1254
1302
  - spec/lib/pact_broker/api/renderers/html_pact_renderer_spec.rb
1255
1303
  - spec/lib/pact_broker/api/resources/badge_spec.rb
1256
1304
  - spec/lib/pact_broker/api/resources/base_resource_spec.rb
1305
+ - spec/lib/pact_broker/api/resources/dashboard_spec.rb
1257
1306
  - spec/lib/pact_broker/api/resources/group_spec.rb
1258
1307
  - spec/lib/pact_broker/api/resources/latest_pact_spec.rb
1259
1308
  - spec/lib/pact_broker/api/resources/latest_verifications_for_consumer_version_spec.rb
@@ -1320,6 +1369,7 @@ test_files:
1320
1369
  - spec/lib/pact_broker/verifications/service_spec.rb
1321
1370
  - spec/lib/pact_broker/verifications/summary_for_consumer_version_spec.rb
1322
1371
  - spec/lib/pact_broker/verifications/verification_status_spec.rb
1372
+ - spec/lib/pact_broker/versions/abbreviate_number_spec.rb
1323
1373
  - spec/lib/pact_broker/versions/parse_semantic_version_spec.rb
1324
1374
  - spec/lib/pact_broker/versions/repository_spec.rb
1325
1375
  - spec/lib/pact_broker/versions/service_spec.rb
@@ -1333,6 +1383,7 @@ test_files:
1333
1383
  - spec/lib/rack/pact_broker/add_pact_broker_version_header_spec.rb
1334
1384
  - spec/lib/rack/pact_broker/database_transaction_spec.rb
1335
1385
  - spec/lib/rack/pact_broker/invalid_uri_protection_spec.rb
1386
+ - spec/migrations/20180201_create_head_matrix_spec.rb
1336
1387
  - spec/migrations/23_pact_versions_spec.rb
1337
1388
  - spec/migrations/24_populate_pact_contents_spec.rb
1338
1389
  - spec/migrations/34_latest_tagged_pacts_spec.rb