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

chore: update executor back to default of not bubbling errors to main flow #3410

Merged
merged 7 commits into from
Nov 4, 2024

Conversation

spiffcs
Copy link
Contributor

@spiffcs spiffcs commented Nov 1, 2024

Description

The latest releases of syft saw a change where err was returned by the executor causing the main control flow to exit on task failure. This PR reverts this change and instead writes the errors to a multi err value which sets prog warnings in the TUI

  • Fixes: NO BUG FILED

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

Behavior on latest release:

 ✔ Loaded image                                                                                                                                                                                                                        
 ✔ Parsed image                                                                                                                                                                                 
 ⠧ Cataloging contents             ━━━━━━━━━━━━━━━━━━━━                                                                                                                                                
   └── ⠧ Packages                        [302 packages]
failed to run tasks: 1 error occurred:
        * failed to run task: java-binary-openjdk: failed to resolve files by glob (**/java): unable to search by glob="**/java": unable to get ref for path="/etc/alternatives/java": cycle during symlink resolution
java-binary-ibm: failed to resolve files by glob (**/java): unable to search by glob="**/java": unable to get ref for path="/etc/alternatives/java": cycle during symlink resolution
java-binary-oracle: failed to resolve files by glob (**/java): unable to search by glob="**/java": unable to get ref for path="/etc/alternatives/java": cycle during symlink resolution
java-binary-graalvm: failed to resolve files by glob (**/java): unable to search by glob="**/java": unable to get ref for path="/etc/alternatives/java": cycle during symlink resolution

Behavior on this PR showing warnings in cataloged contents, but still produces an SBOM

 ✔ Loaded image                                                                                                                                                                                                                        
 ✔ Parsed image                                                                                                                                                                                 
 ✘ Cataloged contents                                                                                                                                                                                  
   ├── ✔ Packages                        [296 packages]
   ├── ✔ File digests                    [3,829 files]
   ├── ✔ File metadata                   [3,829 locations]
   └── ✔ Executables                     [998 executables]
NAME                                VERSION                            TYPE
adduser                             3.118ubuntu2                       deb
...

…tead set them as multierr prog

Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
@spiffcs
Copy link
Contributor Author

spiffcs commented Nov 1, 2024

I think we want to keep the executor behavior and instead change the task behavior that is responsible for surfacing these errors that should not be causing syft to exit. Let me go a bit deeper in the calls so we don't undo all executor err reporting and find the specific change made in #2998

This PR reverts the changes found here under package_task_factory
https://github.com/anchore/syft/pull/2998/files

@wagoodman wagoodman added the bug Something isn't working label Nov 1, 2024
wagoodman

This comment was marked as resolved.

Signed-off-by: Keith Zantow <[email protected]>
@kzantow kzantow enabled auto-merge (squash) November 4, 2024 20:18
@kzantow kzantow merged commit 8a41d77 into main Nov 4, 2024
12 checks passed
@kzantow kzantow deleted the fix-task-control-flow branch November 4, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants