Repository navigation
fix: match TLS failure hint to the selected trust mode - #2602
Daniel Meppiel (danielmeppiel) merged 7 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new “TLS trust” informational check to apm marketplace doctor and stabilizes test isolation around process-global truststore injection.
Changes:
- Introduced
describe_tls_trust()to generate user-facing TLS trust-source and precedence text. - Added a new “TLS trust” informational doctor check and a corresponding unit test assertion.
- Added an autouse pytest fixture to reset truststore/SSL-related global state between tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/unit/commands/test_marketplace_doctor.py | Adds a unit test ensuring the doctor output includes the TLS trust section/source. |
| tests/conftest.py | Adds an autouse fixture to reset truststore injection and clear TLS trust configuration cache between tests. |
| src/apm_cli/core/tls_trust.py | Adds describe_tls_trust() to report TLS trust source and precedence. |
| src/apm_cli/commands/marketplace/doctor.py | Adds a new informational “TLS trust” check to doctor output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (5)
src/apm_cli/commands/marketplace/doctor.py:198
- This introduces a second "Check 4" header; it makes the check numbering confusing when scanning the function. Consider removing the numeric label here (or renumbering all subsequent checks).
# Check 4: TLS trust source (informational)
src/apm_cli/commands/marketplace/doctor.py:205
- TLS trust diagnostic detail can include non-ASCII text (explicit CA bundle paths, truststore error messages). That can trigger UnicodeEncodeError on Windows terminals and violates the repo's printable-ASCII output constraint. Sanitize the rendered strings before adding them to the doctor table (including the exception path).
try:
from ...core.tls_trust import describe_tls_trust
tls_source, tls_precedence = describe_tls_trust()
tls_detail = f"{tls_source}; precedence: {tls_precedence}"
tests/conftest.py:149
- The new autouse SSL isolation fixture calls truststore.extract_from_ssl(), but it does not snapshot/restore ssl.SSLContext itself. Some tests (e.g. TLS integration suites) directly assign ssl.SSLContext, and without restoring it here a future test could leak a patched SSLContext into subsequent tests.
@pytest.fixture(autouse=True)
def _isolate_ssl_state():
"""Restore process-global truststore injection between tests."""
import contextlib
src/apm_cli/core/tls_trust.py:115
- describe_tls_trust() is documented as "user-facing", but it can embed non-ASCII bytes from REQUESTS_CA_BUNDLE/CURL_CA_BUNDLE values or from exception messages recorded in _LAST_TLS_STATUS. If callers print this directly (as apm doctor does), it can violate the repo's printable-ASCII output constraint on Windows.
def describe_tls_trust(env: Mapping[str, str] | None = None) -> tuple[str, str]:
"""Return a user-facing trust source and precedence description."""
if _env_flag(_DISABLE_ENV_VAR, env):
source = f"bundled CA (certifi); {_DISABLE_ENV_VAR}=1 disables OS trust-store injection"
elif has_explicit_ca_override(env):
tests/conftest.py:129
- The linked issue acceptance criteria calls out removing the per-suite SSL/truststore isolation guards once a shared autouse fixture exists, but those guards still remain (e.g. tests/integration/test_tls_custom_ca.py:_isolate_trust and tests/integration/test_tls_frozen_hook.py:_isolate_trust). This PR adds the shared fixture but does not remove the redundant per-suite ones.
@pytest.fixture(autouse=True)
def _isolate_ssl_state():
"""Restore process-global truststore injection between tests."""
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 1 | 1 | Solid placement of describe_tls_trust in the canonical TLS module. The module-global _LAST_TLS_STATUS read is acceptable for an informational diagnostic but has a stale-read edge case worth documenting. No blocking issues. |
| CLI Logging Expert | 0 | 1 | 2 | The TLS doctor check is well-structured but the precedence chain is too verbose for a table cell -- it belongs behind --verbose. The rest is clean. |
| DevX UX Expert | 0 | 2 | 2 | The TLS trust row is a good diagnostic addition but the inline precedence string is too dense for a table cell, the 'not selected yet' message is confusing, and the error fallback lacks actionable guidance. |
| Supply Chain Security Expert | 0 | 2 | 2 | No security bypasses or credential leakage. Minor concerns around path disclosure and misleading pass status, but nothing blocking. |
| OSS Growth Hacker | 0 | 0 | 2 | Strong adoption move. TLS diagnostics in apm doctor is exactly the kind of self-service debugging that unblocks enterprise users behind corporate proxies -- the #1 silent churn vector for CLI tools in regulated environments. |
| Doc Writer | 0 | 2 | 1 | The PR adds a new TLS trust row to apm doctor output. The CHANGELOG [Unreleased] section has no entry. The docs reference page Checks table does not list TLS trust. Two targeted updates needed. |
| Test Coverage Expert | 0 | 2 | 1 | New describe_tls_trust() has zero direct tests covering its 4 branches; doctor error path untested; autouse fixture leaks _LAST_TLS_STATUS across tests. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 5 follow-ups
- [Test Coverage Expert] Add parametrized unit tests for describe_tls_trust's 4 branches -- Missing regression trap on a user-promise surface (devx principle). No automated guardrail currently proves the precedence logic is correct.
- [Test Coverage Expert] Add test for doctor TLS error-degradation path -- The except block that renders 'Unable to determine' has zero coverage -- if it regresses, doctor crashes instead of degrading gracefully.
- [CLI Logging Expert] Move precedence chain behind --verbose; show only active source in default table -- Three panelists independently flagged the 120+ char detail string as too dense for 80-col terminals. Progressive disclosure is APM's output contract.
- [Python Architect] Eagerly call configure_process_tls_trust() inside describe_tls_trust to eliminate stale-read / 'not selected yet' UX -- Eliminates confusing cold-state message and satisfies devx-ux's reword request in one line.
- [Doc Writer] Add CHANGELOG entry and update doctor.md Checks table with TLS trust row -- User-visible behavior change with no changelog or docs update -- violates 'ship fast, communicate clearly' principle.
Architecture
classDiagram
direction LR
class tls_trust {
<<Module>>
+configure_process_tls_trust() None
+describe_tls_trust(env) tuple
+has_explicit_ca_override(env) bool
-_LAST_TLS_STATUS tuple|None
-_env_flag(name, env) bool
-_explicit_ca_path(env) str
}
class doctor {
<<Module>>
+run_doctor() list~DoctorCheck~
}
class _DoctorCheck {
<<Dataclass>>
+name str
+passed bool
+detail str
+informational bool
}
doctor ..> tls_trust : imports describe_tls_trust
doctor *-- _DoctorCheck : builds
class tls_trust:::touched
class doctor:::touched
classDef touched fill:#fff3b0,stroke:#d47600
flowchart TD
A["apm doctor command"] --> B{"configure_process_tls_trust\ncalled earlier?"}
B -->|Yes| C["_LAST_TLS_STATUS populated"]
B -->|No| D["_LAST_TLS_STATUS is None"]
C --> E["describe_tls_trust()\nreads _LAST_TLS_STATUS"]
D --> F["describe_tls_trust()\nreturns fallback string"]
E --> G["Renders TLS source + precedence"]
F --> G
G --> H["_DoctorCheck\ninformational=True"]
H --> I["Print doctor table"]
Recommendation
Ship now with the understanding that the test-coverage and --verbose follow-ups land before the next release cut. The core diagnostic is correct, non-blocking, and immediately valuable to the enterprise adoption surface. The missing tests are not blocking because the feature is informational-only (passed=True, informational=True) -- a regression here cannot break installs or corrupt state. Recommend the author addresses the top 3 follow-ups in a stacked PR or amends this one before merge.
Full per-persona findings
Python Architect
- [recommended] Stale-read of _LAST_TLS_STATUS produces misleading 'not selected yet' message if doctor runs before configure_process_tls_trust fires at
src/apm_cli/core/tls_trust.py
If apm doctor runs in a fresh process where configure_process_tls_trust() has not been called, _LAST_TLS_STATUS is None and the user sees 'not selected yet; OS trust store preferred with certifi fallback'. The actual trust source has not been determined yet. describe_tls_trust should eagerly call configure_process_tls_trust() (cached, so idempotent) to ensure the global is populated before reading it.
Suggested: At the top of describe_tls_trust, call configure_process_tls_trust() to ensure _LAST_TLS_STATUS is populated. - [nit] Stale Check 4 comment numbering after insertion -- two checks labeled Check 4 at
src/apm_cli/commands/marketplace/doctor.py
Purely cosmetic but makes grep-by-number unreliable.
CLI Logging Expert
- [recommended] Precedence chain concatenated into detail string is too verbose for default table output -- wraps badly at 80-col terminals at
src/apm_cli/commands/marketplace/doctor.py
The combined tls_detail string can exceed 120 chars (source + '; precedence: APM_DISABLE_TRUSTSTORE > REQUESTS_CA_BUNDLE/CURL_CA_BUNDLE > APM_EXTRA_CA_BUNDLE (when supported) > OS trust store > certifi fallback'). In a table cell at 80-col terminal this wraps badly and buries the actionable source info. Show only tls_source in default mode; emit the full precedence chain only under --verbose. This follows APM's progressive-disclosure contract. - [nit] Precedence string uses '(when supported)' hedging language -- specify or drop at
src/apm_cli/core/tls_trust.py
Either state the condition precisely or omit the qualifier for cleaner output. - [nit] Error fallback truncation at 60 chars arbitrary -- may cut mid-word at
src/apm_cli/commands/marketplace/doctor.py
The [:60] slice could cut mid-word or mid-path. Consider truncating to last space or using a utility that appends '...' when truncated.
DevX UX Expert
- [recommended] Inline precedence chain is reference documentation, not diagnostic output -- belongs behind --verbose at
src/apm_cli/commands/marketplace/doctor.py
Show only the active source in the default view; move the precedence explanation behind --verbose or a apm doctor --explain flag. Compare: pip config debug prints the active config file, not the full resolution order inline. - [recommended] 'not selected yet' message reads as broken state to users who haven't run network commands at
src/apm_cli/core/tls_trust.py
Reword to 'OS trust store (default)' or similar positive statement -- the user doesn't need to know about lazy initialization. - [nit] Error fallback lacks actionable guidance for next steps at
src/apm_cli/commands/marketplace/doctor.py
Append a hint: 'run with --verbose or check REQUESTS_CA_BUNDLE'. Every doctor error should be one copy-paste away from recovery. - [nit] Consider surfacing REQUESTS_CA_BUNDLE hint for corporate-proxy users when no custom bundle detected at
src/apm_cli/core/tls_trust.py
Surface 'set REQUESTS_CA_BUNDLE to your corporate CA path' when no custom bundle detected and OS trust store in use -- the primary audience for this check.
Supply Chain Security Expert
- [recommended] str(exc)[:60] in error fallback may leak filesystem paths from unexpected exceptions at
src/apm_cli/commands/marketplace/doctor.py
Consider sanitizing to just the exception type name when the message contains path separators or known sensitive patterns.
Suggested: Use type(exc).name as the safe fallback, or filter the message through a path-redaction helper before truncating. - [recommended] _LAST_TLS_STATUS is module-global mutable state read without synchronization -- may be stale at
src/apm_cli/core/tls_trust.py
In long-lived processes or concurrent test runs it could reflect a stale or different trust configuration than what is currently active, making the doctor output misleading rather than informative. Document that this is a snapshot.
Suggested: Document clearly that this is a snapshot, or query ssl.SSLContext default_verify_paths() at call time. - [nit] CA bundle path exposed in diagnostic output -- low-risk but reveals filesystem layout in CI logs at
src/apm_cli/core/tls_trust.py
Exposing the full CA bundle path via _explicit_ca_path(env) is low-risk (diagnostic tool user runs locally) but in CI logs it reveals internal filesystem layout. - [nit] passed=True unconditionally may green-light a potentially insecure config (certifi fallback in corp env) at
src/apm_cli/commands/marketplace/doctor.py
Consider making it informational=True with passed=None or a tri-state so it does not green-light a potentially insecure config.
OSS Growth Hacker
- [nit] Consider linking to a docs troubleshooting anchor in the CHANGELOG entry so the surface compounds at
src/apm_cli/commands/marketplace/doctor.py
The detail string showing env-var precedence is excellent -- users paste this into Slack. Link to docs anchor to make it compound. - [nit] CHANGELOG opportunity: frame as 'apm doctor now tells you why TLS fails in corporate networks'
That framing is a repostable one-liner for enterprise DevRel channels and HN threads about proxy pain.
Auth Expert -- inactive
PR only adds a read-only TLS diagnostic reporter; no auth.py, token_manager.py, AuthResolver, or HTTP auth surfaces touched.
Doc Writer
- [recommended] Missing CHANGELOG entry for new TLS trust row in apm doctor at
CHANGELOG.md
The [Unreleased] section has no entry for this behavior change. The PR closes Addapm doctor tlstrust-source diagnostic + test-suite ssl-isolation fixture #2035 and adds a new informational TLS trust row -- this is user-visible and belongs in the changelog.
Suggested: Add under ### Fixed:apm doctornow reports the active TLS trust source as an informational row. (closes Addapm doctor tlstrust-source diagnostic + test-suite ssl-isolation fixture #2035) - [recommended] docs/src/content/docs/reference/cli/doctor.md Checks table missing TLS trust row at
docs/src/content/docs/reference/cli/doctor.md
The reference page lists every apm doctor check row but omits TLS trust. Users running apm doctor will see the row and find no explanation in the docs. - [nit] packages/apm-guide commands.md does not mention TLS trust in apm doctor description at
packages/apm-guide/.apm/skills/apm-usage/commands.md
Secondary agent-usage reference omits the new check. Lower priority.
Test Coverage Expert
- [recommended] No unit tests for describe_tls_trust() branch logic -- 4 branches uncovered at
src/apm_cli/core/tls_trust.py
describe_tls_trust has 4 distinct branches (disable env, explicit CA, cached status, cold state). grep of tests/ shows only one hit: a mock in the doctor test that never exercises the real function. No tests in tests/unit/core/test_tls_trust.py cover it.
Suggested: Add parametrized unit tests in tests/unit/core/test_tls_trust.py exercising each branch.
Proof (missing):tests/unit/core/test_tls_trust.py::test_describe_tls_trust_branches-- proves: describe_tls_trust returns correct source string for each precedence branch [devx]
assert source == 'bundled CA (certifi); APM_DISABLE_TRUSTSTORE=1 disables OS trust-store injection' - [recommended] Doctor TLS error path (except Exception block) has no test at
tests/unit/commands/test_marketplace_doctor.py
The only doctor TLS test patches describe_tls_trust to return a tuple (happy path). No test verifies the error rendering or that the check degrades gracefully.
Suggested: Add a test that patches describe_tls_trust to raise RuntimeError and asserts exit_code == 0 and 'Unable to determine' in output.
Proof (missing):tests/unit/commands/test_marketplace_doctor.py::test_tls_trust_error_degrades_gracefully-- proves: doctor does not crash when TLS introspection fails; user sees informational degradation [devx]
assert 'Unable to determine TLS trust source' in result.output - [nit] Autouse fixture _isolate_ssl_state does not reset _LAST_TLS_STATUS global -- state leaks between tests at
tests/conftest.py
The fixture clears the lru_cache and calls truststore.extract_from_ssl() but never resets the module-level _LAST_TLS_STATUS. A test calling configure_tls_trust pollutes describe_tls_trust's third branch for all subsequent tests.
Suggested: Addimport apm_cli.core.tls_trust as _tls; _tls._LAST_TLS_STATUS = Nonein the fixture teardown.
Performance Expert -- inactive
PR adds a diagnostic-only describe_tls_trust() function with no loops, no I/O, no subprocess calls; no hot-path (install/resolve/cache/transport) surfaces touched.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
|
Thank you for contributing this pull request. APM starts with an This PR closes #2035, which is a real linked issue, but it is not Please keep the user problem on an issue so a maintainer can review Generated by autopilot-pr-triage-worker. This comment is AI-generated and may contain errors. |
Conflict in tests/conftest.py resolved to main: the shared autouse SSL-isolation fixture is outside the microsoft#2035 apm-scope:v1 record ("no broad fixture refactor is needed for this correction"). Co-authored-by: Copilot App <[email protected]>
The microsoft#2035 apm-scope:v1 record (Decision: approve, 2026-10-21) accepts only the correction to core-HTTPS TLS failure guidance and lists "New doctor TLS output or subcommands" and broad SSL fixture work as out of scope. describe_tls_trust also duplicated trust precedence (placing APM_DISABLE_TRUSTSTORE above an explicit replacement bundle, which contradicts configure_tls_trust), which the record forbids. Restore doctor.py, tls_trust.py and the doctor tests to main so the in-scope correction can be built on the canonical TLS owner. Addresses Copilot inline on src/apm_cli/core/tls_trust.py:103. Co-authored-by: aryansk <[email protected]> Co-authored-by: Copilot App <[email protected]>
…t#2035) The normal TLS failure hint was unconditional: it recommended the OS trust store and APM_EXTRA_CA_BUNDLE even when APM_DISABLE_TRUSTSTORE or a REQUESTS_CA_BUNDLE / CURL_CA_BUNDLE replacement made both ineffective. This is the defect accepted by the microsoft#2035 apm-scope:v1 record. configure_tls_trust, the canonical TLS owner, now records a structured TLSTrustSelection on every path alongside its existing debug line, and tls_failure_guidance() maps that selection to truthful next-step guidance. install/validation.py renders the owner's guidance instead of a hard-coded string, so precedence is not duplicated and diagnostic strings are never parsed as authority. Default/OS-store output is byte-identical; additive, certifi-fallback and unrecorded states stay truthful without naming a setting. No trust selection, precedence, verification or verbose diagnostics change. Regressions cover opt-out, requests/curl replacement, replacement plus opt-out, ignored additive input and the kept modes at the owner, plus the real `apm install` CLI path in normal and --verbose modes with a controlled SSLError (failed exit preserved). Tests that assert the default wording now pin the unrecorded selection so they stay order-independent. Troubleshooting docs, apm-usage guidance and the CHANGELOG are updated. Co-authored-by: aryansk <[email protected]> Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 0 | 1 | Clean single-owner extension: frozen TLSTrustSelection records configure_tls_trust decisions; consumer routes through tls_failure_guidance(). No split authority, no scope creep. |
| DevX UX Expert | 0 | 0 | 1 | Guidance strings are actionable and mode-truthful; no ignored remedies leak; one phrasing nit on the rare replacement+opt-out combined clause. |
| Supply Chain Security Expert | 0 | 0 | 0 | TLS verification semantics, trust-selection boundaries, and secret/path containment are preserved; guidance never steers toward weakening verification. |
| Auth Expert | 0 | 0 | 0 | Auth-neutral: no AuthResolver, token, or credential-flow changes; guidance text names env var names only, never values; TLS-classification path untouched. |
| Doc Writer | 0 | 2 | 1 | Docs are accurate on the main point and the CHANGELOG format is correct. Fix the ssl-issues next step for intentional settings and remove the repeated common-errors paragraph. |
| Test Coverage Expert | 0 | 0 | 0 | All 12 scope-case regressions land with unit + CliRunner coverage and correct module-global isolation; mutation evidence (26 failures on bypass) confirms traps are load-bearing; ship. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 4 follow-ups
- [Doc Writer] ssl-issues.md: add the owner's safe next action for intentional replacement and opt-out settings instead of 'keep the setting if it is intentional' -- In scope ('update directly affected troubleshooting and usage guidance'). The record requires a safe next action; the current sentence stops short.
- [Doc Writer] common-errors.md: collapse the repeated TLS paragraph to a one-sentence cross-reference to ssl-issues.md -- In scope. Redundant guidance that also mishandles the opt-out-only case.
- [DevX UX Expert] Rephrase the replacement+opt-out fallback clause from 'without that replacement' to an explicit if-you-unset warning -- In scope, low priority polish on the rarest path; the user promise already holds.
- [Doc Writer] Update the ssl-issues.md Symptoms sample block to match the actual default guidance text -- Pre-existing drift, but the new paragraph now points readers at that block.
Architecture
classDiagram
direction LR
class TLSTrustSource {
<<Enum>>
REPLACEMENT
OPT_OUT
OS_STORE
OS_STORE_ADDITIVE
CERTIFI_FALLBACK
CERTIFI_ADDITIVE
}
class TLSTrustSelection {
<<ValueObject>>
+source TLSTrustSource
+replacement_setting str
+opt_out bool
}
class tls_trust {
<<CanonicalOwner>>
+configure_tls_trust(env) bool
+tls_failure_guidance() str
+selected_tls_trust() TLSTrustSelection
+explicit_ca_bundle_path(env) str
-_record_tls_trust_status(sel, msg)
-_tls_failure_guidance_for(sel) str
-_explicit_ca_selection(env) tuple
-_LAST_TLS_SELECTION TLSTrustSelection
}
class validation {
<<Consumer>>
-_log_tls_failure(host, exc, verbose, logger)
}
TLSTrustSelection *-- TLSTrustSource : source
tls_trust ..> TLSTrustSelection : records and reads
validation ..> tls_trust : tls_failure_guidance()
class TLSTrustSource:::touched
class TLSTrustSelection:::touched
class tls_trust:::touched
class validation:::touched
classDef touched fill:#fff3b0,stroke:#d47600
flowchart TD
A["apm install owner/repo"] --> B["configure_tls_trust<br/>core/tls_trust.py"]
B --> C{explicit replacement set?}
C -->|yes| E["record REPLACEMENT<br/>winning var + opt_out flag"]
C -->|no| F{APM_DISABLE_TRUSTSTORE?}
F -->|yes| G["record OPT_OUT"]
F -->|no| H{truststore injected?}
H -->|yes| I["record OS_STORE or OS_STORE_ADDITIVE"]
H -->|no| J["record CERTIFI_FALLBACK or CERTIFI_ADDITIVE"]
E --> K["_LAST_TLS_SELECTION"]
G --> K
I --> K
J --> K
K --> L["install/validation.py probe"]
L --> M{SSLError?}
M -->|yes| N["_log_tls_failure"]
N --> O["tls_failure_guidance()"]
O --> Q["logger.warning: mode-specific hint"]
M -->|no| R["validation continues"]
Recommendation
Fold the two doc-writer recommended findings (ssl-issues.md safe next action and common-errors.md redundancy collapse) -- both are in scope and one-line edits -- then ship. The devx phrasing nit is optional polish; the symptom-block drift can follow. Core code is clean, well-tested (423 targeted, 26 mutation-break failures), architecturally sound, and security-neutral.
Full per-persona findings
Python Architect
- [nit] Design patterns applied correctly; no additions warranted at this scope.
Used: frozen dataclass value object (TLSTrustSelection) carrying the trust decision from configure_tls_trust to the guidance renderer; Enum vocabulary (TLSTrustSource) for the six trust modes; record-then-read module state extending the pre-existing _LAST_TLS_STATUS pattern (mutated at startup only); extract-and-delegate (_explicit_ca_selection, which explicit_ca_bundle_path now delegates to, so replacement precedence is not duplicated). The if-chain in _tls_failure_guidance_for is the simplest correct shape for six branches with one conditional clause.
DevX UX Expert
- [nit] REPLACEMENT+OPT_OUT fallback clause: 'without that replacement' is ambiguous under stress at
src/apm_cli/core/tls_trust.py:172
In the combined REPLACEMENT+OPT_OUT path, the fallback sentence reads 'APM_DISABLE_TRUSTSTORE is also set, so without that replacement APM verifies against its bundled CA set only.' A stressed user may parse 'without that replacement' as a concurrent state description rather than a what-happens-if-you-unset warning. The sentence's purpose is to warn that unsetting the replacement does not restore OS trust. Rarest of the six paths, small blast radius.
Suggested: Replace the fallback template with: f" If you unset {setting}, {_DISABLE_ENV_VAR} still prevents OS trust-store use and APM falls back to its bundled CA set only."
Proof (passed):tests/unit/core/test_tls_trust.py::test_replacement_with_opt_out_names_both_settings-- proves: Combined replacement+opt-out guidance names both settings and warns about bundled-CA-only fallback
Supply Chain Security Expert
No findings.
Auth Expert
No findings.
Doc Writer
- [recommended] ssl-issues.md tells users to keep an intentional setting, but gives no action that would fix the failure at
docs/src/content/docs/troubleshooting/ssl-issues.md:23
The new paragraph ends with 'Keep the setting if it is intentional; otherwise unset it and retry.' The owner guidance gives a real next step for intentional settings (make sure the replacement bundle contains every CA you need; with opt-out alone, set REQUESTS_CA_BUNDLE to a complete PEM bundle). A user following the doc changes nothing and gets the same failure. The record asks for a safe next action per mode.
Suggested: Replace the last sentence with: 'If the setting is unintended, unset it and retry. If it is intended, make sure the replacement bundle contains every CA you need; with APM_DISABLE_TRUSTSTORE alone, set REQUESTS_CA_BUNDLE to a complete PEM bundle.' - [recommended] common-errors.md repeats the ssl-issues paragraph, and its wording does not fit the opt-out-only case at
docs/src/content/docs/troubleshooting/common-errors.md:280
The common-errors entry already ends with 'See also: SSL issues', so restating the guidance breaks the state-once, reference-elsewhere rule. It also says 'make sure a replacement bundle contains every CA you need', but with APM_DISABLE_TRUSTSTORE alone no replacement exists; the owner's advice is to set REQUESTS_CA_BUNDLE.
Suggested: Cut the paragraph to one sentence that points to the canonical page: 'If the hint names APM_DISABLE_TRUSTSTORE, REQUESTS_CA_BUNDLE, or CURL_CA_BUNDLE, follow its advice; see SSL issues for each trust mode.' - [nit] The ssl-issues symptom block that the new paragraph calls 'the first hint' does not match the real default text at
docs/src/content/docs/troubleshooting/ssl-issues.md:15
The sample under Symptoms ends with 'set APM_EXTRA_CA_BUNDLE to a readable PEM bundle and retry.' The actual default guidance says '...to add it while retaining public trust. Use REQUESTS_CA_BUNDLE only to replace the complete Requests trust set. See: ...'. The drift predates this PR, but the new paragraph points readers straight at that block.
Suggested: Make the sample text match the default guidance word for word.
Test Coverage Expert
No findings.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
Folds the microsoft#2602 panel follow-ups (all inside the microsoft#2035 scope record's "update directly affected troubleshooting and usage guidance"): - ssl-issues.md: replace "keep the setting if it is intentional" with the owner's safe next action for intentional replacement and opt-out settings (doc-writer FU-1), and align the Symptoms sample with the real default hint text (doc-writer FU-4). - common-errors.md: collapse the repeated paragraph into one sentence that defers to the hint and the existing SSL issues link, so the opt-out-only case is not misdescribed (doc-writer FU-2). - tls_trust.py: reword the replacement+opt-out clause as an explicit "If you unset <setting>, APM_DISABLE_TRUSTSTORE still applies" warning (devx-ux-expert FU-3); owner and CLI regressions updated. Co-authored-by: aryansk <[email protected]> Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 0 | 0 | Delta is a single guidance-string reword inside the canonical TLS owner, with matching test assertions and doc paragraphs. No architectural change. |
| DevX UX Expert | 0 | 0 | 0 | Delta resolves prior ambiguity nit; reworded fallback clause is clear. Doc edits stay consistent with code output. No new UX regressions. |
| Supply Chain Security Expert | 0 | 0 | 0 | Delta rewords TLS guidance string and docs. No verification weakening, no credential leaks, no unsafe advice. All paths still fail-closed and steer toward complete CA bundles. |
| Auth Expert | 0 | 0 | 0 | Delta rewrites TLS trust-store guidance strings and matching test assertions; no token, credential, or AuthResolver surface touched. Auth-neutral. |
| Doc Writer | 0 | 0 | 0 | All three prior doc findings are fixed in 8e4d033, and the folds match tls_trust.py guidance strings. No new inaccuracy found. Ship. |
| Test Coverage Expert | 0 | 0 | 0 | Delta is assertion-only reword; both tests pin the opt-out-survives-unset promise; old wording fully removed; no gap. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Recommendation
All four follow-ups from the full-pass advisory are folded and verified. Zero findings across six delta panelists. CI green, no drift, all review threads resolved, PR body closes #2035, title updated to match scope. No remaining items.
Full per-persona findings
Python Architect
No findings.
DevX UX Expert
No findings.
Supply Chain Security Expert
No findings.
Auth Expert
No findings.
Doc Writer
No findings.
Test Coverage Expert
No findings.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
Co-authored-by: Copilot App <[email protected]>
Avoids landing-order conflicts with other queued PRs. Co-authored-by: Copilot App <[email protected]>
Lane L: main merged for landing
This comment was generated by an AI agent (Lane L landing desk) on behalf of Daniel Meppiel (@danielmeppiel). |
baaf9d2
into
microsoft:main
Clean merge of eight main commits (#3408, #2231, #2602, #3640, #3611, #3645, #3602, #3646); no lockfile or autopilot package conflicts and apm audit --ci passes with no drift. Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
Closes #2035
Summary
apm doctorValidation
mainMaintainer-side folds (2026-11-12, per the #2035 apm-scope:v1 record)
The approved scope on #2035 accepts only the correction to core-HTTPS TLS failure guidance. It lists new doctor TLS output and shared SSL-fixture consolidation as out of scope, so this branch was reworked on top of Aryan Singh K. (@aryansk)'s commit (authorship preserved with Co-authored-by trailers):
apm doctorTLS row,describe_tls_trust, and the doctor test to main. The shared autouse SSL fixture was dropped in the main merge.configure_tls_trust(the canonical TLS owner) records a structuredTLSTrustSelectionon every path.tls_failure_guidance()maps it to truthful advice, andinstall/validation.pyrenders that advice instead of a hard-coded string. WithAPM_DISABLE_TRUSTSTOREor aREQUESTS_CA_BUNDLE/CURL_CA_BUNDLEreplacement active, the hint names that setting and a safe next step. It no longer recommends the OS store orAPM_EXTRA_CA_BUNDLE, which those modes ignore. Default output is byte-identical. Trust selection, precedence, and verification are unchanged.Validation: owner-level regressions for every scope case, plus the real
apm installCLI path in normal and--verbosemodes with a controlled SSLError (exit 1 preserved). The mutation-break gate passed: the new tests fail when the guard is removed. The CI lint mirror is clean.Closes #2035