Skip to content

Conversation

@mujacica
Copy link
Contributor

This commit adds backend support for Perforce version control integration:

  • New Perforce integration with P4 client support
  • Repository and code mapping functionality
  • Stacktrace linking for Perforce depot paths
  • Tests for integration, code mapping, and stacktrace linking
  • Updated dependencies in pyproject.toml

The integration supports:

  • Authentication via P4PORT, P4USER, P4PASSWD, P4TICKET
  • Code mapping between depot paths and project structure
  • Source URL generation for stacktrace frames
  • Integration with Sentry's repository and code mapping systems

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 11, 2025
@cathteng
Copy link
Member

This PR is 2500 lines -- would it possible to split it up for review? There are aspects that should be reviewed by different teams like dependencies, specific features, etc

@mujacica mujacica force-pushed the feat/perforce-backend branch from f566dcc to ab41785 Compare November 13, 2025 12:05
@mujacica mujacica changed the base branch from master to feat/perforce-integration November 13, 2025 12:05
@mujacica mujacica force-pushed the feat/perforce-backend branch 2 times, most recently from 2172a79 to 09e3105 Compare November 13, 2025 12:10
@mujacica
Copy link
Contributor Author

Hey @cathteng, I extracted the stubs/generic code/dependencies into another PR: #103287

This one now contains only perforce-related logic and tests (note that 70% of the lines in the PR now are coming from the tests themselves).

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 18.61314% with 223 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/integrations/perforce/client.py 17.59% 89 Missing ⚠️
src/sentry/integrations/perforce/repository.py 2.77% 70 Missing ⚠️
src/sentry/integrations/perforce/integration.py 31.91% 64 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           feat/perforce-integration   #103171      +/-   ##
==============================================================
- Coverage                      80.69%    80.65%   -0.04%     
==============================================================
  Files                           9230      9230              
  Lines                         394247    394487     +240     
  Branches                       25121     25121              
==============================================================
+ Hits                          318133    318184      +51     
- Misses                         75666     75855     +189     
  Partials                         448       448              

@mujacica mujacica force-pushed the feat/perforce-integration branch from a978a06 to 1197dcd Compare November 13, 2025 12:35
This commit adds backend support for Perforce version control integration:

- New Perforce integration with P4 client support
- Repository and code mapping functionality
- Stacktrace linking for Perforce depot paths
- Tests for integration, code mapping, and stacktrace linking
- Updated dependencies in pyproject.toml

The integration supports:
- Authentication via P4PORT, P4USER, P4PASSWD
- Code mapping between depot paths and project structure
- Source URL generation for stacktrace frames
- Integration with Sentry's repository and code mapping systems
@mujacica mujacica force-pushed the feat/perforce-backend branch from 2a52e60 to ecfa2ce Compare November 13, 2025 12:37
@mujacica mujacica marked this pull request as ready for review November 13, 2025 13:00
@mujacica mujacica requested review from a team as code owners November 13, 2025 13:00

# Remove depot prefix to get relative path
if url.startswith(depot_path):
return url[len(depot_path) :].lstrip("/")
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: URL Path Normalization Fails

After stripping the p4:// prefix from the URL, the depot path comparison fails because depot_path from config typically includes leading slashes (e.g., //depot) while the stripped URL doesn't (e.g., depot/path/file.cpp). The startswith check on line 266 will always return false, causing the method to return the full URL instead of the relative path.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants