Skip to content

Conversation

@dcookspi
Copy link
Collaborator

@dcookspi dcookspi commented Oct 8, 2025

This fixes a bug that causes spk build commands to appear to fail when gather disk usage encounters an error during the "Completed builds: ..." output at the end of the spk build. The builds haven't failed, but the command errors out. The fix is to catch the disk uage error and use zero size for that build (or version).

The situation can happen when using spk pip conver ... on a python module. The generated (placeholder) source build for the python module contains no files in its component layers, and thus nothing to measure for disk usage, which generates a disk usage error.

…so have no size

Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
@dcookspi dcookspi self-assigned this Oct 8, 2025
@dcookspi dcookspi requested review from jrray and rydrman October 8, 2025 22:12
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@rydrman rydrman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually did run into this with some of my source builds as well, thanks for the fix

/// components) in the given repo(s).
///
/// Note: builds with no files (at all) will return a
/// DiskUsageBuildNotFound error because at least on file is needed to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// DiskUsageBuildNotFound error because at least on file is needed to
/// DiskUsageBuildNotFound error because at least one file is needed to

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though IMO it should return a success of 0 rather than "build not found" in this case. I don't consider this situation an error, and the error name doesn't fit the situation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is not intuitive returning "build not found" when it clearly is present, it just has no files on disk to get disk usage sizes from.

/// Note: builds with no files (at all) will return a
/// DiskUsageBuildNotFound error because at least on file is needed to
/// calculate a walked disk usage entry. For example, commands like
/// 'spk pip convert ...' can generate /src builds for python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 'spk pip convert ...' can generate /src builds for python
/// 'spk convert pip ...' can generate /src builds for python

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this and the one above.

Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
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.

4 participants