Page MenuHomePhabricator

[components-api] Develop the webhook mechanism to trigger a deployment
Closed, ResolvedPublic

Description

This task is to implement a webhook triggering mechanism for the component-api (API only), this requires:

  • Exposing an endpoint to the components api for external webhook calls - this might require either exposing the toolforge APIs (would be nicer, but might take longer) or only exposing the webhook endpoint on the proxies.
  • Adding a deployment token management system to the components API
  • Component selection is left for later

The user experience would be something like (not to be implemented in this task, cli comes later):

> toolforge component deploy-token get  # shows the current token
token: 1234567890
webhook urls:
   all components: https://api.svc.toolforge.org/tool/<mytool>/deployment?token=1234567890


> toolforge component deploy-token new  # creates a new token or regenerates an existing one and shows it
Generated new token:
token: 0987654321
webhook urls:
   all components: https://api.svc.toolforge.org/tool/<mytool>/deployment?token=0987654321

The token should be a uuid64.

The webhook url should not allow any other parameters, it should use the already existing configuration or fail with a message if no configuration has been set yet (and that should be done in the cli for now).

The webhook url should return the deployment ID for now, we can add a follow option later on after we sort out the background processing tasks.

Tokens should have an expiry date of ~1y (for starters, we can adapt later)

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
deploy: add support for deployment tokensrepos/cloud/toolforge/components-api!29sstefanovaslavina/k8s-storage-for-deploy-tokenmain
allow backend carepos/cloud/toolforge/api-gateway!44dcaroallow_backend_camain
deployment: add mock storage support for tokensrepos/cloud/toolforge/components-api!25sstefanovaslavina/add-token-endpointsmain
Customize query in GitLab

Related Objects

StatusSubtypeAssignedTask
ResolvedLucasWerkmeister
Resolvedmatmarex
ResolvedLegoktm
ResolvedLegoktm
In Progressdcaro
Resolvedkomla
Resolveddcaro
Resolveddcaro
Resolveddcaro
ResolvedSlst2020
Resolveddcaro
ResolvedSlst2020
ResolvedSlst2020
Resolveddcaro
ResolvedSlst2020

Event Timeline

dcaro renamed this task from [component-api] Develop the webhook mechanism to trigger a deploy (unrefined) to [component-api] Develop the webhook mechanism to trigger a deploment.Apr 10 2024, 11:19 AM
dcaro triaged this task as High priority.
dcaro updated the task description. (Show Details)
Slst2020 renamed this task from [component-api] Develop the webhook mechanism to trigger a deploment to [component-api] Develop the webhook mechanism to trigger a deployment.Apr 12 2024, 6:57 AM
dcaro renamed this task from [component-api] Develop the webhook mechanism to trigger a deployment to [components-api] Develop the webhook mechanism to trigger a deployment.Apr 16 2024, 12:29 PM
dcaro changed the task status from Open to In Progress.Oct 9 2024, 4:52 PM
dcaro edited projects, added: Toolforge (Toolforge iteration 15); removed: Toolforge.
dcaro moved this task from Next Up to In Progress on the Toolforge (Toolforge iteration 15) board.

Change #1078986 had a related patch set uploaded (by David Caro; author: David Caro):

[operations/puppet@production] p:toolforge::proxy: add toolforge api site config

https://gerrit.wikimedia.org/r/1078986

Change #1078986 merged by David Caro:

[operations/puppet@production] p:toolforge::proxy: add toolforge api site config

https://gerrit.wikimedia.org/r/1078986

project_1317_bot_df3177307bed93c3f34e421e26c86e38 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/557

api-gateway: bump to 0.0.47-20241015155745-4efeb021

project_1317_bot_df3177307bed93c3f34e421e26c86e38 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/560

api-gateway: bump to 0.0.48-20241015170548-67c41c8d

project_1317_bot_df3177307bed93c3f34e421e26c86e38 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/584

components-api: bump to 0.0.48-20241010123512-f12ab9d2

dcaro moved this task from In Review to Done on the Toolforge (Toolforge iteration 16) board.

project_1317_bot_df3177307bed93c3f34e421e26c86e38 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/587

api-gateway: bump to 0.0.54-20241111133126-cf520466