Skip to content

Commit ec91e67

Browse files
committed
Update admin/code_hosts/perforce.schema.json schema for v6.5.1211
1 parent 9f8f7c8 commit ec91e67

File tree

1 file changed

+28
-84
lines changed

1 file changed

+28
-84
lines changed

docs/admin/repo/perforce.mdx

Lines changed: 28 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -221,122 +221,66 @@ With this setting, Sourcegraph will ignore any rules with a host other than `*`,
221221

222222
{/* SCHEMA_SYNC_START: admin/code_hosts/perforce.schema.json */}
223223
{/* WARNING: This section is auto-generated during releases. Do not edit manually. */}
224-
{/* Last updated: Manual setup - will be automated via sourcegraph/sourcegraph releases */}
224+
{/* Last updated: 2025-07-01T22:00:57Z via sourcegraph/sourcegraph@v6.5.1211 */}
225225
```json
226226
{
227227
// If non-null, enforces Perforce depot permissions.
228-
"authorization": null,
228+
"authorization": {
229+
"ignoreRulesWithHost": false,
230+
"subRepoPermissions": false
231+
},
229232

230233
// Depots can have arbitrary paths, e.g. a path to depot root or a subdirectory.
231-
"depots": null,
232234
// Other example values:
233235
// - [
234-
// "//Sourcegraph/",
235-
// "//Engineering/Cloud/"
236-
// ]
236+
// - "//Sourcegraph/",
237+
// - "//Engineering/Cloud/"
238+
// - ]
239+
"depots": null,
237240

238241
// Configuration for the experimental p4-fusion client
239-
"fusionClient": null,
240-
241-
// Only import at most n changes when possible (git p4 clone --max-changes).
242-
"maxChanges": 1000,
242+
"fusionClient": {
243+
"cacheLabels": false,
244+
"enabled": false,
245+
"fsyncEnable": false,
246+
"includeBinaries": false,
247+
"lookAhead": 2000,
248+
"maxChanges": -1,
249+
"networkThreads": 12,
250+
"networkThreadsFetch": 12,
251+
"noConvertLabels": false,
252+
"printBatch": 100,
253+
"refresh": 1000,
254+
"retries": 10
255+
},
243256

244257
// Client specified as an option for p4 CLI (P4CLIENT, also enables '--use-client-spec')
245258
"p4.client": null,
246259

260+
// REQUIRED:
247261
// The ticket value for the user (P4PASSWD). You can get this by running `p4 login -p` or `p4 login -pa`. It should look like `6211C5E719EDE6925855039E8F5CC3D2`.
248262
"p4.passwd": null,
249263

264+
// REQUIRED:
250265
// The Perforce Server address to be used for p4 CLI (P4PORT). It's recommended to specify the protocol prefix (e.g. tcp: or ssl:) as part of the address.
251-
"p4.port": null,
252266
// Other example values:
253267
// - "ssl:111.222.333.444:1666"
254268
// - "tcp:111.222.333.444:1666"
269+
"p4.port": null,
255270

271+
// REQUIRED:
256272
// The user to be authenticated for p4 CLI (P4USER).
257-
"p4.user": null,
258273
// Other example values:
259274
// - "admin"
275+
"p4.user": null,
260276

261277
// The pattern used to generate the corresponding Sourcegraph repository name for a Perforce depot. In the pattern, the variable "{depot}" is replaced with the Perforce depot's path.
262-
//
263278
// For example, if your Perforce depot path is "//Sourcegraph/" and your Sourcegraph URL is https://src.example.com, then a repositoryPathPattern of "perforce/{depot}" would mean that the Perforce depot is available on Sourcegraph at https://src.example.com/perforce/Sourcegraph.
264-
//
265279
// It is important that the Sourcegraph repository name generated with this pattern be unique to this Perforce Server. If different Perforce Servers generate repository names that collide, Sourcegraph's behavior is undefined.
266280
"repositoryPathPattern": "{depot}"
267281
}
268282
```
269-
270-
## Known issues and limitations
271-
272-
We are actively working to significantly improve Sourcegraph's Perforce support. Please [contact us](https://help.sourcegraph.com/hc/en-us/requests/new) to help us prioritize any specific improvements you'd like to see.
273-
274-
- Sourcegraph was initially built for Git repositories only, so it stores Perforce depots as Git repositories when syncing. Perforce concepts and languages are expressed in the UI, but under the hood, Git tools are used.
275-
- Batch Changes does not support [file-level permissions](#file-level-permissions) (also known as sub-repo permissions)
276-
- Batch Changes does not handle the shelved changelist other than to query the Perforce server for its status.
277-
- Permalinks with Changelist Id do not work yet
278-
279-
## Configure experimental features
280-
281-
As of Sourcegraph 5.1, there are the following experimental features for Perforce depots. These are merely for providing feedback and have [limited support](/admin/beta_and_experimental_features#experimental-features).
282-
283-
### Changelist ID in URLs
284-
285-
Note: When enabling changelist IDs in URLs for the first time, Perforce depots can be unavailable for a few minutes on the Sourcegraph instance, due to the initial mapping of changelist IDs to generated commit ID happening in the background. If you have a large number of Perforce depots, we recommend proceeding with the following steps in a maintenance window in which you don't expect large amounts of traffic on your Sourcegraph instance.
286-
287-
Add `"perforceChangelistMapping": "enabled",` to `experimentalFeatures` in the [site configuration](/admin/config/site_config):
288-
289-
```json
290-
{
291-
"experimentalFeatures": {
292-
"perforceChangelistMapping": "enabled"
293-
}
294-
}
295-
```
296-
297-
When enabled, URLs for Perforce code hosts will use the Changelist (CL) ID instead of commit SHAs. Areas that benefit from this at the moment are:
298-
299-
- Viewing a specific CL
300-
- Viewing the files of a depot at a specific CL
301-
- Viewing a specific file added / removed / modified in a specific CL
302-
- Viewing the list of CLs
303-
304-
305-
### Searching within a specific changelist
306-
As of Sourcegraph 5.5, you can search within a specific changelist by referring the the changelist as a reference path like `changelist/123` where 123 is the changelist id. For example, given a repo path of `Talkhouse/main` and a changelist id of `123`, you can search within that changelist by using the following query:
307-
```
308-
repo:^Talkhouse/main$@changelist/123 text to find
309-
```
310-
311-
or
312-
```
313-
repo:^Talkhouse/main$ rev:changelist/123 text to find
314-
```
315-
316-
#### Limitations
317-
318-
- After a depot is cloned or fetched, Sourcegraph computes and stores mappings of CL IDs to commit SHAs. This mapping can take several minutes for large clones/fetches. When a background mapping job is running, the depot won't be serviceable as URLs referring to CL IDs may not resolve and users may see an error while interacting with the depot.
319-
- This experimental configuration can not be selectively enabled for a specific perforce depot.
320-
321-
#### Mechanism
322-
323-
To support CLs natively in the URLs, Sourcegraph performs background computation after syncing the contents of a depot. That's done by parsing each generated commit to retrieve the corresponding CL ID and store it in the `repo_commits_changelists` table. This is currently performed on only one depot at a time and we are working to support this for multiple depots in parallel in an upcoming release.
324-
325-
Additionally, while removing a depot from a code host config will mark it as "deleted", the mapped information will **not** be deleted to prevent forced re-computation after an accidental removal of depot from a code host config. Similarly recloning a depot will **not** trigger a computation of all the CLs from the beginning of the depot's source control history. If site admins are recloning or deleting and re-adding a depot to Sourcegraph as a result of history rewrite of a depot in Perforce, they should get in [touch with us](mailto:[email protected]) for next steps.
326-
327-
### Batch Changes support for Perforce depots
328-
329-
Add `"batchChanges.enablePerforce": true` to `experimentalFeatures` in the [site configuration](/admin/config/site_config):
330-
331-
```json
332-
{
333-
"experimentalFeatures": {
334-
"batchChanges.enablePerforce": true,
335-
}
336-
}
337-
```
338283
{/* SCHEMA_SYNC_END: admin/code_hosts/perforce.schema.json */}
339-
340284
## Configuration Notes
341285

342286
- **p4-fusion Recommended**: Use the `fusionClient` configuration for better performance compared to `git p4`.

0 commit comments

Comments
 (0)