Skip to content

Add tests for bulk code mappings endpoint #1075

@romtsn

Description

@romtsn

Context

Comprehensive test coverage for the new bulk code mappings endpoint. Follows patterns from tests/sentry/integrations/api/endpoints/test_organization_code_mappings.py.

Test categories

Category Cases
Happy path Create multiple, update existing, mixed create+update, single mapping
Validation Missing fields, >200 mappings, invalid paths (spaces/quotes), invalid branch
Resolution errors Unknown project slug, unknown repo name, repo without integration, integration not installed on org
Permissions org:ci scope allows POST, no project access → 403, org member with org:read can POST
Security (IDOR) Project from other org → 404, repo from other org → 404
Edge cases Duplicate stackRoots in request (last-write-wins), partial failure → 207, post-save signal fires

Files

  • Create: tests/sentry/integrations/api/endpoints/test_organization_code_mappings_bulk.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions