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

feat: Added retry option and max_retries #50

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

SaptarshiSarkar12
Copy link

Fixes

Fixes #49

Changes Proposed

  • Added retry_on_timeout boolean to toggle retry feature
  • Added max_retries to take the maximum number of retry as input

@SaptarshiSarkar12
Copy link
Author

@ashnamehrotra @sozercan Please review this PR

@ashnamehrotra
Copy link
Contributor

@SaptarshiSarkar12 thank you for the PR! I think we can simplify this to one argument. If there are a # of retries specified, we can retry otherwise we don't use retry logic? Would you also be able to modify the test to use these arguments to confirm it works as expected? https://github.com/project-copacetic/copa-action/blob/main/.github/workflows/build.yaml#L83

@SaptarshiSarkar12
Copy link
Author

SaptarshiSarkar12 commented Oct 5, 2024

I think we can simplify this to one argument. If there are a # of retries specified, we can retry otherwise we don't use retry logic?

Yes, correct 👍.

Would you also be able to modify the test to use these arguments to confirm it works as expected? https://github.com/project-copacetic/copa-action/blob/main/.github/workflows/build.yaml#L83

@ashnamehrotra Okay. I will 😀. I am out of station now. So, I would make the changes once I return back home (probably 14th of October). Is it fine?

… would handle it from now onwards

Signed-off-by: Saptarshi Sarkar <[email protected]>
@SaptarshiSarkar12
Copy link
Author

@ashnamehrotra Hi Ashna 👋!
I have made the requested changes. Please review it.

Nowadays, I am encountering an issue with copa for the below situation.
Suppose all the vulnerabilities are already patched for oracle image. But Trivy reports false positives, so, the GH Action runs copa patch but it fails with the error Error: no patchable packages found.
A probable solution can be adding a boolean actions input called fail_if_no_vulns which will not exit with status code 1 if it fails for that reason. So, would I create a new issue for that?
Reference workflow run: https://github.com/SaptarshiSarkar12/Drifty/actions/runs/10968623586/job/30460218219#step:6:2111

@SaptarshiSarkar12
Copy link
Author

TOOMANYREQUESTS: retry-after: 569.492µs, allowed: 44000/minute

@ashnamehrotra From the failed build log, it seems that there have been too many requests error. Unfortunately, it is a bug reported in aquasecurity/trivy-action#389 and https://github.com/orgs/community/discussions/139074#discussioncomment-10808081 where they suggest using AWS image.
What to do from our side to fix this build? A retry might work 🤞.

@ashnamehrotra
Copy link
Contributor

@ashnamehrotra Hi Ashna 👋! I have made the requested changes. Please review it.

Nowadays, I am encountering an issue with copa for the below situation. Suppose all the vulnerabilities are already patched for oracle image. But Trivy reports false positives, so, the GH Action runs copa patch but it fails with the error Error: no patchable packages found. A probable solution can be adding a boolean actions input called fail_if_no_vulns which will not exit with status code 1 if it fails for that reason. So, would I create a new issue for that? Reference workflow run: https://github.com/SaptarshiSarkar12/Drifty/actions/runs/10968623586/job/30460218219#step:6:2111

Hi @SaptarshiSarkar12 this is something we will fix soon in project-copacetic/copacetic#802. This way we will be able to ignore the error of no upgradable packages with the --ignore-errors flag

entrypoint.sh Outdated Show resolved Hide resolved
entrypoint.sh Outdated Show resolved Hide resolved
@SaptarshiSarkar12
Copy link
Author

Hi @SaptarshiSarkar12 this is something we will fix soon in project-copacetic/copacetic#802. This way we will be able to ignore the error of no upgradable packages with the --ignore-errors flag

@ashnamehrotra Hi Ashna 👋!
That sounds great 👍. Would really appreciate such improvement.
But would that cause any issue with my current setup for patching oraclelinux - I'm currently patching the whole image with no Trivy reports passed to copa?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add support for retrying copa patch on failure/timeout
2 participants