Skip to content

[0.38] fix(marketplace): print collected marketplace config warnings (#4046) - #4062

Merged
Daniel Meppiel (danielmeppiel) merged 6 commits into
mainfrom
danielmeppiel-4046-mkt-config-warnings
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 6 commits into
mainfrom
danielmeppiel-4046-mkt-config-warnings

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

TL;DR — Warnings collected while parsing a marketplace authoring config were never printed. MarketplaceConfig.warnings holds the deprecated outputs: [...] list/string form and the outputs.<format>.path conflict, and no command read it. load_marketplace_config now delivers every collected warning through the warn_callback that apm pack, apm marketplace check and outdated already render, and each prints exactly once. Per the record, the list-form entry in the #4035 catalog no longer schedules a removal, so the printed text drops the stale "removed in v0.15".

Fixes #4046 — scope record: #4046 (comment)

Note

Rebased onto main after #4035 merged (head d74d0b46, main merged after #4590).

Problem (WHY)

  • marketplace/yml_schema.py _parse_outputs and the path-conflict check append to warnings_sink, which is stored as MarketplaceConfig.warnings. No caller read that field, so list-form users never saw the deprecation, while the docs said they would.
  • apm pack --check-versions / --check-clean reloads the config for the release gate without a callback, so its stdlib fallback printed the legacy marketplace.yml warning a second time on stderr.
  • The catalog text promised removal "in v0.15" on the 0.37 line.

Approach (WHAT)

Change Where
The owner reports the legacy deprecation, then each config.warnings entry, once per load through warn_callback (default unchanged: stdlib logger) marketplace/migration.py::load_marketplace_config
The release-gate reload discards its warnings, because the build load in the same command already reported them. The exception is --check-clean without --dry-run (non-JSON): that path skips producer rendering, so the reload reports them commands/pack.py gate
marketplace-outputs-list: printed warning (SIGNAL_WARNING), no scheduled removal, template without the v0.15 sentence core/deprecations.py

Rendering is unchanged. Pack shows the callback messages with its other marketplace warnings and in --json "warnings"; check and outdated print them via _load_config_or_exit. The list form parses exactly as before.

Trade-offs

  • The warn_callback=None default (stdlib logger) is kept rather than made required. About 70 test and library call sites rely on it. Every CLI caller now passes an explicit callback; the gate's discard is commented and covered by a test.
  • The gate discards instead of deduplicating. Pack always builds before the gate, so the warning is already reported (except on the implicit --check-clean path, where the reload is the reporter); a dedup policy is out of scope per the record.
  • SIGNAL_COLLECTED stays in the catalog vocabulary even though no entry uses it now. Removing it would touch [0.38] plan/apply P5b: one deprecation catalog (#4019) #4035's renderer and tests for no behavior change.

Validation

Local evidence (head efbed414, rebased on #4035 37690e72)
# Installed-CLI tests, fix vs base (src reverted to 37690e72, same editable binary)
$ pytest tests/integration/test_deprecation_warnings_installed_cli.py -k "outputs or legacy_marketplace_yml_warning_prints_once or pack_json or marketplace-yml"
FIX:  8 passed
BASE: 6 failed, 1 passed   # the pass on base is the map-form control

$ pytest tests/integration/test_deprecation_warnings_installed_cli.py tests/unit/test_deprecations_docs_table.py \
    tests/unit/core/test_deprecation_owner_behavior.py tests/unit/core/test_deprecations.py \
    tests/unit/scripts/test_registry_deprecation_catalog.py tests/unit/scripts/test_architecture_runner.py \
    tests/unit/marketplace tests/unit/commands
3257 passed; installed-CLI deprecations file 27/27
$ pytest tests/integration/test_architecture_owner_rule_mutations.py -k "covers_every or deprecation"
5 passed

$ ruff check / ruff format --check (src tests + architecture linter)  -> All checks passed! / 2509 files already formatted
$ pylint R0801                                                         -> 10.00/10
$ bash scripts/lint-auth-signals.sh                                    -> [+] auth-signal lint clean
$ bash scripts/lint-architecture-boundaries.sh                         -> exit 0
$ python scripts/render_deprecations_table.py                          -> table current

Scenario evidence (tests/integration/test_deprecation_warnings_installed_cli.py, installed CLI):

Scenario from the record Test Base
apm pack on outputs: [claude] shows the deprecation once, without v0.15 test_marketplace_outputs_list_warning_prints_once[pack] fails
Pack reloading the config (--check-versions) still shows it once …prints_once[pack-gate-reload] fails
apm marketplace check shows it once …prints_once[marketplace-check] fails
pack --json: warning in "warnings", stdout parses as JSON, nothing on stderr test_pack_json_carries_the_outputs_list_warning_without_corrupting_stdout fails
outputs.<format>.path conflict prints once test_marketplace_outputs_path_conflict_warning_prints_once fails
Legacy marketplace.yml prints once even when pack reloads test_legacy_marketplace_yml_warning_prints_once_when_pack_reloads fails (printed twice)
Control: map form prints no deprecation test_marketplace_outputs_map_form_prints_no_deprecation passes
Owner: collected warnings go through the callback, in order tests/unit/core/test_deprecation_owner_behavior.py::test_config_load_delivers_collected_warnings_through_the_callback —

How to test

  • In a project whose apm.yml has marketplace: {owner: {name: o}, packages: [], outputs: [claude]}, run apm pack. One [!] outputs: [claude] is deprecated; use the map form: block appears, with no v0.15.
  • apm pack --json | python -m json.tool parses, and .warnings contains the message.
  • Switch to outputs: {claude: {}} and confirm no deprecation appears.

Docs placement (#3996 layout)

The docs are in the last commit (efbed414). #3996 has landed, so they are written against its layout.

Edit Page now Page in #3996 layout
New sentence under the outputs: example: list form still works, warning shows the map form producer/publish-to-a-marketplace.mdx (step 3) done (the .md page was removed by #3996)
Says the warning prints, plus --json warnings reference/cli/pack.md done
Says the warning prints reference/manifest-schema.md done
Generated deprecations row: not scheduled / Warning reference/index.md (#4035 block) done; regenerated and --check clean

Rebase notes (onto #4035 after v0.37.0)

  • load_marketplace_config keeps main's manifest_file(project_root) and remediation-catalog "no config" text, plus this PR's single reporting loop.
  • The legacy marketplace.yml control now reads its expected text from [0.38] plan/apply P5b: one deprecation catalog (#4019) #4035's pinned marketplace-yml scenario, so wording changes there no longer break it.

Issue and approved scope

Issue: Fixes #4046

Human scope-approval comment: #4046 (comment)

Does this PR complete the issue, or what remains? Complete per the record.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass (except the environmental set that also fails on main; see Validation)
  • Added tests for new functionality (if applicable)

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md (Fixed).
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour. Authoring-config warnings are CLI output; no req-* covers them.

Co-authored-by: Copilot [email protected]

@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-4046-mkt-config-warnings branch from 658bc1a to e332f88 Compare November 20, 2026 07:52
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-4046-mkt-config-warnings branch from e332f88 to efbed41 Compare November 21, 2026 08:15
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-curly-fishstick branch 3 times, most recently from 1a0595e to c668fbd Compare November 21, 2026 09:18
Base automatically changed from danielmeppiel-curly-fishstick to main November 21, 2026 09:46
load_marketplace_config now delivers every MarketplaceConfig.warnings
entry (the list/string outputs deprecation and the outputs.<format>.path
conflict) through its warn_callback, after the legacy marketplace.yml
deprecation. apm pack, marketplace check and outdated already render that
callback. Pack's release-gate reload passes a discard callback so no load
warning prints twice. The marketplace-outputs-list catalog entry is now a
printed warning with no scheduled removal, so the text drops the stale
v0.15 date. Flips #4035's stays-unprinted pin into installed-CLI tests.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…cheduled (#4046)

Regenerate the deprecations table (not scheduled, Warning) and say where
the list-form warning appears in the publish guide, the pack reference
and the manifest schema.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-4046-mkt-config-warnings branch 2 times, most recently from 3d0c66f to f3d59c6 Compare November 21, 2026 10:34
@danielmeppiel
Daniel Meppiel (danielmeppiel) marked this pull request as ready for review November 21, 2026 10:44
Copilot AI balanced review requested due to automatic review settings November 21, 2026 10:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The implicit dry-run path for non-JSON apm pack --check-clean suppresses configuration and legacy marketplace warnings, requiring warning reporting and an installed-CLI regression case for that invocation.

1 open issue
What changed in this PR

This PR addresses #4046 by routing collected marketplace configuration warnings through the existing CLI reporting callbacks, building on the centralized deprecation catalog from #4035.

Changes:

  • Reports collected configuration warnings and suppresses duplicate warnings during pack release-gate reloads.
  • Removes the obsolete v0.15 removal deadline for list-form marketplace outputs.
  • Adds warning-delivery regression tests and updates user documentation.
File Description
tests/​unit/​core/​test_deprecation_owner_behavior.py Tests callback delivery and updated warning text.
tests/​integration/​test_deprecation_warnings_installed_cli.py Checks warning visibility, repetition, and JSON output.
src/​apm_cli/​marketplace/​migration.py Delivers collected warnings through the loader callback.
src/​apm_cli/​core/​deprecations.py Updates warning visibility and removes the stale removal deadline.
src/​apm_cli/​commands/​pack.py Suppresses warnings during the release-gate reload.
docs/​src/​content/​docs/​reference/​manifest-schema.md Documents visible list-form warnings.
docs/​src/​content/​docs/​reference/​index.md Updates the generated deprecation table.
docs/​src/​content/​docs/​reference/​cli/​pack.md Describes warning delivery and JSON inclusion.
docs/​src/​content/​docs/​producer/​publish-to-a-marketplace.mdx Explains warnings for legacy list-form outputs.
CHANGELOG.md Records the warning-visibility fix.

Review effort: Balanced

Comment thread src/apm_cli/commands/pack.py Resolved
An implicit --check-clean dry run (no --dry-run, non-JSON) skips every
producer in the render loop, so the build's collected marketplace config
warnings never printed and the gate reload discarded them too. The gate
reload now reports them on that path only; every other path keeps the
discard, so each warning prints exactly once.

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit c2ab3ce into main Nov 21, 2026
67 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-4046-mkt-config-warnings branch November 21, 2026 16:49
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.

marketplace.outputs list/string form deprecation warning is never printed

2 participants