-
Notifications
You must be signed in to change notification settings - Fork 218
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
Validation discrepancy between classpath model and imported model #1387
Comments
Worth mentioning too that the |
I wasn't able to reproduce this by moving a model between an explicit import vs placing it in the You mentioned the One other consideration that may or may not be relevant here: when generating a JAR from a Gradle project, the Smithy Gradle plugin will validate that the inputs it's given are correct as a first pass at validation. It also then does another pass at validating using only the generated JAR and your implementation/api dependencies to ensure that the generated JAR is valid and doesn't, say, refer to unknown shapes.
We removed the IDL 1.0 warning since it was so noisy, so that might explain this. |
Sorry, |
Ah ok, good to know. When trying to reproduce this with Smithy (1.26.4) and the Gradle plugin (0.6.0 or HEAD), I see the DANGER event when your example model is an
When loaded via smithy-build.json/imports, I get:
Which still fails the build for me. Here's my setup:
Are there other settings you're passing to the plugin? |
I looked through our I don't have time right this moment, but I can try to repro it again in smithy-rs with its upgraded Smithy version. We could also see if things have changed by trying out the above with an August release of Smithy. |
I'm not able to repro this anymore in smithy-rs with Smithy 1.26.2. |
Ok thanks for checking. One thing that I did see when trying to repro this is that the output was weird and interleaving text across threads (due to the use of PrintStream instead of PrintWriter). This PR will fix that #1525. I’ll go ahead and resolve this, but let me know if you ever see it again. |
When using the
smithy-gradle-plugin
to build/validate a model, if that model is pulled in via the classpath by existing in amodel/
directory, then the validation errors for that model are different than if that model is explicitly imported via thesmithy-build.json
file.Here's an example minimal model that should produce a
DANGER
error (it doesn't like teapots, unless something changes due to #1386):This model, if pulled in by existing in the
models/
directory, emits aWARN
due to the IDL version being 1, but does not emit theDANGER
message. If instead, it is placed outside themodels/
directory and referenced directly from theimports
section ofsmithy-build.json
, then theDANGER
message is emitted and the build fails.The text was updated successfully, but these errors were encountered: