Skip to content

refactor: add Obsolete attributes to outdated methods#972

Merged
vbreuss merged 5 commits intomainfrom
topic/add-obsolete-attribute-to-outdated-methods
Mar 16, 2026
Merged

refactor: add Obsolete attributes to outdated methods#972
vbreuss merged 5 commits intomainfrom
topic/add-obsolete-attribute-to-outdated-methods

Conversation

@vbreuss
Copy link
Member

@vbreuss vbreuss commented Mar 16, 2026

This PR prepares Testably.Abstractions.Testing for the upcoming v6.0.0 release by marking selected legacy APIs as obsolete so consumers can migrate before removal.

Key Changes:

  • Made Notification.ExecuteWhileWaiting(...) and related helper types unconditionally [Obsolete].
  • Made IAwaitableCallback<TValue>.Wait(filter, ...) unconditionally [Obsolete].
  • Made MockTimeSystem(ITimeProvider) unconditionally [Obsolete].

...in preparation for v6.0.0 release
@vbreuss vbreuss self-assigned this Mar 16, 2026
Copilot AI review requested due to automatic review settings March 16, 2026 14:23
@vbreuss vbreuss added the refactor A change or improvement without functional impact label Mar 16, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prepares Testably.Abstractions.Testing for the upcoming v6.0.0 release by marking selected legacy APIs as obsolete so consumers can migrate before removal.

Changes:

  • Made Notification.ExecuteWhileWaiting(...) and related helper types unconditionally [Obsolete].
  • Made IAwaitableCallback<TValue>.Wait(filter, ...) unconditionally [Obsolete].
  • Made MockTimeSystem(ITimeProvider) unconditionally [Obsolete].
  • Updated the net10.0 API approval baseline to reflect the new attributes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Tests/Api/Testably.Abstractions.Api.Tests/Expected/Testably.Abstractions.Testing_net10.0.txt Updates API approval baseline (net10.0) to include new [Obsolete] attributes.
Source/Testably.Abstractions.Testing/Notification.cs Removes conditional compilation and always applies [Obsolete] to ExecuteWhileWaiting APIs and related types.
Source/Testably.Abstractions.Testing/MockTimeSystem.cs Removes conditional compilation and always applies [Obsolete] to the ITimeProvider constructor.
Source/Testably.Abstractions.Testing/IAwaitableCallback.cs Removes conditional compilation and always applies [Obsolete] to the Wait(filter, ...) overload.
Comments suppressed due to low confidence (1)

Source/Testably.Abstractions.Testing/IAwaitableCallback.cs:39

  • This Wait(filter, timeout, ...) overload is now unconditionally [Obsolete]. There are existing tests that call it (e.g., wait.Wait(t => ...)) and they currently guard their own [Obsolete] annotations behind MarkExecuteWhileWaitingNotificationObsolete, which doesn’t appear to be defined. Please either update those tests to use the non-obsolete Wait/WaitAsync overloads (and apply the filter at callback creation time) or suppress CS0618 in the specific tests that intentionally cover the obsolete overload.
	[Obsolete("Use another `Wait` or `WaitAsync` overload and move the filter to the creation of the awaitable callback.")]
	void Wait(Func<TValue, bool>? filter = null,
		int timeout = 30000,
		int count = 1,
		Action? executeWhenWaiting = null);

@github-actions
Copy link

github-actions bot commented Mar 16, 2026

Test Results

    102 files  ± 0      102 suites  ±0   2h 27m 38s ⏱️ + 2m 1s
112 452 tests  - 17   99 849 ✅  - 17  12 603 💤 ±0  0 ❌ ±0 
267 982 runs  ± 0  231 454 ✅ ± 0  36 528 💤 ±0  0 ❌ ±0 

Results for commit c8fad59. ± Comparison against base commit 1666aa9.

♻️ This comment has been updated with latest results.

@sonarqubecloud
Copy link

@vbreuss vbreuss merged commit 8b1629f into main Mar 16, 2026
14 checks passed
@vbreuss vbreuss deleted the topic/add-obsolete-attribute-to-outdated-methods branch March 16, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor A change or improvement without functional impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants