Skip to content

fix(registry): render transport error text in printable ASCII - #4369

Merged
Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
fix-registry-transport-ascii
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
fix-registry-transport-ascii

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

On macOS, apm install against a registry whose certificate the OS trust store rejects echoes the platform error text, which contains curly quotes (\u201clocalhost\u201d certificate is not trusted). The command correctly refuses with exit 1; only the output breaks the printable-ASCII rule (I6). The lifecycle output oracle now catches this on test_tls_install_custom_ca.py::test_apm_install_trusts_private_ca_and_retains_default_root[os-trust] (main CI, macOS).

The registry client now renders the transport exception through the existing utils/diagnostics.printable_ascii_text helper. Trust decisions are unchanged.

Issue and approved scope

Issue: Refs #4092

Human scope-approval comment: release-gate fix requested by the 0.37 release PM for a red main check.

Does this PR complete the issue, or what remains? It fixes this red check only.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

pytest tests/unit/registry/test_client.py: 41 passed, including a new case where the transport error from the OS carries curly quotes and the RegistryError message is ASCII. ruff check / ruff format --check (0.15.12) and architecture boundaries: clean. The macOS TLS integration test runs in CI.

Changelog

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

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

The macOS trust store reports an untrusted certificate with curly quotes;
the registry transport error echoed that text verbatim.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 15:12
Co-authored-by: Copilot App <[email protected]>

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.

🟢 Approval recommended

There are no active review issues for the transport-error text sanitization change.

No open issues 🎉

What changed in this PR

This PR fixes non-ASCII operating-system text in registry transport errors, including macOS TLS certificate failures, without changing trust decisions or failure behavior.

Changes:

  • Uses the existing printable_ascii_text helper to sanitize transport exception text.
  • Adds a regression test for certificate errors containing curly quotes.
  • Documents the user-visible fix in the changelog.
File Description
tests/​unit/​registry/​test_client.py Adds regression coverage for ASCII rendering of TLS errors.
src/​apm_cli/​deps/​registry/​client.py Sanitizes transport exception text before wrapping it in RegistryError.
CHANGELOG.md Records the printable-ASCII error-output fix.

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit fc4ede0 into main Nov 21, 2026
42 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the fix-registry-transport-ascii branch November 21, 2026 05:24
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