Skip to content

[BREAKING] [MAINT]: remove rampart_sinks fixture and deprecation warnings - #175

Open
Nina Chikanov (nina-msft) wants to merge 3 commits into
microsoft:mainfrom
nina-msft:nina-msft-cautious-spork
Open

[BREAKING] [MAINT]: remove rampart_sinks fixture and deprecation warnings#175
Nina Chikanov (nina-msft) wants to merge 3 commits into
microsoft:mainfrom
nina-msft:nina-msft-cautious-spork

Conversation

@nina-msft

@nina-msft Nina Chikanov (nina-msft) commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

Team discussed that formal deprecation cycles are unnecessary this early in the project, so this removes the deprecated rampart_sinks fixture path entirely rather than keeping it around with warnings. The pytest_rampart_sinks hook becomes the single, enforced way to register report sinks.

Key changes:

  • Delete rampart/common/deprecation.py and its emit_deprecation_warning helper.
  • Remove the _rampart_sink_bootstrap autouse fixture and the now-unused _has_sink_hook_impl guard from the pytest plugin; sink resolution now goes through the hook only, in both single-process and xdist controller runs.
  • Remove discover_sinks_from_conftest and its fixture-unwrap helpers from _xdist.py.
  • Add an explicit --collect-only guard in pytest_sessionfinish. "No reports on collect-only" was previously an accidental side effect of fixture timing; with the hook resolved unconditionally at session finish, it is now enforced directly so collection never overwrites report files.
  • Migrate the xdist aggregation test conftest from the fixture to the hook (keeps end-to-end emission coverage) and drop the deprecation-contract tests.
  • Update docs to describe hook-only sink registration.

Validation: ruff check . is clean and the full suite passes (1013 passed, 5 skipped), including the slow subprocess xdist tests.

Breaking changes

Yes. Projects that register sinks via a rampart_sinks fixture will silently stop emitting reports. Migration: define a pytest_rampart_sinks(config) hook in conftest.py returning the same list of sinks.

def pytest_rampart_sinks(config):
    return [JsonFileReportSink(output_dir=Path(".report"))]

Checklist

  • pre-commit run --all-files passes
  • Tests added or updated for changes
  • Documentation updated

…arnings

Formal deprecation is unnecessary this early in the project, so remove the
deprecated rampart_sinks fixture path entirely and make the pytest_rampart_sinks
hook the only way to register report sinks.

- Delete rampart/common/deprecation.py and the emit_deprecation_warning helper
- Remove the _rampart_sink_bootstrap fixture and _has_sink_hook_impl guard from
  the pytest plugin; resolve sinks via the hook only
- Remove discover_sinks_from_conftest and its fixture-unwrap helpers from _xdist
- Guard --collect-only in pytest_sessionfinish so collection never emits reports
  (previously an implicit side effect of fixture timing)
- Migrate the xdist aggregation test conftest to the hook and drop deprecation tests
- Update docs to describe hook-only sink registration

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@nina-msft Nina Chikanov (nina-msft) changed the title [REFACTOR] [BREAKING]: remove rampart_sinks fixture and deprecation warnings [BREAKING] [MAINT]: remove rampart_sinks fixture and deprecation warnings Aug 25, 2026
@@ -1,56 +0,0 @@
# Copyright (c) Microsoft Corporation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure if we want to keep this around in case we want to deprecate in the future. Since its only one file, we can easily write this up again once we decide this project needs a formal deprecation strategy

msgraph-sdk is only installed via the onedrive extra, so ty cannot resolve
its TYPE_CHECKING import in the default environment. Add an inline
ty: ignore[unresolved-import] matching the repo's suppression convention.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The unresolved-import failure was caused by a local environment synced without
the optional onedrive extra, not by the source. CI runs uv sync --all-extras, so
msgraph-sdk is present and the import resolves; the inline ty: ignore would then
be flagged as an unused-ignore-comment and fail CI. Revert to the original import
and resolve locally with uv sync --all-extras.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@nina-msft
Nina Chikanov (nina-msft) marked this pull request as ready for review August 26, 2026 00:21
@nina-msft
Nina Chikanov (nina-msft) requested a review from a team August 26, 2026 00:21
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

1 participant