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

Omit unrecognized models from sources #1851

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

mtdowling
Copy link
Member

Description of changes:

Smithy-Build is often invoked from the Smithy CLI, and developers often provide directories that contain model files. If a directory contains files other than recognized Smithy models, those unknown files are treated as "sources" and ultimately wind up in the sources plugin manifest file. Files that are not Smithy model files should not show up in the manifest as this can cause invalid JARs to get created by tooling like the Smithy Gradle plugin.

Sources are now eagerly filtered when they are added to SmithyBuild. If someone, somehow, manually configures the sources plugin to use unrecognized Smithy model files, the plugin will skip those files and log a warning rather than create an invalid manifest.

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

Smithy-Build is often invoked from the Smithy CLI, and developers
often provide directories that contain model files. If a directory
contains files other than recognized Smithy models, those unknown
files are treated as "sources" and ultimately wind up in the sources
plugin manifest file. Files that are not Smithy model files should
not show up in the manifest as this can cause invalid JARs to get
created by tooling like the Smithy Gradle plugin.

Sources are now eagerly filtered when they are added to SmithyBuild.
If someone, somehow, manually configures the sources plugin to use
unrecognized Smithy model files, the plugin will skip those files
and log a warning rather than create an invalid manifest.
@mtdowling mtdowling requested a review from a team as a code owner July 11, 2023 21:05
@mtdowling mtdowling merged commit 5e864a1 into main Jul 12, 2023
milesziemer added a commit to milesziemer/smithy that referenced this pull request Jul 17, 2023
Fixes smithy-lang#1859

Modifies the changes in smithy-lang#1851,
specifically `SmithyBuild::addSources`, to not check subdirectories for
Smithy files. The previous behavior was to just add whatever path was
given to the method, *not* everything in subdirectories. However, the
change didn't recursively search subdirectores, so you could get build
errors due to missing shapes when running the sources plugin.

This change reverts the behavior of `SmithyBuild::addSource` to only
add whichever path it was given, but still checks to see if the path
is a valid Smithy model.
milesziemer added a commit that referenced this pull request Jul 18, 2023
Fixes #1859

Modifies the changes in #1851,
specifically `SmithyBuild::addSources`, to not check subdirectories for
Smithy files. The previous behavior was to just add whatever path was
given to the method, *not* everything in subdirectories. However, the
change didn't recursively search subdirectores, so you could get build
errors due to missing shapes when running the sources plugin.

This change reverts the behavior of `SmithyBuild::addSource` to only
add whichever path it was given, but still checks to see if the path
is a valid Smithy model.
syall pushed a commit to Xtansia/smithy that referenced this pull request Aug 11, 2023
Fixes smithy-lang#1859

Modifies the changes in smithy-lang#1851,
specifically `SmithyBuild::addSources`, to not check subdirectories for
Smithy files. The previous behavior was to just add whatever path was
given to the method, *not* everything in subdirectories. However, the
change didn't recursively search subdirectores, so you could get build
errors due to missing shapes when running the sources plugin.

This change reverts the behavior of `SmithyBuild::addSource` to only
add whichever path it was given, but still checks to see if the path
is a valid Smithy model.
@mtdowling mtdowling deleted the omit-unrecognized-models-from-sources branch September 11, 2023 18:21
alextwoods pushed a commit to alextwoods/smithy that referenced this pull request Sep 15, 2023
Fixes smithy-lang#1859

Modifies the changes in smithy-lang#1851,
specifically `SmithyBuild::addSources`, to not check subdirectories for
Smithy files. The previous behavior was to just add whatever path was
given to the method, *not* everything in subdirectories. However, the
change didn't recursively search subdirectores, so you could get build
errors due to missing shapes when running the sources plugin.

This change reverts the behavior of `SmithyBuild::addSource` to only
add whichever path it was given, but still checks to see if the path
is a valid Smithy model.
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.

2 participants