diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-06 12:12:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-06 12:12:20 +0300 |
commit | a6d9ec9567a4f0b6401295e6744ab394fa3b0033 (patch) | |
tree | f864b1123ce9ffe85cfebcd55650c8a867c6eb36 /spec | |
parent | cfe9f9a5b3a338744b3caf1bf55f8fd290618d0e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
6 files changed, 724 insertions, 188 deletions
diff --git a/spec/features/projects/pipelines/legacy_pipelines_spec.rb b/spec/features/projects/pipelines/legacy_pipelines_spec.rb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/spec/features/projects/pipelines/legacy_pipelines_spec.rb +++ /dev/null diff --git a/spec/fixtures/lib/gitlab/import_export/complex/project.json b/spec/fixtures/lib/gitlab/import_export/complex/project.json index 88439965cf3..0bca7b0f494 100644 --- a/spec/fixtures/lib/gitlab/import_export/complex/project.json +++ b/spec/fixtures/lib/gitlab/import_export/complex/project.json @@ -18,7 +18,9 @@ "template": false, "description": "", "type": "ProjectLabel", - "priorities": [] + "priorities": [ + + ] }, { "id": 3, @@ -202,7 +204,9 @@ "author": { "name": "User 4" }, - "events": [], + "events": [ + + ], "award_emoji": [ { "id": 1, @@ -235,7 +239,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 353, @@ -257,7 +263,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 354, @@ -279,7 +287,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 355, @@ -301,7 +311,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 356, @@ -323,7 +335,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 357, @@ -345,7 +359,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 358, @@ -367,7 +383,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "resource_label_events": [ @@ -448,7 +466,9 @@ "confidential": false, "due_date": null, "moved_to_id": null, - "issue_assignees": [], + "issue_assignees": [ + + ], "milestone": { "id": 1, "title": "test milestone", @@ -493,7 +513,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 360, @@ -515,7 +537,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 361, @@ -537,7 +561,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 362, @@ -559,7 +585,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 363, @@ -581,7 +609,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 364, @@ -603,7 +633,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 365, @@ -625,7 +657,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 366, @@ -647,7 +681,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] }, @@ -709,7 +745,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 368, @@ -731,7 +769,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 369, @@ -753,7 +793,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 370, @@ -775,7 +817,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 371, @@ -797,7 +841,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 372, @@ -819,7 +865,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 373, @@ -841,7 +889,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 374, @@ -863,7 +913,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] }, @@ -904,7 +956,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 376, @@ -926,7 +980,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 377, @@ -948,7 +1004,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 378, @@ -970,7 +1028,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 379, @@ -992,7 +1052,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 380, @@ -1014,7 +1076,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 381, @@ -1036,7 +1100,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 382, @@ -1058,7 +1124,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] }, @@ -1099,7 +1167,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 384, @@ -1121,7 +1191,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 385, @@ -1143,7 +1215,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 386, @@ -1165,7 +1239,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 387, @@ -1187,7 +1263,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 388, @@ -1209,7 +1287,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 389, @@ -1231,7 +1311,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 390, @@ -1253,7 +1335,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] }, @@ -1294,7 +1378,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 392, @@ -1316,7 +1402,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 393, @@ -1338,7 +1426,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 394, @@ -1360,7 +1450,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 395, @@ -1382,7 +1474,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 396, @@ -1404,7 +1498,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 397, @@ -1426,7 +1522,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 398, @@ -1448,7 +1546,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] }, @@ -1489,7 +1589,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 400, @@ -1511,7 +1613,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 401, @@ -1533,7 +1637,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 402, @@ -1555,7 +1661,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 403, @@ -1577,7 +1685,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 404, @@ -1599,7 +1709,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 405, @@ -1621,7 +1733,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 406, @@ -1643,7 +1757,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] }, @@ -1684,7 +1800,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 408, @@ -1706,7 +1824,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 409, @@ -1728,7 +1848,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 410, @@ -1750,7 +1872,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 411, @@ -1772,7 +1896,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 412, @@ -1794,7 +1920,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 413, @@ -1816,7 +1944,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 414, @@ -1838,7 +1968,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] }, @@ -1879,7 +2011,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 416, @@ -1901,7 +2035,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 417, @@ -1923,7 +2059,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 418, @@ -1945,7 +2083,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 419, @@ -1967,7 +2107,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 420, @@ -1989,7 +2131,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 421, @@ -2011,7 +2155,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 422, @@ -2033,7 +2179,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] }, @@ -2084,7 +2232,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 424, @@ -2106,7 +2256,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 425, @@ -2128,7 +2280,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 426, @@ -2150,7 +2304,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 427, @@ -2172,7 +2328,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 428, @@ -2194,7 +2352,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 429, @@ -2216,7 +2376,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 430, @@ -2238,7 +2400,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ] } @@ -2378,7 +2542,9 @@ "author": { "name": "Random name" }, - "events": [], + "events": [ + + ], "award_emoji": [ { "id": 12, @@ -2652,7 +2818,9 @@ "author": { "name": "User 4" }, - "award_emoji": [], + "award_emoji": [ + + ], "system_note_metadata": { "id": 4789, "commit_count": 3, @@ -2660,8 +2828,12 @@ "created_at": "2020-03-28T12:47:33.461Z", "updated_at": "2020-03-28T12:47:33.461Z" }, - "events": [], - "suggestions": [] + "events": [ + + ], + "suggestions": [ + + ] }, { "id": 670, @@ -2691,7 +2863,9 @@ "author": { "name": "User 4" }, - "award_emoji": [], + "award_emoji": [ + + ], "system_note_metadata": { "id": 4790, "commit_count": null, @@ -2699,8 +2873,12 @@ "created_at": "2020-03-28T12:48:36.951Z", "updated_at": "2020-03-28T12:48:36.951Z" }, - "events": [], - "suggestions": [] + "events": [ + + ], + "suggestions": [ + + ] }, { "id": 671, @@ -2724,7 +2902,9 @@ "author": { "name": "User 4" }, - "events": [], + "events": [ + + ], "award_emoji": [ { "id": 1, @@ -2757,7 +2937,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 673, @@ -2779,7 +2961,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 674, @@ -2801,7 +2985,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [], + "events": [ + + ], "suggestions": [ { "id": 1, @@ -2837,7 +3023,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 676, @@ -2859,7 +3047,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 677, @@ -2881,7 +3071,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 678, @@ -2903,7 +3095,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "resource_label_events": [ @@ -3332,7 +3526,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 680, @@ -3354,7 +3550,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 681, @@ -3376,7 +3574,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 682, @@ -3398,7 +3598,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 683, @@ -3420,7 +3622,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 684, @@ -3442,7 +3646,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 685, @@ -3464,7 +3670,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 686, @@ -3486,7 +3694,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "merge_request_diff": { @@ -3553,9 +3763,15 @@ "author_id": 1 } ], - "merge_request_assignees": [], - "merge_request_reviewers": [], - "approvals": [] + "merge_request_assignees": [ + + ], + "merge_request_reviewers": [ + + ], + "approvals": [ + + ] }, { "id": 15, @@ -3602,7 +3818,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 778, @@ -3624,7 +3842,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 779, @@ -3646,7 +3866,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 780, @@ -3668,7 +3890,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 781, @@ -3690,7 +3914,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 782, @@ -3712,7 +3938,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 783, @@ -3734,7 +3962,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 784, @@ -3756,7 +3986,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "merge_request_diff": { @@ -3869,7 +4101,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 786, @@ -3891,7 +4125,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 787, @@ -3913,7 +4149,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 788, @@ -3935,7 +4173,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 789, @@ -3957,7 +4197,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 790, @@ -3979,7 +4221,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 791, @@ -4001,7 +4245,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 792, @@ -4023,7 +4269,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "merge_request_diff": { @@ -4656,7 +4904,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 795, @@ -4678,7 +4928,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 796, @@ -4700,7 +4952,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 797, @@ -4722,7 +4976,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 798, @@ -4744,7 +5000,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 799, @@ -4766,7 +5024,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 800, @@ -4788,7 +5048,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "merge_request_diff": { @@ -5203,7 +5465,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 802, @@ -5225,7 +5489,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 803, @@ -5247,7 +5513,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 804, @@ -5269,7 +5537,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 805, @@ -5291,7 +5561,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 806, @@ -5313,7 +5585,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 807, @@ -5335,7 +5609,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 808, @@ -5357,7 +5633,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "merge_request_diff": { @@ -5727,7 +6005,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 810, @@ -5749,7 +6029,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 811, @@ -5771,7 +6053,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 812, @@ -5793,7 +6077,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 813, @@ -5815,7 +6101,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 814, @@ -5837,7 +6125,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 815, @@ -5859,7 +6149,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 816, @@ -5881,14 +6173,20 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "merge_request_diff": { "id": 11, "state": "empty", - "merge_request_diff_commits": [], - "merge_request_diff_files": [], + "merge_request_diff_commits": [ + + ], + "merge_request_diff_files": [ + + ], "merge_request_id": 11, "created_at": "2016-06-14T15:02:23.772Z", "updated_at": "2016-06-14T15:02:23.833Z", @@ -5963,7 +6261,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 818, @@ -5985,7 +6285,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 819, @@ -6007,7 +6309,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 820, @@ -6029,7 +6333,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 821, @@ -6051,7 +6357,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 822, @@ -6073,7 +6381,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 823, @@ -6095,7 +6405,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 824, @@ -6117,7 +6429,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "merge_request_diff": { @@ -6716,7 +7030,9 @@ "author": { "name": "User 4" }, - "events": [] + "events": [ + + ] }, { "id": 826, @@ -6738,7 +7054,9 @@ "author": { "name": "User 3" }, - "events": [] + "events": [ + + ] }, { "id": 827, @@ -6760,7 +7078,9 @@ "author": { "name": "User 0" }, - "events": [] + "events": [ + + ] }, { "id": 828, @@ -6782,7 +7102,9 @@ "author": { "name": "Ottis Schuster II" }, - "events": [] + "events": [ + + ] }, { "id": 829, @@ -6804,7 +7126,9 @@ "author": { "name": "Rhett Emmerich IV" }, - "events": [] + "events": [ + + ] }, { "id": 830, @@ -6826,7 +7150,9 @@ "author": { "name": "Burdette Bernier" }, - "events": [] + "events": [ + + ] }, { "id": 831, @@ -6848,7 +7174,9 @@ "author": { "name": "Ari Wintheiser" }, - "events": [] + "events": [ + + ] }, { "id": 832, @@ -6870,7 +7198,9 @@ "author": { "name": "Administrator" }, - "events": [] + "events": [ + + ] } ], "merge_request_diff": { @@ -7474,7 +7804,9 @@ "started_at": null, "finished_at": null, "duration": null, - "stages": [] + "stages": [ + + ] }, { "id": 20, @@ -7492,7 +7824,9 @@ "started_at": null, "finished_at": null, "duration": null, - "stages": [], + "stages": [ + + ], "source": "external_pull_request_event", "external_pull_request": { "id": 3, @@ -7535,8 +7869,12 @@ "keep_n": 100, "enabled": false }, - "deploy_keys": [], - "hooks": [], + "deploy_keys": [ + + ], + "hooks": [ + + ], "protected_branches": [ { "id": 1, @@ -7791,7 +8129,9 @@ "description": null, "group_id": null, "type": "ProjectLabel", - "priorities": [] + "priorities": [ + + ] } }, { @@ -7847,4 +8187,4 @@ "commit_committer_check": true, "regexp_uses_re2": true } -}
\ No newline at end of file +} diff --git a/spec/frontend/packages_and_registries/settings/project/settings/components/packages_cleanup_policy_form_spec.js b/spec/frontend/packages_and_registries/settings/project/settings/components/packages_cleanup_policy_form_spec.js index daf0ee85fdf..0fbbf4ae58f 100644 --- a/spec/frontend/packages_and_registries/settings/project/settings/components/packages_cleanup_policy_form_spec.js +++ b/spec/frontend/packages_and_registries/settings/project/settings/components/packages_cleanup_policy_form_spec.js @@ -11,6 +11,7 @@ import { KEEP_N_DUPLICATED_PACKAGE_FILES_LABEL, KEEP_N_DUPLICATED_PACKAGE_FILES_DESCRIPTION, } from '~/packages_and_registries/settings/project/constants'; +import packagesCleanupPolicyQuery from '~/packages_and_registries/settings/project/graphql/queries/get_packages_cleanup_policy.query.graphql'; import updatePackagesCleanupPolicyMutation from '~/packages_and_registries/settings/project/graphql/mutations/update_packages_cleanup_policy.mutation.graphql'; import Tracking from '~/tracking'; import { packagesCleanupPolicyPayload, packagesCleanupPolicyMutationPayload } from '../mock_data'; @@ -39,10 +40,13 @@ describe('Packages Cleanup Policy Settings Form', () => { label: 'packages_cleanup_policies', }; + const defaultQueryResolver = jest.fn().mockResolvedValue(packagesCleanupPolicyPayload()); + const findForm = () => wrapper.findComponent({ ref: 'form-element' }); const findSaveButton = () => wrapper.findByTestId('save-button'); const findKeepNDuplicatedPackageFilesDropdown = () => wrapper.findByTestId('keep-n-duplicated-package-files-dropdown'); + const findNextRunAt = () => wrapper.findByTestId('next-run-at'); const submitForm = async () => { findForm().trigger('submit'); @@ -77,10 +81,14 @@ describe('Packages Cleanup Policy Settings Form', () => { const mountComponentWithApollo = ({ provide = defaultProvidedValues, + queryResolver = defaultQueryResolver, mutationResolver, queryPayload = packagesCleanupPolicyPayload(), } = {}) => { - const requestHandlers = [[updatePackagesCleanupPolicyMutation, mutationResolver]]; + const requestHandlers = [ + [updatePackagesCleanupPolicyMutation, mutationResolver], + [packagesCleanupPolicyQuery, queryResolver], + ]; fakeApollo = createMockApollo(requestHandlers); @@ -160,6 +168,40 @@ describe('Packages Cleanup Policy Settings Form', () => { }); }); + describe('nextRunAt', () => { + it('when present renders time until next package cleanup', () => { + jest.spyOn(Date, 'now').mockImplementation(() => new Date('2063-04-04T00:42:00Z').getTime()); + + mountComponent({ + props: { value: { ...defaultProps.value, nextRunAt: '2063-04-04T02:42:00Z' } }, + }); + + expect(findNextRunAt().text()).toMatchInterpolatedText( + 'Packages and assets will not be deleted until cleanup runs in about 2 hours.', + ); + }); + + it('renders message for cleanup when its before current date', () => { + jest.spyOn(Date, 'now').mockImplementation(() => new Date('2063-04-04T00:42:00Z').getTime()); + + mountComponent({ + props: { value: { ...defaultProps.value, nextRunAt: '2063-03-04T00:42:00Z' } }, + }); + + expect(findNextRunAt().text()).toMatchInterpolatedText( + 'Packages and assets cleanup is ready to be executed when the next cleanup job runs.', + ); + }); + + it('when null hides time until next package cleanup', () => { + mountComponent({ + props: { value: { ...defaultProps.value, nextRunAt: null } }, + }); + + expect(findNextRunAt().exists()).toBe(false); + }); + }); + describe('form', () => { describe('actions', () => { describe('submit button', () => { @@ -209,7 +251,7 @@ describe('Packages Cleanup Policy Settings Form', () => { }); describe('form submit event', () => { - it('dispatches the correct apollo mutation', () => { + it('dispatches the correct apollo mutation and refetches query', async () => { const mutationResolver = jest .fn() .mockResolvedValue(packagesCleanupPolicyMutationPayload()); @@ -225,6 +267,12 @@ describe('Packages Cleanup Policy Settings Form', () => { projectPath: 'path', }, }); + + await waitForPromises(); + + expect(defaultQueryResolver).toHaveBeenCalledWith({ + projectPath: 'path', + }); }); it('tracks the submit event', () => { @@ -251,6 +299,18 @@ describe('Packages Cleanup Policy Settings Form', () => { expect(wrapper.vm.$toast.show).toHaveBeenCalledWith(UPDATE_SETTINGS_SUCCESS_MESSAGE); }); + it('shows error toast when mutation responds with errors', async () => { + mountComponentWithApollo({ + mutationResolver: jest + .fn() + .mockResolvedValue(packagesCleanupPolicyMutationPayload({ errors: [new Error()] })), + }); + + await submitForm(); + + expect(wrapper.vm.$toast.show).toHaveBeenCalledWith(UPDATE_SETTINGS_ERROR_MESSAGE); + }); + describe('when submit fails', () => { it('shows an error', async () => { mountComponentWithApollo({ diff --git a/spec/lib/gitlab/background_migration/nullify_creator_id_column_of_orphaned_projects_spec.rb b/spec/lib/gitlab/background_migration/nullify_creator_id_column_of_orphaned_projects_spec.rb new file mode 100644 index 00000000000..a8574411957 --- /dev/null +++ b/spec/lib/gitlab/background_migration/nullify_creator_id_column_of_orphaned_projects_spec.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Gitlab::BackgroundMigration::NullifyCreatorIdColumnOfOrphanedProjects, feature_category: :projects do + let(:users) { table(:users) } + let(:projects) { table(:projects) } + let(:namespaces) { table(:namespaces) } + + let(:user_1) { users.create!(name: 'user_1', email: 'user_1@example.com', projects_limit: 4) } + let(:user_2) { users.create!(name: 'user_2', email: 'user_2@example.com', projects_limit: 4) } + let(:user_3) { users.create!(name: 'user_3', email: 'user_3@example.com', projects_limit: 4) } + + let!(:group) do + namespaces.create!( + name: 'Group1', type: 'Group', path: 'space1' + ) + end + + let!(:project_namespace_1) do + namespaces.create!( + name: 'project_1', path: 'project_1', type: 'Project' + ) + end + + let!(:project_namespace_2) do + namespaces.create!( + name: 'project_2', path: 'project_2', type: 'Project' + ) + end + + let!(:project_namespace_3) do + namespaces.create!( + name: 'project_3', path: 'project_3', type: 'Project' + ) + end + + let!(:project_namespace_4) do + namespaces.create!( + name: 'project_4', path: 'project_4', type: 'Project' + ) + end + + let!(:project_1) do + projects.create!( + name: 'project_1', path: 'project_1', namespace_id: group.id, project_namespace_id: project_namespace_1.id, + creator_id: user_1.id + ) + end + + let!(:project_2) do + projects.create!( + name: 'project_2', path: 'project_2', namespace_id: group.id, project_namespace_id: project_namespace_2.id, + creator_id: user_2.id + ) + end + + let!(:project_3) do + projects.create!( + name: 'project_3', path: 'project_3', namespace_id: group.id, project_namespace_id: project_namespace_3.id, + creator_id: user_3.id + ) + end + + let!(:project_4) do + projects.create!( + name: 'project_4', path: 'project_4', namespace_id: group.id, project_namespace_id: project_namespace_4.id, + creator_id: nil + ) + end + + subject do + described_class.new( + start_id: project_1.id, + end_id: project_4.id, + batch_table: :projects, + batch_column: :id, + sub_batch_size: 1, + pause_ms: 0, + connection: ApplicationRecord.connection + ).perform + end + + it 'nullifies the `creator_id` column of projects whose creators do not exist' do + # `delete` `user_3` so that the creator of `project_3` is removed, without invoking `dependent: :nullify` on `User` + user_3.delete + + expect { subject }.to change { projects.where(creator_id: nil).count }.from(1).to(2) + end +end diff --git a/spec/migrations/20230130073109_nullify_creator_id_of_orphaned_projects_spec.rb b/spec/migrations/20230130073109_nullify_creator_id_of_orphaned_projects_spec.rb new file mode 100644 index 00000000000..9d4d50fab54 --- /dev/null +++ b/spec/migrations/20230130073109_nullify_creator_id_of_orphaned_projects_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe NullifyCreatorIdOfOrphanedProjects, feature_category: :projects do + let!(:migration) { described_class::MIGRATION } + + describe '#up' do + it 'schedules background migration' do + migrate! + + expect(migration).to have_scheduled_batched_migration( + table_name: :projects, + column_name: :id, + interval: described_class::INTERVAL, + batch_size: described_class::BATCH_SIZE, + max_batch_size: described_class::MAX_BATCH_SIZE, + sub_batch_size: described_class::SUB_BATCH_SIZE + ) + end + end + + describe '#down' do + it 'removes scheduled background migrations' do + migrate! + schema_migrate_down! + + expect(migration).not_to have_scheduled_batched_migration + end + end +end diff --git a/spec/rubocop/cop/rspec/invalid_feature_category_spec.rb b/spec/rubocop/cop/rspec/invalid_feature_category_spec.rb index e60cbe2d3ca..d7b52ebbc39 100644 --- a/spec/rubocop/cop/rspec/invalid_feature_category_spec.rb +++ b/spec/rubocop/cop/rspec/invalid_feature_category_spec.rb @@ -9,42 +9,56 @@ RSpec.describe RuboCop::Cop::RSpec::InvalidFeatureCategory, feature_category: :t shared_examples 'feature category validation' do |valid_category| it 'flags invalid feature category in top level example group' do expect_offense(<<~RUBY, invalid: invalid_category) - RSpec.describe 'foo', feature_category: :%{invalid}, foo: :bar do - ^^{invalid} Please use a valid feature category. See https://docs.gitlab.com/ee/development/feature_categorization/#rspec-examples. - end + RSpec.describe 'foo', feature_category: :%{invalid}, foo: :bar do + ^^{invalid} Please use a valid feature category. See https://docs.gitlab.com/ee/development/feature_categorization/#rspec-examples. + end RUBY end it 'flags invalid feature category in nested context' do expect_offense(<<~RUBY, valid: valid_category, invalid: invalid_category) - RSpec.describe 'foo', feature_category: :%{valid} do - context 'bar', foo: :bar, feature_category: :%{invalid} do - ^^{invalid} Please use a valid feature category. See https://docs.gitlab.com/ee/development/feature_categorization/#rspec-examples. + RSpec.describe 'foo', feature_category: :%{valid} do + context 'bar', foo: :bar, feature_category: :%{invalid} do + ^^{invalid} Please use a valid feature category. See https://docs.gitlab.com/ee/development/feature_categorization/#rspec-examples. + end end - end RUBY end it 'flags invalid feature category in examples' do expect_offense(<<~RUBY, valid: valid_category, invalid: invalid_category) - RSpec.describe 'foo', feature_category: :%{valid} do - it 'bar', feature_category: :%{invalid} do - ^^{invalid} Please use a valid feature category. See https://docs.gitlab.com/ee/development/feature_categorization/#rspec-examples. + RSpec.describe 'foo', feature_category: :%{valid} do + it 'bar', feature_category: :%{invalid} do + ^^{invalid} Please use a valid feature category. See https://docs.gitlab.com/ee/development/feature_categorization/#rspec-examples. + end end - end RUBY end it 'does not flag if feature category is valid' do expect_no_offenses(<<~RUBY) - RSpec.describe 'foo', feature_category: :#{valid_category} do - context 'bar', feature_category: :#{valid_category} do - it 'baz', feature_category: :#{valid_category} do + RSpec.describe 'foo', feature_category: :#{valid_category} do + context 'bar', feature_category: :#{valid_category} do + it 'baz', feature_category: :#{valid_category} do + end end end - end RUBY end + + it 'suggests an alternative' do + mistyped = make_typo(valid_category) + + expect_offense(<<~RUBY, invalid: mistyped, valid: valid_category) + RSpec.describe 'foo', feature_category: :%{invalid} do + ^^{invalid} Please use a valid feature category. Did you mean `:%{valid}`? See [...] + end + RUBY + end + + def make_typo(string) + "#{string}#{string[-1]}" + end end let(:invalid_category) { :invalid_category } |