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

build: improve errors for --oci-dir cases #643

Conversation

mikemccracken
Copy link
Contributor

If the argument to oci-dir exists but is empty, we currently get a confusing error about it not being a layout. Other cases could be better explained while we're at it too.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hallyn
Copy link
Contributor

hallyn commented Sep 10, 2024

I'm not liking the PathExists() fn, but you didn't write it, so let's ignore that.

however:

Error: pkg/lib/dir_test.go:22:9: assignment mismatch: 1 variable but lib.IsSymlink returns 2 values (typecheck)

callers need to be updated.

@mikemccracken mikemccracken force-pushed the 2024.09.09/main/better-errors-oci-dir branch from dbbe10a to 7af1dfa Compare September 12, 2024 18:05
If the argument to oci-dir exists but is empty, we currently get a
confusing error about it not being a layout. Other cases could be better
explained while we're at it too.

Signed-off-by: Michael McCracken <[email protected]>
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 63.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 63.71%. Comparing base (dbfe650) to head (7af1dfa).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/stacker/build.go 38.46% 4 Missing and 4 partials ⚠️
pkg/lib/file.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #643      +/-   ##
==========================================
- Coverage   63.72%   63.71%   -0.02%     
==========================================
  Files          57       57              
  Lines        5015     5018       +3     
==========================================
+ Hits         3196     3197       +1     
+ Misses       1176     1175       -1     
- Partials      643      646       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@rchincha rchincha left a comment

Choose a reason for hiding this comment

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

lgtm

@rchincha rchincha merged commit 46064c7 into project-stacker:main Sep 17, 2024
10 of 11 checks passed
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: better error message when you pass --oci-dir a directory that exists but is not an OCI layout.
3 participants