metrik icon indicating copy to clipboard operation
metrik copied to clipboard

[Github Actions] Make workflow configurable in pipeline config

Open LixingSun opened this issue 2 years ago • 1 comments

Describe the context of this enhancement Currently for Github Actions project, by default for backend it will fetch all workflow for the repo. However in some cases not all workflow are meaningful and never be cared to visualize (e.g. scanning, specific testing, spiking ,etc.). If we could exclude these unimportant workflows, we could speed up the data sync as well as reduce some potential issue may have due to them.

Describe the solution you'd like Enable workflow configuration in the pipeline config.

Task 1: Specify workflows when create Github Actions pipeline

  • (FE) Enhance the pipeline config UI with a section below Personal Access Token
  • (FE) Once user clicks Verify button and verify successfully, a workflow API is also triggered to visualize the list of existing workflows
  • (FE) User is able to select the workflows that they are interested in
  • (BE) createPipeline(POST /project/{projectId}/pipeline) API accepts the additional configuration about workflow selections and store into DB

Task 2: Update workflows when configure Github Actions pipeline

  • (FE) Display workflow config once Pipeline config popup is triggered, and initially fetch the latest workflow list
  • (FE) User is able to update the workflow select and make an update
  • (FE) Once URL/Personal Access Token is updated, the "Verify" triggering will update the workflow list accordingly
  • (BE) getPipeline (GET /project/{projectId}/pipeline/{pipelineId}) API returns the additional configuration about workflow selections from DB
  • (BE) updatePipeline (PUT /project/{projectId}/pipeline/{pipelineId}) API accepts the additional configuration about workflow selections and store into DB

Task 3: Sync data with only configured workflows

  • (BE) Replace querying all runs to query only the configured workflows' run by the workflow run API
  • (BE) For compatibility, if workflows are not configured yet when the sync is triggered, keep to query all runs

Additional context The config of workflow need to store both workflow name and workflow id.

UI position for the new config: image

LixingSun avatar May 30 '22 07:05 LixingSun

I have one workflow deploying to multiple environments, actually the one provided in input (in my case I have only one prod server). Therefore what I'm missing is to select the environment I want to measure on. I don't like to duplicate a workflow for a prod, because I want to ensure this workflow runs fine on lower environments.

pberthonneau avatar Jun 20 '22 17:06 pberthonneau