-
Notifications
You must be signed in to change notification settings - Fork 113
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 errors to enhance model import error logging #681
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Riya Garg <[email protected]>
Signed-off-by: Riya Garg <[email protected]>
Signed-off-by: Riya Garg <[email protected]>
3b69606
to
c30c5a9
Compare
files/sanitization.go
Outdated
@@ -32,9 +32,9 @@ var ValidIacExtensions = map[string]bool{ | |||
".tar": true, | |||
".tar.gz": true, | |||
".tar.tgz": true, | |||
".zip": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we removing zip files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that zip isn't working for both designs and models, this can confuse the user if we say zip is supported. I confirmed this on slack here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont remove the zip support here , we do support zips in places ( it is just that we dont support it for all type ) .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aabidsofi19 got it, added it back to common valid extensions and specifically removing it for model import error - Line 371
files/error.go
Outdated
|
||
remedy := []string{ | ||
"Make sure the archive is OCI compliant. Meshery Models should be OCI compliant archives.", | ||
"Try using a different extraction tool or library to rule out compatibility issues.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users are supposed to use a library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad, this error message was close to ErrFailedToExtractArchive, so I copied its error message here.
I have improved the error message now ✅
files/error.go
Outdated
} | ||
|
||
remedy := []string{ | ||
"Review the YAML syntax in the file and correct any errors.", | ||
"Use a YAML validator or linter to identify and fix issues.", | ||
"Ensure the file adheres to the YAML specification.", | ||
"Ensure the YAML conforms to the Meshery model schema. You can refer to the Meshery model schema documentation for more details.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide a hyperlink to schema or docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or to a troubleshooting guide on the subject.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provided a link to 'contributing to models' ✅
…ensions Signed-off-by: Riya Garg <[email protected]>
Co-authored-by: Lee Calcote <[email protected]> Signed-off-by: Riya Garg <[email protected]>
Description
This PR fixes Meshery #13574
Notes for Reviewers
Added new errors to
meshkit/files/errors.go
, that are useful for error logging while processing model artifacts. Currently, file errors defined here are specific todesign import
, we need to extend error messages to support better error logging inmodel import
.Signed commits