Repository navigation
Keep empty static analysis blocks consistent after apply - #126
Merged
ryanduffin merged 5 commits intoOct 6, 2026
Merged
ryanduffin merged 5 commits into
ryanduffin merged 5 commits into
Conversation
ryanduffin
added this pull request to stack #128
October 6, 2026 15:30
The provider omits an empty static_analysis block, mend block, or Mend ID list from the descriptor it writes, so the API reads them back as absent. Terraform requires the state after apply to match a configured value, so these configurations failed with "Provider produced inconsistent result after apply". Create, Update, and Read now keep the planned or prior static_analysis value where it and the API value are both empty. A Mend ID list that the API leaves out now reads as null, not as an empty list. A mend block with only one ID list also crashed the provider on read, because the parser expected both lists. The parser now treats a missing list as empty. The new unit tests run the resource against an in-memory fake of the catalog entity routes, without a Cortex tenant. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryanduffin
force-pushed
the
rduffin/static-analysis-empty-block
branch
from
October 6, 2026 18:46
4057c7f to
4cb6fa0
Compare
The Mend read model returned an object even when the descriptor had no
Mend IDs, so any static_analysis block without mend failed the apply
with an inconsistent result. keepEmptyObject hid this on Create,
Update, and Read, but an import still wrote mend = {}. Mend now reads
as null when it has no IDs, as the other integrations already do, and
the Veracode lists read as null when they are absent.
The parser no longer crashes on numeric or null Mend IDs, which the API
accepts, or on a Veracode block without applicationNames.
New tests cover a static_analysis block with one integration and an
import, an update from Mend IDs to an empty block and back, and a
remote change under a configured empty block. Comments now say that
the provider, not the API, omits the empty values.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Veracode application names now go through the same conversion as Mend IDs, so a null or numeric name no longer crashes the provider. Other scalar IDs, such as floats or values above the int64 range, read as strings instead of being dropped. ImportStateVerify treats an empty list as absent, so a new test seeds the fake, imports, and requires an empty plan. It catches an empty list read into state where the configuration has none. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Moving Veracode application names to stringValues dropped empty names, which the provider writes and the API stores, so a configuration with an empty name failed the apply. Only Mend drops empty IDs now, as it did before. stringValues also skips nested lists and maps instead of converting them to strings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryanduffin
marked this pull request as ready for review
October 6, 2026 20:24
gvillenave
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Several
static_analysisconfigurations oncortex_catalog_entityno longer fail with "Provider produced inconsistent result after apply", and reading static analysis data no longer crashes the provider.Claude Details