Fix command plugin when run on targets with dependencies #801
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The command plugin is used for ahead-of-time (AOT) code generation. It can be run with
--target
, or without, in which case it considers all targets based on the presence of the requisite OpenAPI document and config file.If a target is detected that doesn't have either of these files, it should be considered an error if that target was explicitly asked for using
--target
. If it wasn't—either because we're looking at all targets, or because it is a dependency—it should be skipped.Modifications
Result
Fixes command plugin when used for AOT generation with targets with target dependencies.
Test Plan
This PR starts out with a commit that updated the integration test to repro the issue, which we should see fail in CI. Only then was a commit added to address the issue, restoring the CI to green.