Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions api/src/shipit_api/admin/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,142 @@ paths:
state:
type: string
enum: [ready, missing]
/merge-automation:
get:
summary: Get the list of merge automations for the given product
operationId: shipit_api.admin.merge_automation.list_merge_automation
parameters:
- name: product
in: query
description: product_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the product here work? It probably doesn't make sense to have separate merge automation for firefox/devedition/firefox-android? [nevermind, I see we return 400 if there's no merge-behaviors defined for the passed-in product, and we only define it for firefox]

required: true
schema:
$ref: '#/components/schemas/ProductInput'
responses:
"200":
description: The list of merge automations triggered for this product, limited to the 20 more recent
content:
application/json:
schema:
type: object
post:
summary: Submit a new merge automation for the given product
operationId: shipit_api.admin.merge_automation.submit_merge_automation
requestBody:
description: Merge automation object
content:
application/json:
schema:
$ref: '#/components/schemas/MergeAutomationInput'
required: true
responses:
"201":
description: The merge automation has been successfully submitted
"405":
description: Invalid input
/merge-automation/{automation_id}:
delete:
summary: Cancel a merge automation
operationId: shipit_api.admin.merge_automation.cancel_merge_automation
parameters:
- name: automation_id
in: path
description: automation id
required: true
schema:
type: integer
responses:
"200":
description: Merge automation cancelled successfully
"404":
description: Merge automation not found
patch:
summary: Mark merge automation as completed
operationId: shipit_api.admin.merge_automation.mark_merge_automation_completed
parameters:
- name: automation_id
in: path
description: automation id
required: true
schema:
type: integer
responses:
"200":
description: Merge automation marked as completed
"400":
description: Merge automation cannot be marked as completed
"404":
description: Merge automation not found
/merge-automation/{automation_id}/start:
post:
summary: Start a pending merge automation
operationId: shipit_api.admin.merge_automation.start_merge_automation
parameters:
- name: automation_id
in: path
description: automation id
required: true
schema:
type: integer
responses:
"200":
description: Merge automation started successfully
"404":
description: Merge automation not found
"400":
description: Merge automation cannot be started
/merge-automation/{automation_id}/task-status:
get:
summary: Get taskcluster task status for a merge automation
operationId: shipit_api.admin.merge_automation.get_merge_automation_task_status
parameters:
- name: automation_id
in: path
description: automation id
required: true
schema:
type: integer
responses:
"200":
description: Task status retrieved successfully
content:
application/json:
schema:
type: object
properties:
task_id:
type: string
state:
type: string
enum: [ready, missing]
automation:
type: object
decisionTask:
type: object
taskGroup:
type: object
"404":
description: Merge automation not found
/merge-automation/behaviors/{product}:
get:
summary: Get the list of available merge behaviors for the given product
operationId: shipit_api.admin.merge_automation.list_behaviors
parameters:
- name: product
in: path
description: product name
required: true
schema:
$ref: '#/components/schemas/ProductInput'
responses:
"200":
description: The list of available merge behaviors
content:
application/json:
schema:
type: object
"404":
description: No merge behaviors found for the given product
/product-details:
post:
summary: Trigger a rebuild of product details
Expand Down Expand Up @@ -839,6 +975,24 @@ paths:

components:
schemas:
MergeAutomationInput:
required:
- product
- behavior
- revision
- dryRun
type: object
properties:
product:
$ref: '#/components/schemas/ProductInput'
behavior:
type: string
example: beta-to-release
revision:
type: string
example: 706aadff79254a41b5b5d9616b51d8365cbae573
dryRun:
type: boolean
ReleaseInput:
required:
- branch
Expand Down
2 changes: 2 additions & 0 deletions api/src/shipit_api/admin/auth0.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def _get_auth0_scopes(product_name, product_config):
scopes = [
f"add_release/{product_name}",
f"abandon_release/{product_name}",
f"add_merge_automation/{product_name}",
f"cancel_merge_automation/{product_name}",
]
phases = [f["name"] for f in SUPPORTED_FLAVORS.get(product_name, [])]
if product_name == "firefox":
Expand Down
Loading