diff options
author | Igor <idrozdov@gitlab.com> | 2019-08-09 21:01:55 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-08-09 21:01:55 +0000 |
commit | b99011af62935de0b15e8a314ffb7df1f8a3f303 (patch) | |
tree | f19bc1052fa1cd903a31d6f01489b56ec2bb7ead /spec/fixtures/api/schemas/entities | |
parent | 43b9be9d6cf59a02ea86795a1734848615d38a26 (diff) | |
download | gitlab-ce-b99011af62935de0b15e8a314ffb7df1f8a3f303.tar.gz |
Split MR widget into cached and non-cached serializers
Splits auto-refreshing of MR widget into 2 requests:
- the one which uses etag-caching and invalidates the fields on change
- the one without caching
The idea is to gradually move all the fields to etag-cached endpoint
Diffstat (limited to 'spec/fixtures/api/schemas/entities')
3 files changed, 132 insertions, 128 deletions
diff --git a/spec/fixtures/api/schemas/entities/merge_request_poll_cached_widget.json b/spec/fixtures/api/schemas/entities/merge_request_poll_cached_widget.json new file mode 100644 index 00000000000..e8959307767 --- /dev/null +++ b/spec/fixtures/api/schemas/entities/merge_request_poll_cached_widget.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties" : { + "id": { "type": "integer" }, + "iid": { "type": "integer" }, + "description": { "type": ["string", "null"] }, + "title": { "type": "string" }, + "auto_merge_enabled": { "type": "boolean" }, + "state": { "type": "string" }, + "merge_commit_sha": { "type": ["string", "null"] }, + "short_merge_commit_sha": { "type": ["string", "null"] }, + "merge_error": { "type": ["string", "null"] }, + "merge_status": { "type": "string" }, + "merge_user_id": { "type": ["integer", "null"] }, + "source_branch": { "type": "string" }, + "source_project_id": { "type": "integer" }, + "target_branch": { "type": "string" }, + "target_branch_sha": { "type": "string" }, + "target_project_id": { "type": "integer" }, + "squash": { "type": "boolean" }, + "rebase_in_progress": { "type": "boolean" }, + "default_squash_commit_message": { "type": "string" }, + "commits_count": { "type": ["integer", "null"] }, + "merge_ongoing": { "type": "boolean" }, + "work_in_progress": { "type": "boolean" }, + "has_conflicts": { "type": "boolean" }, + "can_be_merged": { "type": "boolean" }, + "remove_source_branch": { "type": ["boolean", "null"] }, + "source_branch_exists": { "type": "boolean" }, + "branch_missing": { "type": "boolean" }, + "commits_without_merge_commits": { "type": "array" }, + "diff_head_sha": { "type": ["string", "null"] }, + "metrics": { + "oneOf": [ + { "type": "null" }, + { "$ref": "merge_request_metrics.json" } + ] + }, + "diverged_commits_count": { "type": "integer" }, + "target_branch_commits_path": { "type": "string" }, + "target_branch_tree_path": { "type": "string" }, + "merge_commit_path": { "type": ["string", "null"] }, + "source_branch_with_namespace_link": { "type": "string" }, + "source_branch_path": { "type": "string" } + } +} diff --git a/spec/fixtures/api/schemas/entities/merge_request_poll_widget.json b/spec/fixtures/api/schemas/entities/merge_request_poll_widget.json new file mode 100644 index 00000000000..2052892dfa3 --- /dev/null +++ b/spec/fixtures/api/schemas/entities/merge_request_poll_widget.json @@ -0,0 +1,55 @@ +{ + "type": "object", + "properties" : { + "id": { "type": "integer" }, + "iid": { "type": "integer" }, + "description": { "type": ["string", "null"] }, + "title": { "type": "string" }, + "auto_merge_strategy": { "type": ["string", "null"] }, + "available_auto_merge_strategies": { "type": "array" }, + "source_branch_protected": { "type": "boolean" }, + "allow_collaboration": { "type": "boolean"}, + "should_be_rebased": { "type": "boolean" }, + "ff_only_enabled": { "type": ["boolean", false] }, + "merge_user": { "type": ["object", "null"] }, + "pipeline": { "type": ["object", "null"] }, + "merge_pipeline": { "type": ["object", "null"] }, + "default_merge_commit_message": { "type": ["string", "null"] }, + "mergeable": { "type": "boolean" }, + "default_merge_commit_message_with_description": { "type": "string" }, + "mergeable_discussions_state": { "type": "boolean" }, + "project_archived": { "type": "boolean" }, + "only_allow_merge_if_pipeline_succeeds": { "type": "boolean" }, + "has_ci": { "type": "boolean" }, + "ci_status": { "type": ["string", "null"] }, + "cancel_auto_merge_path": { "type": ["string", "null"] }, + "test_reports_path": { "type": ["string", "null"] }, + "can_receive_suggestion": { "type": "boolean" }, + "create_issue_to_resolve_discussions_path": { "type": ["string", "null"] }, + "current_user": { + "type": "object", + "required": [ + "can_remove_source_branch", + "can_revert_on_current_merge_request", + "can_cherry_pick_on_current_merge_request" + ], + "properties": { + "can_remove_source_branch": { "type": "boolean" }, + "can_revert_on_current_merge_request": { "type": ["boolean", "null"] }, + "can_cherry_pick_on_current_merge_request": { "type": ["boolean", "null"] }, + "can_create_note": { "type": "boolean" }, + "can_create_issue": { "type": "boolean" }, + "can_update": { "type": "boolean" } + }, + "additionalProperties": false + }, + "can_push_to_source_branch": { "type": "boolean" }, + "new_blob_path": { "type": ["string", "null"] }, + "rebase_path": { "type": ["string", "null"] }, + "conflict_resolution_path": { "type": ["string", "null"] }, + "remove_wip_path": { "type": ["string", "null"] }, + "merge_path": { "type": ["string", "null"] }, + "cherry_pick_in_fork_path": { "type": ["string", "null"] }, + "revert_in_fork_path": { "type": ["string", "null"] } + } +} diff --git a/spec/fixtures/api/schemas/entities/merge_request_widget.json b/spec/fixtures/api/schemas/entities/merge_request_widget.json index eac1dbc6474..779a47222b7 100644 --- a/spec/fixtures/api/schemas/entities/merge_request_widget.json +++ b/spec/fixtures/api/schemas/entities/merge_request_widget.json @@ -1,132 +1,35 @@ { "type": "object", - "properties" : { - "id": { "type": "integer" }, - "iid": { "type": "integer" }, - "author_id": { "type": "integer" }, - "description": { "type": ["string", "null"] }, - "lock_version": { "type": ["string", "null"] }, - "milestone_id": { "type": ["string", "null"] }, - "position": { "type": "integer" }, - "state": { "type": "string" }, - "title": { "type": "string" }, - "updated_by_id": { "type": ["string", "null"] }, - "created_at": { "type": "string" }, - "updated_at": { "type": "string" }, - "time_estimate": { "type": "integer" }, - "total_time_spent": { "type": "integer" }, - "human_time_estimate": { "type": ["integer", "null"] }, - "human_total_time_spent": { "type": ["integer", "null"] }, - "milestone": { "type": ["object", "null"] }, - "labels": { "type": ["array", "null"] }, - "in_progress_merge_commit_sha": { "type": ["string", "null"] }, - "merge_error": { "type": ["string", "null"] }, - "merge_commit_sha": { "type": ["string", "null"] }, - "short_merge_commit_sha": { "type": ["string", "null"] }, - "merge_params": { "type": ["object", "null"] }, - "merge_status": { "type": "string" }, - "merge_user_id": { "type": ["integer", "null"] }, - "merge_when_pipeline_succeeds": { "type": "boolean" }, - "source_branch": { "type": "string" }, - "source_project_id": { "type": "integer" }, - "source_project_full_path": { "type": ["string", "null"]}, - "target_branch": { "type": "string" }, - "target_project_id": { "type": "integer" }, - "target_project_full_path": { "type": ["string", "null"]}, - "allow_collaboration": { "type": "boolean"}, - "metrics": { - "oneOf": [ - { "type": "null" }, - { "$ref": "merge_request_metrics.json" } - ] - }, - "author": { "type": ["object", "null"] }, - "merge_user": { "type": ["object", "null"] }, - "diff_head_sha": { "type": ["string", "null"] }, - "diff_head_commit_short_id": { "type": ["string", "null"] }, - "default_merge_commit_message": { "type": ["string", "null"] }, - "pipeline": { "type": ["object", "null"] }, - "merge_pipeline": { "type": ["object", "null"] }, - "work_in_progress": { "type": "boolean" }, - "source_branch_exists": { "type": "boolean" }, - "mergeable_discussions_state": { "type": "boolean" }, - "conflicts_can_be_resolved_in_ui": { "type": "boolean" }, - "branch_missing": { "type": "boolean" }, - "commits_count": { "type": ["integer", "null"] }, - "has_conflicts": { "type": "boolean" }, - "can_be_merged": { "type": "boolean" }, - "mergeable": { "type": "boolean" }, - "project_archived": { "type": "boolean" }, - "only_allow_merge_if_pipeline_succeeds": { "type": "boolean" }, - "has_ci": { "type": "boolean" }, - "ci_status": { "type": ["string", "null"] }, - "issues_links": { - "type": "object", - "required": ["closing", "mentioned_but_not_closing", "assign_to_closing"], + "allOf": [ + { "$ref": "merge_request_poll_cached_widget.json" }, + { "$ref": "merge_request_poll_widget.json" }, + { "properties" : { - "closing": { "type": "string" }, - "mentioned_but_not_closing": { "type": "string" }, - "assign_to_closing": { "type": ["string", "null"] } - }, - "additionalProperties": false - }, - "source_branch_with_namespace_link": { "type": "string" }, - "current_user": { - "type": "object", - "required": [ - "can_remove_source_branch", - "can_revert_on_current_merge_request", - "can_cherry_pick_on_current_merge_request" - ], - "properties": { - "can_remove_source_branch": { "type": "boolean" }, - "can_revert_on_current_merge_request": { "type": ["boolean", "null"] }, - "can_cherry_pick_on_current_merge_request": { "type": ["boolean", "null"] }, - "can_create_note": { "type": "boolean" }, - "can_create_issue": { "type": "boolean" }, - "can_update": { "type": "boolean" } - }, - "additionalProperties": false - }, - "target_branch_commits_path": { "type": "string" }, - "target_branch_tree_path": { "type": "string" }, - "source_branch_path": { "type": "string" }, - "conflict_resolution_path": { "type": ["string", "null"] }, - "cancel_merge_when_pipeline_succeeds_path": { "type": ["string", "null"] }, - "create_issue_to_resolve_discussions_path": { "type": ["string", "null"] }, - "merge_path": { "type": ["string", "null"] }, - "cherry_pick_in_fork_path": { "type": ["string", "null"] }, - "revert_in_fork_path": { "type": ["string", "null"] }, - "email_patches_path": { "type": "string" }, - "plain_diff_path": { "type": "string" }, - "merge_request_basic_path": { "type": "string" }, - "merge_request_widget_path": { "type": "string" }, - "new_blob_path": { "type": ["string", "null"] }, - "merge_check_path": { "type": "string" }, - "ci_environments_status_path": { "type": "string" }, - "default_merge_commit_message_with_description": { "type": "string" }, - "default_squash_commit_message": { "type": "string" }, - "commits_without_merge_commits": { "type": "array" }, - "diverged_commits_count": { "type": "integer" }, - "commit_change_content_path": { "type": "string" }, - "merge_commit_path": { "type": ["string", "null"] }, - "remove_wip_path": { "type": ["string", "null"] }, - "commits_count": { "type": "integer" }, - "remove_source_branch": { "type": ["boolean", "null"] }, - "merge_ongoing": { "type": "boolean" }, - "ff_only_enabled": { "type": ["boolean", false] }, - "should_be_rebased": { "type": "boolean" }, - "create_note_path": { "type": ["string", "null"] }, - "preview_note_path": { "type": ["string", "null"] }, - "rebase_commit_sha": { "type": ["string", "null"] }, - "rebase_in_progress": { "type": "boolean" }, - "can_push_to_source_branch": { "type": "boolean" }, - "rebase_path": { "type": ["string", "null"] }, - "squash": { "type": "boolean" }, - "test_reports_path": { "type": ["string", "null"] }, - "can_receive_suggestion": { "type": "boolean" }, - "source_branch_protected": { "type": "boolean" }, - "conflicts_docs_path": { "type": ["string", "null"] }, - "merge_request_pipelines_docs_path": { "type": ["string", "null"] } - } + "merge_params": { "type": ["object", "null"] }, + "source_project_full_path": { "type": ["string", "null"]}, + "target_project_full_path": { "type": ["string", "null"]}, + "email_patches_path": { "type": "string" }, + "plain_diff_path": { "type": "string" }, + "merge_request_basic_path": { "type": "string" }, + "merge_request_widget_path": { "type": "string" }, + "merge_request_cached_widget_path": { "type": "string" }, + "create_note_path": { "type": ["string", "null"] }, + "commit_change_content_path": { "type": "string" }, + "preview_note_path": { "type": ["string", "null"] }, + "conflicts_docs_path": { "type": ["string", "null"] }, + "merge_request_pipelines_docs_path": { "type": ["string", "null"] }, + "ci_environments_status_path": { "type": "string" }, + "issues_links": { + "type": "object", + "required": ["closing", "mentioned_but_not_closing", "assign_to_closing"], + "properties" : { + "closing": { "type": "string" }, + "mentioned_but_not_closing": { "type": "string" }, + "assign_to_closing": { "type": ["string", "null"] } + }, + "additionalProperties": false + } + } + } + ] } |