fix(audit): scope asset publish details audit to the exported stack - #326
Open
naman-contentstack wants to merge 2 commits into
Open
fix(audit): scope asset publish details audit to the exported stack#326naman-contentstack wants to merge 2 commits into
naman-contentstack wants to merge 2 commits into
Conversation
An Asset Management asset is shared across stacks and carries publish details for every stack it was published into, each tagged with that stack's api_key. The assets audit validated all of them against this export's locales and environments, so publish details belonging to other stacks were reported as missing environments/locales, stripped in fix mode, and triggered the fix confirmation prompt during import. The audit now resolves the exported stack's api key from stack/stack.json and validates only publish details for that stack, plus legacy ones without an api_key. Entries that cannot be attributed are left untouched and warned about once. Warning messages now name whether the locale, the environment, or both are missing, and fix mode writes a chunk only when it actually changed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Surface the cross-stack skip count at info level: it is the one number that tells an operator the scoping engaged, and at debug it never appears in a normal run. Add the cases the fix was missing: - an export whose assets are published only into other stacks reports nothing and prompts for nothing, which is the empty assets result cm:stacks:import reads as "no fix needed" — the actual ticket symptom, previously only asserted by proxy. - an AM export with no stack/stack.json exercises the unresolved-api-key path for real instead of poking the private field, and asserts fix mode leaves tagged publish details on disk rather than stripping them. All four fail when the api_key scoping is disabled. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem
An Asset Management asset lives in a space and can be published into multiple stacks, so its exported
publish_detailscarry one entry per target stack, each tagged with that stack'sapi_key. The assets audit validated every entry against the exported stack's locales and environments, so entries belonging to other stacks were reported as missing locale/environment, stripped in fix mode, and raised the "proceed with implementing the fix" confirmation that blocks unattendedcm:stacks:import.Fix
stack/stack.jsonand validate only publish details for that stack, plus legacy entries that carry noapi_key. Entries owned by other stacks are left untouched and never reported. This matches the scoping the import publish step already applies.api_keyare left unchanged instead of being stripped, with a single warning naming the missing file.🤖 Generated with Claude Code