From patchwork Tue Oct 30 11:19:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 990746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42kq2z2CsKz9s7W for ; Tue, 30 Oct 2018 22:28:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="SGxqkSyn"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42kq2z0cNBzDsG1 for ; Tue, 30 Oct 2018 22:28:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="SGxqkSyn"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=185.234.75.10; helo=relay003.mxroute.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="SGxqkSyn"; dkim-atps=neutral Received: from relay003.mxroute.com (relay003.mxroute.com [185.234.75.10]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42kpsl1XC2zDsGh for ; Tue, 30 Oct 2018 22:20:11 +1100 (AEDT) Received: from relay-ext2.mxrelay.co (relay-ext2.mxrelay.co [159.100.240.208]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay004.mxroute.com (Postfix) with ESMTPS id C61DF3F387 for ; Tue, 30 Oct 2018 11:19:38 +0000 (UTC) Received: from filter001.mxrelay.co (filter001.mxrelay.co [64.52.23.203]) by relay-ext2.mxrelay.co (Postfix) with ESMTP id 5D0033FC3F for ; Tue, 30 Oct 2018 11:19:34 +0000 (UTC) Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter001.mxrelay.co (Postfix) with ESMTPS id 3C97D10007F for ; Tue, 30 Oct 2018 11:19:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uyJjafKW0aJ8S5HA67QlZ5FtQVawDTmzZa70MWPHPyk=; b=SGxqkSyngd7C+Vz92aUq9zN7FP 4EhwhZgj13RKozCnKNrl0w4XZw9wca7ak2rp3suNmrio7NRPOztXMf2lDbpDRQyIXF/qrxtapzq34 Xh+pPhNYrkWTONC7aLO5wo0kOotCZph/1fxcfyn9JzECE0KGNYhgIeuB4tI0W0FBHZNdvDItmV6QA M7yzJos1fqKfuG0b/J2WbQGOSILdYtlzyzV2unQccESFpENNELppgXLfFKOmVQQk3VtJfx11SA+6R OU1Pgd2NbMbNZYC+luoJjaZb9fnBKbG/lDAQuL3kqiwNJqLLbGVUc4GzVTIhgLzMZg+J4VWs7lsvF 2jLszEag==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 16/17] docs: Document the '/events' resource Date: Tue, 30 Oct 2018 11:19:15 +0000 Message-Id: <20181030111916.7342-17-stephen@that.guru> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030111916.7342-1-stephen@that.guru> References: <20181030111916.7342-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This is the final resource to document and also the most complicated, on account of the polymorphism of the responses. However, with this done, our first pass at an OpenAPI 3.0 schema is completed. Signed-off-by: Stephen Finucane --- docs/api/schemas/patchwork.yaml | 266 ++++++++++++++++++++++++++++++++ 1 file changed, 266 insertions(+) diff --git a/docs/api/schemas/patchwork.yaml b/docs/api/schemas/patchwork.yaml index c2064985..cf78a87f 100644 --- a/docs/api/schemas/patchwork.yaml +++ b/docs/api/schemas/patchwork.yaml @@ -197,6 +197,89 @@ paths: $ref: '#/components/schemas/Error' tags: - comments + /api/events/: + get: + description: List events. + operationId: events_list + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/Order' + - $ref: '#/components/parameters/Search' + - $ref: '#/components/parameters/BeforeFilter' + - $ref: '#/components/parameters/SinceFilter' + - in: query + name: project + schema: + description: '' + title: '' + type: string + - in: query + name: category + schema: + description: '' + title: '' + type: string + enum: + - cover-created + - patch-created + - patch-completed + - patch-state-changed + - patch-delegated + - check-created + - series-created + - series-completed + - in: query + name: series + schema: + description: '' + title: '' + type: string + - in: query + name: patch + schema: + description: '' + title: '' + type: string + - in: query + name: cover + schema: + description: '' + title: '' + type: string + responses: + '200': + description: '' + headers: + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + oneOf: + - $ref: '#/components/schemas/EventCoverCreated' + - $ref: '#/components/schemas/EventPatchCreated' + - $ref: '#/components/schemas/EventPatchCompleted' + - $ref: '#/components/schemas/EventPatchStateChanged' + - $ref: '#/components/schemas/EventPatchDelegated' + - $ref: '#/components/schemas/EventCheckCreated' + - $ref: '#/components/schemas/EventSeriesCreated' + - $ref: '#/components/schemas/EventSeriesCompleted' + discriminator: + propertyName: category + mapping: + cover-created: '#/components/schemas/EventCoverCreated' + patch-created: '#/components/schemas/EventPatchCreated' + patch-completed: '#/components/schemas/EventPatchCompleted' + patch-state-changed: '#/components/schemas/EventPatchStateChanged' + patch-delegated: '#/components/schemas/EventPatchDelegated' + check-created: '#/components/schemas/EventCheckCreated' + series-created: '#/components/schemas/EventSeriesCreated' + series-completed: '#/components/schemas/EventSeriesCompleted' + tags: + - events /api/patches/: get: description: List patches. @@ -1270,6 +1353,144 @@ components: type: string readOnly: true minLength: 1 + EventBase: + type: object + properties: + id: + title: ID + type: integer + readOnly: true + category: + title: Category + description: The category of the event. + type: string + readOnly: true + project: + $ref: '#/components/schemas/ProjectEmbedded' + date: + title: Date + description: The time this event was created. + type: string + format: date-time + readOnly: true + payload: + type: object + EventCoverCreated: + allOf: + - $ref: '#/components/schemas/EventBase' + - type: object + properties: + category: + enum: + - cover-created + payload: + properties: + cover: + title: Cover + type: string + readOnly: true + EventPatchCreated: + allOf: + - $ref: '#/components/schemas/EventBase' + - type: object + properties: + category: + enum: + - patch-created + payload: + properties: + patch: + $ref: '#/components/schemas/PatchEmbedded' + EventPatchCompleted: + allOf: + - $ref: '#/components/schemas/EventBase' + - type: object + properties: + category: + enum: + - patch-completed + payload: + properties: + patch: + $ref: '#/components/schemas/PatchEmbedded' + series: + $ref: '#/components/schemas/SeriesEmbedded' + EventPatchStateChanged: + allOf: + - $ref: '#/components/schemas/EventBase' + - type: object + properties: + category: + enum: + - patch-state-changed + payload: + properties: + patch: + $ref: '#/components/schemas/PatchEmbedded' + previous_state: + title: Previous state + type: string + current_state: + title: Current state + type: string + EventPatchDelegated: + allOf: + - $ref: '#/components/schemas/EventBase' + - type: object + properties: + category: + enum: + - patch-delegated + payload: + properties: + patch: + $ref: '#/components/schemas/PatchEmbedded' + previous_delegate: + allOf: + - $ref: '#/components/schemas/UserEmbedded' + - title: Previous delegate + current_delegate: + allOf: + - $ref: '#/components/schemas/UserEmbedded' + - title: Current delegate + EventCheckCreated: + allOf: + - $ref: '#/components/schemas/EventBase' + - type: object + properties: + category: + enum: + - check-created + payload: + properties: + patch: + $ref: '#/components/schemas/PatchEmbedded' + check: + $ref: '#/components/schemas/CheckEmbedded' + EventSeriesCreated: + allOf: + - $ref: '#/components/schemas/EventBase' + - type: object + properties: + category: + enum: + - series-created + payload: + properties: + series: + $ref: '#/components/schemas/SeriesEmbedded' + EventSeriesCompleted: + allOf: + - $ref: '#/components/schemas/EventBase' + - type: object + properties: + category: + enum: + - series-completed + payload: + properties: + series: + $ref: '#/components/schemas/SeriesEmbedded' PatchList: required: - state @@ -1611,6 +1832,51 @@ components: format: email readOnly: true minLength: 1 + CheckEmbedded: + type: object + properties: + id: + title: ID + type: integer + readOnly: true + url: + title: Url + type: string + format: uri + readOnly: true + date: + title: Date + type: string + format: date-time + readOnly: true + state: + title: State + description: The state of the check. + type: string + readOnly: true + enum: + - pending + - success + - warning + - fail + target_url: + title: Target url + description: The target URL to associate with this check. This should be specific + to the patch. + type: string + format: uri + maxLength: 200 + x-nullable: true + readOnly: true + context: + title: Context + description: A label to discern check from checks of other testing systems. + type: string + format: slug + pattern: ^[-a-zA-Z0-9_]+$ + maxLength: 255 + minLength: 1 + readOnly: true CoverLetterEmbedded: type: object properties: