opendevstack / ods-provisioning-app

Provisioning app, which triggers project and component provisions (including Jira / Confluence / BitBucket and OCP resource creation)
Apache License 2.0
15 stars 20 forks source link

API DELETE*: wrong jenkins run job (lastExecutionJobs) returned #710

Closed clemensutschig closed 2 years ago

clemensutschig commented 2 years ago

Describe the bug The API for delete* does not return the right execution list of jobs

To Reproduce

  1. provision project and component
  2. use DELETE_COMPONENT API
  3. notice lastExecutionJobs still containing the provision job (and not the new delete component one)

Expected behavior lastExecutionJobs to contain the right jenkins run link

Affected version (please complete the following information):

Log Output (ensure to remove any confidential information like tokens, project names, etc. provision via api (response)

 create or update project, or delete component - PUT
[2021-11-26T03:22:19.068Z]     amazon-ebs: ... PUT project request payload loaded from 'fixtures/create-component-request.json'
[2021-11-26T03:22:19.068Z]     amazon-ebs:
[2021-11-26T03:22:19.068Z]     amazon-ebs: ... displaying payload file content:
[2021-11-26T03:22:19.068Z]     amazon-ebs: {
[2021-11-26T03:22:19.068Z]     amazon-ebs:   "projectKey" : "ODSVERIFY",
[2021-11-26T03:22:19.068Z]     amazon-ebs:   "quickstarters" : [
[2021-11-26T03:22:19.068Z]     amazon-ebs:     {
[2021-11-26T03:22:19.068Z]     amazon-ebs:       "component_type" : "docker-plain",
[2021-11-26T03:22:19.068Z]     amazon-ebs:       "component_id" : "plain"
[2021-11-26T03:22:19.068Z]     amazon-ebs:     }
[2021-11-26T03:22:19.068Z]     amazon-ebs:   ]
[2021-11-26T03:22:19.068Z]     amazon-ebs: }
[2021-11-26T03:22:19.068Z]     amazon-ebs:
[2021-11-26T03:22:19.068Z]     amazon-ebs: curl PUT request successful...
[2021-11-26T03:22:19.068Z]     amazon-ebs:
[2021-11-26T03:22:19.068Z]     amazon-ebs: ... displaying HTTP response body (content from './response.txt'):

-- omitted --- 

[2021-11-26T03:22:19.068Z]     amazon-ebs: {"lastExecutionJobs":[{"name":"odsverify-cd-ods-qs-plain-master","url":"https://jenkins-odsverify-cd.ocp.odsbox.lan/job/odsverify-cd/job/odsverify-cd-ods-qs-plain-master/1"}]
[2021-11-26T03:22:19.068Z]     amazon-ebs: ... displaying HTTP response code
[2021-11-26T03:22:19.068Z]     amazon-ebs: http_resp_code=200

delete component via api (response)

curl DELETE request successful...
[2021-11-26T03:33:31.947Z]     amazon-ebs:
[2021-11-26T03:33:31.947Z]     amazon-ebs: ... displaying HTTP response body (content from './response.txt'):

-- omitted --- 

[2021-11-26T03:33:31.947Z]     amazon-ebs: {"lastExecutionJobs":[{"name":"odsverify-cd-ods-qs-plain-master","url":"https://jenkins-odsverify-cd.ocp.odsbox.lan/job/odsverify-cd/job/odsverify-cd-ods-qs-plain-master/1"}]
[2021-11-26T03:33:31.947Z]     amazon-ebs: ... displaying HTTP response code
[2021-11-26T03:33:31.947Z]     amazon-ebs: http_resp_code=200
[2021-11-26T03:33:31.947Z]     amazon-ebs:
[2021-11-26T03:33:31.947Z]     amazon-ebs: provision project/component request (DELETE) completed successfully!

Notice both lastExecutionJobs are the same and come from the provisioning of the component