Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add re-populate/re-scan build feature #852

Closed
llxia opened this issue Mar 20, 2024 · 2 comments
Closed

Add re-populate/re-scan build feature #852

llxia opened this issue Mar 20, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@llxia
Copy link
Contributor

llxia commented Mar 20, 2024

Due to various reasons (i.e., invalid builds, network issues, and query before the build is fully created, etc), TRSS may not have access to the builds. Currently, we retry 3 times, then set the build status to Done. This is to prevent wasting resources to query invalid builds or expired builds. However, in the case of temporary network issues or query before the build is fully created, we may want to wait for a while and retry or repopulate/recan the build.

ToDo:

  • add 2 secs sleep between each retry
  • add AuditLogs when the error code is 404 (for debugging purposes)
  • create API to re-populate build if needed
  • add UI support

related: backlog/issues/1388

@smlambert smlambert added the enhancement New feature or request label Mar 20, 2024
@llxia llxia self-assigned this Mar 20, 2024
@llxia llxia changed the title Add re-populate build feature Add re-populate/re-scan build feature Mar 20, 2024
llxia added a commit to llxia/aqa-test-tools that referenced this issue Mar 20, 2024
- add 2 secs sleep between each retry
- add AuditLogs when the error code is 404 (for debugging purposes)
- create rescanBuild API to rescan

resovles: adoptium#852

Signed-off-by: Lan Xia <[email protected]>
JasonFengJ9 pushed a commit that referenced this issue Mar 21, 2024
- add 2 secs sleep between each retry
- add AuditLogs when the error code is 404 (for debugging purposes)
- create rescanBuild API to rescan

resovles: #852

Signed-off-by: Lan Xia <[email protected]>
llxia added a commit to llxia/aqa-test-tools that referenced this issue Mar 27, 2024
When querying a build, TRSS will retry 3 times.
In the case of an error, the build will move back to the queue if the return code from Jenkins API is not 404.
If the return code is 404, x-jenkins header is checked to ensure the error code is from Jenkins (not nginx).
In this case, it means the build has an invalid url or is expired. retry function returns 404 and TRSS will stop processing this build.
Otherwise, the error will be ignored (network issue) and the build will move back to the queue.
return code 404 only if the Jenkins server returns 404 for the build (i.e., invalid url, expired build, etc)

- sleep is removed to increase efficiency and reliability. We will check the header in the response to determine the invalid/expired build case.
- test API getJenkinsBuildInfo is added
- fix log issue

related: adoptium#852

Signed-off-by: Lan Xia <[email protected]>
@llxia
Copy link
Contributor Author

llxia commented Mar 27, 2024

  • We have noticed that sleep 2secs is not enough in some cases. It is hard to predict how long TRSS should wait for Jenkins server to come back when there is a network issue. To increase the efficiency and reliability of TRSS, we removed the sleep logic completely. The logic is updated to check the header in the response to determine the invalid/expired build case. See Update build retry logic #858
  • For security reasons, we may not want to add a button for rescanning builds on UI at this point.

@smlambert smlambert moved this to In Progress in 2024 2Q Adoptium Plan Mar 27, 2024
smlambert pushed a commit that referenced this issue Mar 27, 2024
When querying a build, TRSS will retry 3 times.
In the case of an error, the build will move back to the queue if the return code from Jenkins API is not 404.
If the return code is 404, x-jenkins header is checked to ensure the error code is from Jenkins (not nginx).
In this case, it means the build has an invalid url or is expired. retry function returns 404 and TRSS will stop processing this build.
Otherwise, the error will be ignored (network issue) and the build will move back to the queue.
return code 404 only if the Jenkins server returns 404 for the build (i.e., invalid url, expired build, etc)

- sleep is removed to increase efficiency and reliability. We will check the header in the response to determine the invalid/expired build case.
- test API getJenkinsBuildInfo is added
- fix log issue

related: #852

Signed-off-by: Lan Xia <[email protected]>
@llxia
Copy link
Contributor Author

llxia commented Apr 2, 2024

Changes are delivered. Close this issue.

@llxia llxia closed this as completed Apr 2, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 2024 2Q Adoptium Plan Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants