Repository navigation
MAINT: deprecate unused network_retries in CopilotAuthenticator - #3790
Merged
Roman Lutz (romanlutz) merged 8 commits intoNov 3, 2026
Merged
Roman Lutz (romanlutz) merged 8 commits into
Roman Lutz (romanlutz) merged 8 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The deprecation warning uses warnings.warn instead of PyRIT’s standard helper, bypassing consistent formatting and migration guidance to omit network_retries.
1 open issue
What changed in this PR
Deprecates the unused CopilotAuthenticator.network_retries argument to address #3789 without adding retries to the interactive login flow.
Changes:
- Warns when a non-
Noneretry value is supplied; default construction remains warning-free. - Documents removal in 1.4.0 and retains
DEFAULT_NETWORK_RETRIESfor compatibility. - Replaces unused-attribute assertions with warning-behavior tests.
| File | Description |
|---|---|
tests/unit/auth/test_copilot_authenticator.py |
Tests default construction and explicit use of the deprecated argument. |
pyrit/auth/copilot_authenticator.py |
Deprecates the no-op argument and removes its unused stored attribute. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the shared warning helper with migration guidance and caller attribution. Schedule removal of the unused argument and constant for 1.3.0 as requested, and cover explicit default, zero and sentinel values. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Roman Lutz (romanlutz)
approved these changes
Nov 3, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ment deprecation Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes #3789.
CopilotAuthenticator(network_retries=...)was documented as controlling network retries, but its value was only stored and never used. Deprecate this no-op without adding retries to the interactive login flow.pyrit.common.deprecation.print_deprecation_messagewith guidance to omit the argument.DEFAULT_NETWORK_RETRIESin 1.3.0, as requested by the maintainer for this unused API.3and continue accepting integer values during deprecation. Explicit values, including0and the old default3, emit oneDeprecationWarningat the caller.Noneremain warning-free. Authentication behavior is unchanged.Tests and Documentation
Expanded warning tests cover omitted arguments, explicit
None,0, the old default3, and custom5. They assert the standard migration message, removal version, a single warning, and caller attribution. Existing constant and mock authentication tests remain in place.uv run --no-sync --offline python -m pytest tests\unit\auth\test_copilot_authenticator.py tests\unit\prompt_target\target\test_websocket_copilot_target.py tests\unit\common\test_deprecation.py -q --timeout=120: passed, 120 tests.uv run --no-sync --offline python -m ruff check pyrit\auth\copilot_authenticator.py tests\unit\auth\test_copilot_authenticator.py: passed.uv run --no-sync --offline python -m ruff format --check pyrit\auth\copilot_authenticator.py tests\unit\auth\test_copilot_authenticator.py: passed.uv run --no-sync --offline python -m ty check pyrit\auth\copilot_authenticator.py tests\unit\auth\test_copilot_authenticator.py --output-format concise: passed.Validation uses mock-based tests only, without a real browser login or user credentials. Updated the constructor docstring and constant documentation to
1.3.0. No documentation pages or notebooks changed, so JupyText was not run.