Perforce
Map Helix Core depots to projects and deliver changelist activity to Project Feed.
- PlanPro or Enterprise
- WhoOwners and admins
Connect Helix Core and P4 Code Review without opening your server to Project Feed. Mapped changelists, shelves, reviews, comments, votes, and build results become project activity. With a P4 Code Review URL configured, changelists or reviews that name a task attach to it.
- One inbound endpoint per workspace connection and one mapping key per project mapping
- Helix Core change-commit, shelve-commit, and shelve-delete trigger events
- P4 Code Review review, comment, vote, reaction, status, submit, and test events
- Build started and completed events from any CI system
- Optional exact stream filters and per-mapping event selection
Attribution
Incoming activity is credited to a manually mapped Perforce user first, then an active workspace member with the same email. Unmatched users keep their Perforce display name and are never credited to the person who installed the connection.
Perforce setup
Create the connection and mappings
- 1.
Create the connection
Open workspace integration settings, connect Perforce, and enter a stable server ID. Add the HTTPS base URL for P4 Code Review if review links should be clickable.
- 2.
Save the token
Copy the delivery token into the secret manager used by P4 Code Review, Helix Core, or CI. Project Feed shows it only once.
- 3.
Map a depot path
Choose a Project Feed project, enter its depot path, select events, and add exact stream filters if needed. Copy the mapping key from the new row.
- 4.
Send a test
Send a ping with the endpoint, bearer token, and mapping key. The connection page shows the last accepted delivery without adding noise to the project feed.
P4 Code Review 2026.3 and newer
- Create a webhook definition under Webhooks. Only an admin or super user can manage it.
- Set URL to the endpoint shown in Project Feed and leave TLS verification enabled.
- Add Authorization as an authentication header with Bearer followed by the one-time delivery token.
- Add X-Project-Feed-Mapping as a custom header with the mapping key.
- Select the review and comment events you need, attach the webhook to the workflow used by the mapped project, then save.
- Use Test on the Deliveries tab. A successful ping updates Last delivery in Project Feed. Delivery history can retry a failed request.
Native webhook coverage
P4 Code Review webhooks cover reviews and comments. Use Helix Core triggers for submitted changelists and shelves, and send build events from CI. P4 Code Review releases before 2026.3 need the normalized sender path for review events too.
Normalized event contract
Helix triggers and CI send a JSON object to the same endpoint. Set the event in the body or in X-Project-Feed-Event. Set a stable retry ID in X-Project-Feed-Delivery; without one, Project Feed deduplicates the event and exact body together.
{
"event": "change.committed",
"deliveryId": "p4-main:change:18432",
"actor": {
"id": "mira",
"name": "Mira Chen",
"email": "mira@example.com"
},
"change": {
"id": "18432",
"title": "PRO-418 Fix boss phase transition",
"description": "PRO-418 Fix boss phase transition",
"stream": "//Game/Main",
"url": "https://review.example.com/changes/18432"
}
}Accepted Core events are change.committed, shelf.created, and shelf.deleted. The trigger aliases change-commit, shelve-commit, and shelve-delete work too. CI can send build.started or build.completed with a build object in the same shape.
Helix Core trigger
Install a small sender on the server that runs the trigger. Use full executable paths because trigger processes have a restricted environment. If the sender calls p4 describe to enrich the event, use a ticketed user limited to the mapped depot; do not put a plaintext password in the script or Project Feed.
#!/bin/sh
set -u
EVENT="$1"
CHANGE="$2"
P4_USER="$3"
STREAM="$4"
P4="/opt/perforce/bin/p4"
CURL_CONFIG="/etc/project-feed/perforce-curl.conf"
export P4PORT="ssl:p4-commit.internal:1666"
export P4USER="project-feed-trigger"
export P4TICKETS="/etc/project-feed/p4-tickets"
DESCRIPTION="$("$P4" describe -s "$CHANGE" 2>/dev/null |
/usr/bin/sed -n '2,20p' | /usr/bin/tr '\n' ' ' | /usr/bin/cut -c1-2000)"
/usr/bin/jq -n \\
--arg event "$EVENT" \\
--arg delivery "p4-main:$EVENT:$CHANGE" \\
--arg change "$CHANGE" \\
--arg user "$P4_USER" \\
--arg stream "$STREAM" \\
--arg description "$DESCRIPTION" \\
'{event:$event,deliveryId:$delivery,actor:{id:$user,name:$user},change:{id:$change,description:$description,stream:$stream}}' |
/usr/bin/curl --config "$CURL_CONFIG" \\
--header "X-Project-Feed-Delivery: p4-main:$EVENT:$CHANGE" \\
--data-binary @- ||
/usr/bin/logger -t project-feed-perforce "delivery failed for $EVENT $CHANGE"
exit 0Add the executable using p4 triggers. Scope the path in the trigger table to the same depot owned by the mapping. The curl config should be readable only by the trigger account and contain the endpoint URL, JSON content type, bearer token, mapping header, TLS verification, a ten-second timeout, and fail-on-error settings. Keeping credentials in that file prevents them from appearing in the trigger process arguments.
url = "https://projectfeed.app/api/integrations/perforce/p4c_..." header = "Content-Type: application/json" header = "Authorization: Bearer pfp4_..." header = "X-Project-Feed-Mapping: p4m_..." proto = "=https" fail silent show-error max-time = 10
Set the config and ticket files to mode 600. Replace the bearer token in the config whenever it is rotated in Project Feed.
project-feed-change change-commit //Game/Main/... "/opt/project-feed/send.sh change-commit %change% %user% //Game/Main" project-feed-shelf shelve-commit //Game/Main/... "/opt/project-feed/send.sh shelve-commit %change% %user% //Game/Main" project-feed-unshelf shelve-delete //Game/Main/... "/opt/project-feed/send.sh shelve-delete %change% %user% //Game/Main"
Keep post-commit delivery fail-open
The sender above always exits zero. A Project Feed outage must not block a submitted changelist or shelf operation. Monitor the local log and retry out of band if delivery matters. Metadata-only replicas do not run change-commit triggers; install it on the commit server. Edge deployments may also need shelf promotion before a central sender can describe shelf contents.
Limits and rotation
- Payloads are limited to 128 KB and JSON objects. Long text, names, URLs, identifiers, and filter lists are bounded again after parsing.
- The endpoint accepts up to 300 deliveries per minute per connection. A 429 response includes Retry-After.
- Stream and P4 Code Review project filters are exact matches. The mapping key, not a payload depot path or project name, selects the Project Feed project.
- Review links are kept only when they use HTTPS and match the configured P4 Code Review origin.
- Rotating the token invalidates the old token immediately. Disconnecting revokes the endpoint while preserving existing feed activity.
Perforce access and disconnecting
- Owners and admins manage the connection, delivery token, and mappings.
- The delivery token lets a sender post events to this connection, and the mapping key selects which project receives them. Project Feed shows the token once, so store it in your secret manager.
- If the token is exposed, choose Rotate token. The old token stops working at once. To stop all deliveries, choose Disconnect. Existing activity stays in Project Feed.
Fix Perforce connection problems
- The endpoint returns 401
- Check the Bearer token in the sender's protected configuration. If the token was rotated or lost, copy the new one into the sender and send a test.
- The delivery is accepted but no project activity appears
- Verify the X-Project-Feed-Mapping value, enabled event type, exact stream filter, and JSON event name. A connection token authenticates the sender but does not choose the destination project.
- The endpoint returns 429
- Honor Retry-After and retry outside the Helix transaction. Keep the change or shelf operation fail-open so Project Feed availability cannot block source control.
- A retry creates duplicate activity
- Send the same stable delivery ID for every attempt of one event. Do not create a new ID on each retry.