Skip to content

test: pin fail-soft contract for rootdir symlink probe - #6227

Merged
iamwhatever merged 2 commits into
kirodotdev:mainfrom
piyushrajyadav:test/root-symlink-probe-failsoft
Aug 27, 2026
Merged

test: pin fail-soft contract for rootdir symlink probe#6227
iamwhatever merged 2 commits into
kirodotdev:mainfrom
piyushrajyadav:test/root-symlink-probe-failsoft

Conversation

@piyushrajyadav

@piyushrajyadav piyushrajyadav commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

The symlink capability probe exists in two places with the same fail-soft contract:

  • _can_create_symlink in test/conftest.py
  • _root_can_create_real_symlink in repo-root conftest.py

While _can_create_symlink was pinned in #5943 via test/test_symlink_capability_probe.py, its rootdir sibling _root_can_create_real_symlink remained unpinned against regression.

Why it matters

Both probes run at conftest import time (_HAS_SYMLINKS and _ROOT_HAS_REAL_SYMLINKS). If an unanticipated filesystem error (OSError, missing os.symlink attribute, or NotImplementedError) is allowed to propagate, it results in a whole-suite collection error taking down the entire test run, rather than failing soft and skipping only the symlink-dependent tests.

What changed (motivation → approach → change)

  • Extended test/test_symlink_capability_probe.py using a fixture (symlink_probe) that parametrizes all test cases across both test/conftest.py's _can_create_symlink and repo-root conftest.py's _root_can_create_real_symlink (accessed via pytest's plugin manager).
  • Pinned fail-soft behavior across:
    • Standard decline errnos (EPERM, EACCES, EOPNOTSUPP, ENOSYS)
    • Windows privilege absence (winerror == 1314 with unrelated errno)
    • Unanticipated filesystem OSError (e.g. EIO)
    • Missing/unsupported symlink runtime (NotImplementedError and missing os.symlink attribute)

Tests

  • Added parametrized test coverage in test/test_symlink_capability_probe.py covering 16 test permutations across both probes.
  • Ran pytest test/test_symlink_capability_probe.py — all 16 tests passed.

Manual verification

N/A — unit test coverage directly tests the probe functions and failure modes.

Related Issues

Fixes #5946

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Extend test_symlink_capability_probe.py to parametrize test cases over both test/conftest.py's _can_create_symlink and root conftest.py's _root_can_create_real_symlink probes.

Ensures that unanticipated filesystem OSErrors, Windows privilege absence (winerror 1314 with unrelated errno), NotImplementedError, and missing symlink attributes disable symlink capability without raising an error during conftest collection.

Fixes kirodotdev#5946
@piyushrajyadav
piyushrajyadav requested a review from a team as a code owner August 27, 2026 05:36
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Aug 27, 2026
@dwu96

dwu96 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@piyushrajyadav

piyushrajyadav commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

@dwu96 Thanks for the heads up! I've updated the PR description with all the required sections from the PR template (Problem / Motivation, Why it matters, What changed, Tests, and checklist).

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 27, 2026
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed a4ce33a474ccf124bf32b0a6a6d0f8468597d1df via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] a4ce33a

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of a4ce33a474ccf124bf32b0a6a6d0f8468597d1df via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Both probes in the base already catch (OSError, NotImplementedError, AttributeError), so the new tests pin existing behavior rather than demand new code — and the pre-existing test file was actually exercising test/conftest.py's probe despite claiming to cover the rootdir one, which this PR corrects. The fixture reaches the live rootdir conftest via the plugin manager (correctly avoiding a re-import that would re-run the conftest's import-time side effects), and the two probes genuinely differ (target_is_directory=True on the rootdir one), so parametrizing tests over both rather than deduplicating the probes is the right shape. Test-only, no contract or reversibility concerns.

Design-Verdict: PASS

Pins a real, previously-unpinned fail-soft contract on the rootdir probe with a proportionate, test-only change that also fixes the old test's mislabeled target.

[DESIGN-REVIEWED] a4ce33a

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed a4ce33a474ccf124bf32b0a6a6d0f8468597d1df via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] a4ce33a

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Aug 27, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Aug 27, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) August 27, 2026 07:04

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: test (1 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: parameterises the existing symlink-capability-probe regression tests over both the test/ and rootdir conftest probes and adds a missing-os.symlink case; single test file, no runtime code. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 27, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: test (1 file). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: test: pin fail-soft contract for rootdir symlink probe — test-file-only change extending existing probe regression tests to both conftests. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations. Note: auto-merge could not be armed from this run (agent command posture blocks gh pr merge); merge remains gated by branch protection and a maintainer.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Aug 27, 2026
@iamwhatever
iamwhatever merged commit 89f07fc into kirodotdev:main Aug 27, 2026
69 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin the rootdir symlink probe's fail-soft contract (sibling of the probe #5943 pinned)

4 participants