test(bitbucket): pin redirect rejection for authenticated requests - #1106
test(bitbucket): pin redirect rejection for authenticated requests#1106KatalKavya96 wants to merge 1 commit into
Conversation
|
Hi @potiuk, followed up on the non-blocking nit from #1078. This adds direct regression coverage for It is intentionally test-only: one file changed, no runtime or docs changes. Focused redirect tests, full Bitbucket pytest, ruff, formatting, mypy, and |
onlyarnav
left a comment
There was a problem hiding this comment.
LGTM!
The prek CI workflow failed on check-family-plugins due to an unrelated upstream-main marketplace sync issue (magpie-utilities missing the report-framework-issue family symlink), as noted in the PR description. Core test suites (pytest (bitbucket), CodeQL, Analyze (python)) are all green.
Bitbucket redirect guard regression test
Summary
NoAuthRedirectHandler.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
prek run --all-filespassesFor Python packages touched:
uv run pytest/ruff check/mypypassesFor Groovy bridges touched: command-line invocation tested end-to-end
For skill changes: eval suite passes for the affected skill
(
PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)For skill behaviour changes: a new or updated eval fixture is included in this PR
(a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
Other:
PYTHONPATH=src uv run --group dev pytest tests/test_bitbucket.py -q -k "redirect_handler"tests/test_bitbucket.pysuite passesuv run --group dev ruff format --check src testsgit diff --checkprek run --all-filespasses all relevant checks;check-family-pluginscurrently fails on an unrelated upstream-main marketplace sync issue (magpie-utilitiesmissing thereport-framework-issuefamily symlink)RFC-AI-0004 compliance
No behavioural or mutation changes are introduced by this PR.
<PROJECT>,<tracker>,<upstream>,<security-list>) used in all skill / tool prose (thecheck-placeholdersprek hook is the mechanical gate)Linked issues
Refs #606
Follow-up to #1078
Notes for reviewers
This directly addresses the non-blocking review note from #1078.
SameHostRedirectHandleralready had direct redirect-behaviour coverage, whileNoAuthRedirectHandlerdid not. The latter now guards the first Bitbucket write path, so this test pins the intended behaviour explicitly: any redirect attempt raisesBitbucketErrorinstead of producing a redirected authenticated request.The change is intentionally limited to
tools/bitbucket/tests/test_bitbucket.py.