Skip to content

Add read-only Bitbucket repository review actions - #1949

Open
Paul Lizer (paullizer) wants to merge 3 commits into
Developmentfrom
paullizer-bitbucket-repository-action
Open

Paul Lizer (paullizer) wants to merge 3 commits into
Developmentfrom
paullizer-bitbucket-repository-action

Conversation

@paullizer

Copy link
Copy Markdown
Collaborator

Summary

  • Let users review source in self-hosted Bitbucket Data Center and Bitbucket Cloud without cloning repositories or granting repository-write operations.
  • Support per-user Bitbucket OAuth, shared/scoped token identities, and private token credentials requested in chat. Smart-card/SSO login happens at Bitbucket; SimpleChat and Microsoft 365 session tokens are never forwarded.
  • Enforce author-selected repository allowlists and fixed/any-branch policies on reads and both comparison inputs. Comparisons resolve immutable commits and a merge base, with explicit pagination and omissions.
  • Integrate Classic and V2 editors, private connection controls, encrypted OAuth storage with conditional refresh/disconnect fencing, and deployment/user documentation.

Linked issue

N/A. No associated issue was requested.

Release Notes & Latest Features

  • New Feature
  • Bug Fix
  • UI Enhancement
  • Breaking Change
  • Internal only

Is this visible to end users?

  • Yes
  • No

Is this admin-facing (Admin Settings, governance, deployment, config)?

  • Yes
  • No

Should this become a Latest Feature card?

  • Yes
  • No
  • Already added

Screenshot needed for the card?

  • Yes
  • No
  • Attached

No Latest Feature card is included; card publication and screenshots are left for maintainer selection. Release notes have not been changed.

Version bump

  • application/single_app/config.py VERSION third segment bumped, or not needed because this is docs-only
  • deployers/version.txt bumped, or not needed because deployers/ was not changed

Application version: 0.261.449 -> 0.261.450. No deployer changes.

Testing / validation

Python commands used $env:PYTHONPATH = '.\application\single_app;.\functional_tests'.

  • python -m pytest functional_tests\test_bitbucket_action_plugin.py functional_tests\test_bitbucket_connections.py functional_tests\test_bitbucket_routes.py -q --disable-warnings -p no:cacheprovider --tb=short - 30 passed, including normal/optimized real application bootstrap and actual kernel-loader registration.
  • python -m pytest functional_tests\test_bitbucket_routes.py functional_tests\route_tests\test_route_blueprint_policy_inventory.py functional_tests\route_tests\test_route_unauthenticated_policy_contract.py functional_tests\route_tests\test_route_policy_test_coverage.py -q --disable-warnings -p no:cacheprovider --tb=short - 33 passed.
  • python -m pytest ui_tests\test_bitbucket_action_configuration.py ui_tests\test_classic_action_credentials.py -q --disable-warnings -p no:cacheprovider --tb=short - 32 passed. Classic and V2 Bitbucket layouts also exercised at 390 and 1440 pixels with local production styles and no horizontal overflow.
  • python -m pytest ui_tests\test_v2_action_credentials.py -q --disable-warnings -p no:cacheprovider --tb=short - 27 passed. This suite runs separately because its Playwright lifecycle differs from the shared page fixture.
  • npm --prefix application\v2_ui run typecheck and npm --prefix application\v2_ui run build - passed; the build retains the existing large-chunk warning.
  • python functional_tests\test_docs_app_surface_coverage.py - 7/7 passed. python functional_tests\test_docs_site_quality.py - 6/6 passed.
  • python scripts\check_swagger_routes.py application\single_app\route_backend_bitbucket.py - passed.
  • python -m pytest functional_tests\test_bitbucket_connections.py functional_tests\test_action_personal_credentials.py functional_tests\test_m365_cosmos_sdk_contract.py functional_tests\test_cosmos_document_boundaries.py functional_tests\test_cosmos_contract_runner.py -q --disable-warnings -p no:cacheprovider -p test_support.cosmos_network_guard --tb=short - 107 passed, 1 failed. The sole failure is the existing repository inventory assertion described below.
  • python scripts\check_cosmos_response_boundaries.py --run-contracts - blocked by 18 pre-existing module-fingerprint mismatches in unchanged route_backend_orchestration.py. Only this feature's three new OAuth storage owners and seven affected identity-owner contracts were reviewed/updated; unrelated orchestration reviews were preserved, not reapproved.
  • git --no-pager diff --check - passed before commit.

Deployment acceptance remains outstanding: no live Data Center/Cloud server, customer smart-card/SSO environment, or Azure lab was used. OAuth requires a registered read-only provider application, canonical HTTPS BITBUCKET_REDIRECT_URI, persistent BITBUCKET_TOKEN_ENCRYPTION_KEY, and trusted private network/TLS connectivity. OAuth connect returns users to retry chat; only personal token credential requests use the existing automatic Save and continue flow. Disconnect removes local token access, not the provider-side grant.

Documentation

  • Release notes updated, or not needed
  • Feature documentation updated, or not needed
  • Fix documentation updated, or not needed

Added the Bitbucket action reference and BITBUCKET_REPOSITORY_ACTION.md, updated the personal credentials guide/action index, and regenerated the application surface inventory. Separate fix documentation is not applicable to this new feature. Release notes remain pending approval.

Security checklist

  • New Flask routes include @swagger_route(security=get_auth_security())
  • Settings sent to non-admin frontends use sanitize_settings_for_user()
  • Browser JavaScript is served from local SimpleChat static assets only; no CDN-hosted JS
  • No secrets, keys, connection strings, or local-only artifacts are included

No settings objects are sent to the new frontend. Discovery beyond an action's allowlist requires action-management rights; runtime operations reauthorize the current actor/action. Provider redirects are disabled, Cloud continuation URLs cannot change destination/operation, and repository source is treated as untrusted data. All included credentials and encryption fixtures are synthetic test values.

Support Data Center and Cloud with private OAuth connections, token identities, repository allowlists, and branch policies in Classic and V2 editors.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Handle missing configuration keys before broad lookup failures and cover safe error responses. Leave confirmed pre-existing Cosmos inventory drift for separate review.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve version 0.261.451 and integrate Government Speech changes.

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

This branch has not been deployed

No deployments
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.

2 participants