Skip to content

Commit 5a5899a

Browse files
committed
feat(search): import large permission snapshots in bounded parts
1 parent 796c04a commit 5a5899a

46 files changed

Lines changed: 37265 additions & 226 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/scripts/http-e2e.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ case "$group" in
260260
;;
261261
organization-search)
262262
GITLAB_CSV_E2E_BASE_URL="$local_app_url" \
263+
GITLAB_CSV_E2E_LARGE_IMPORT=1 \
263264
GITLAB_CSV_E2E_REPORT_PATH="$report_dir/gitlab-csv-permissions-http-report.json" \
264265
bun --no-env-file scripts/test-gitlab-csv-permissions-e2e.ts
265266
ORGANIZATION_SEARCH_E2E_BASE_URL="$local_app_url" \

‎.github/workflows/docs-negotiation.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ jobs:
295295
run: bun run --cwd apps/docs test:headers:e2e
296296
- name: Verify GitLab CSV export over HTTPS
297297
run: python3 apps/docs/scripts/test-gitlab-export-e2e.py
298+
- name: Verify permission imports over HTTPS
299+
env:
300+
PERMISSION_UPLOAD_REPORT_PATH: apps/docs/test-results/permission-upload-e2e.json
301+
run: python3 apps/docs/scripts/test-permission-upload-e2e.py
298302
- name: Bound the generated content cache
299303
if: always()
300304
run: bash .github/actions/docs-content-cache/prune.sh content

‎apps/docs/content/docs/cli/organizations.mdx‎

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,102 @@ sim organizations search sources permissions get <sourceId> [options]
261261

262262
API request and response schemas: [getSearchSourcePermissions](/api-reference/organizations/getSearchSourcePermissions).
263263

264+
### Create source permission import
265+
266+
```bash
267+
sim organizations search sources permissions imports create <sourceId> [options]
268+
```
269+
270+
**Arguments**
271+
272+
<CommandTable>
273+
274+
| Argument | Required | Description |
275+
| --- | --- | --- |
276+
| `sourceId` | Yes | Search source identifier. |
277+
278+
</CommandTable>
279+
280+
**Options**
281+
282+
<CommandTable>
283+
284+
| Option | Required | Description |
285+
| --- | --- | --- |
286+
| `--organization <value>` | Yes | Organization identifier. |
287+
| `--provider <value>` | Yes | Provider of the configured source. |
288+
| `--expected-revision <value>` | Yes | Permission revision pinned before exporting the CSVs. |
289+
| `--user-mapping <json\|@file>` | Yes | Complete user identity mapping. (JSON, or @path / @- to read a file or stdin). |
290+
| `--project-permissions <json\|@file>` | Yes | Complete project membership snapshot. (JSON, or @path / @- to read a file or stdin). |
291+
292+
</CommandTable>
293+
294+
API request and response schemas: [createSourcePermissionImport](/api-reference/organizations/createSourcePermissionImport).
295+
296+
### Complete source permission import
297+
298+
This replaces the source’s permission grants. Readers omitted from the new grants lose access.
299+
300+
```bash
301+
sim organizations search sources permissions imports complete <sourceId> <importId> [options]
302+
```
303+
304+
**Arguments**
305+
306+
<CommandTable>
307+
308+
| Argument | Required | Description |
309+
| --- | --- | --- |
310+
| `sourceId` | Yes | Search source identifier. |
311+
| `importId` | Yes | Permission import identifier. |
312+
313+
</CommandTable>
314+
315+
**Options**
316+
317+
<CommandTable>
318+
319+
| Option | Required | Description |
320+
| --- | --- | --- |
321+
| `--organization <value>` | Yes | Organization identifier. |
322+
| `-y, --yes` | Yes | Confirm this operation. |
323+
324+
</CommandTable>
325+
326+
API request and response schemas: [completeSourcePermissionImport](/api-reference/organizations/completeSourcePermissionImport).
327+
328+
### Upload source permission import part
329+
330+
```bash
331+
sim organizations search sources permissions imports put-part <sourceId> <importId> <partNumber> [options]
332+
```
333+
334+
**Arguments**
335+
336+
<CommandTable>
337+
338+
| Argument | Required | Description |
339+
| --- | --- | --- |
340+
| `sourceId` | Yes | Search source identifier. |
341+
| `importId` | Yes | Permission import identifier. |
342+
| `partNumber` | Yes | Zero-based part number across both files; user mapping comes first. |
343+
344+
</CommandTable>
345+
346+
**Options**
347+
348+
<CommandTable>
349+
350+
| Option | Required | Description |
351+
| --- | --- | --- |
352+
| `--organization <value>` | Yes | Organization identifier. |
353+
| `--field <value>` | Yes | CSV file this part belongs to. Accepted values: `userMapping`, `projectPermissions`. |
354+
| `--content <value>` | Yes | Complete CSV records, at most 5,000 rows and 1 MiB of UTF-8; an optional header may appear in each part. |
355+
356+
</CommandTable>
357+
358+
API request and response schemas: [putSourcePermissionImportPart](/api-reference/organizations/putSourcePermissionImportPart).
359+
264360
### Replace search source permissions
265361

266362
OAuth login or personal API key required.

‎apps/docs/content/docs/cli/reference.mdx‎

Lines changed: 167 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3978,6 +3978,173 @@ sim organizations access-requests resolve <requestId> [options]
39783978

39793979
API request and response schemas: [resolveOrganizationAccessRequest](/api-reference/access-requests/resolveOrganizationAccessRequest).
39803980

3981+
### sim organizations search sources permissions imports complete
3982+
3983+
Complete source permission import
3984+
3985+
This replaces the source’s permission grants. Readers omitted from the new grants lose access.
3986+
3987+
```bash
3988+
sim organizations search sources permissions imports complete <sourceId> <importId> [options]
3989+
```
3990+
3991+
**Arguments**
3992+
3993+
<CommandTable>
3994+
3995+
| Argument | Required | Description |
3996+
| --- | --- | --- |
3997+
| `sourceId` | Yes | Search source identifier. |
3998+
| `importId` | Yes | Permission import identifier. |
3999+
4000+
</CommandTable>
4001+
4002+
**Options**
4003+
4004+
<CommandTable>
4005+
4006+
| Option | Required | Description |
4007+
| --- | --- | --- |
4008+
| `--organization <value>` | Yes | Organization identifier. |
4009+
| `-y, --yes` | Yes | Confirm this operation. |
4010+
4011+
</CommandTable>
4012+
4013+
API request and response schemas: [completeSourcePermissionImport](/api-reference/organizations/completeSourcePermissionImport).
4014+
4015+
### sim organizations search sources permissions imports create
4016+
4017+
Create source permission import
4018+
4019+
```bash
4020+
sim organizations search sources permissions imports create <sourceId> [options]
4021+
```
4022+
4023+
**Arguments**
4024+
4025+
<CommandTable>
4026+
4027+
| Argument | Required | Description |
4028+
| --- | --- | --- |
4029+
| `sourceId` | Yes | Search source identifier. |
4030+
4031+
</CommandTable>
4032+
4033+
**Options**
4034+
4035+
<CommandTable>
4036+
4037+
| Option | Required | Description |
4038+
| --- | --- | --- |
4039+
| `--organization <value>` | Yes | Organization identifier. |
4040+
| `--provider <value>` | Yes | Provider of the configured source. |
4041+
| `--expected-revision <value>` | Yes | Permission revision pinned before exporting the CSVs. |
4042+
| `--user-mapping <json\|@file>` | Yes | Complete user identity mapping. (JSON, or @path / @- to read a file or stdin). |
4043+
| `--project-permissions <json\|@file>` | Yes | Complete project membership snapshot. (JSON, or @path / @- to read a file or stdin). |
4044+
4045+
</CommandTable>
4046+
4047+
API request and response schemas: [createSourcePermissionImport](/api-reference/organizations/createSourcePermissionImport).
4048+
4049+
### sim organizations search sources permissions imports put-part
4050+
4051+
Upload source permission import part
4052+
4053+
```bash
4054+
sim organizations search sources permissions imports put-part <sourceId> <importId> <partNumber> [options]
4055+
```
4056+
4057+
**Arguments**
4058+
4059+
<CommandTable>
4060+
4061+
| Argument | Required | Description |
4062+
| --- | --- | --- |
4063+
| `sourceId` | Yes | Search source identifier. |
4064+
| `importId` | Yes | Permission import identifier. |
4065+
| `partNumber` | Yes | Zero-based part number across both files; user mapping comes first. |
4066+
4067+
</CommandTable>
4068+
4069+
**Options**
4070+
4071+
<CommandTable>
4072+
4073+
| Option | Required | Description |
4074+
| --- | --- | --- |
4075+
| `--organization <value>` | Yes | Organization identifier. |
4076+
| `--field <value>` | Yes | CSV file this part belongs to. Accepted values: `userMapping`, `projectPermissions`. |
4077+
| `--content <value>` | Yes | Complete CSV records, at most 5,000 rows and 1 MiB of UTF-8; an optional header may appear in each part. |
4078+
4079+
</CommandTable>
4080+
4081+
API request and response schemas: [putSourcePermissionImportPart](/api-reference/organizations/putSourcePermissionImportPart).
4082+
4083+
### sim organizations search sources permissions get
4084+
4085+
Get search source permission revision (OAuth login or personal API key required)
4086+
4087+
```bash
4088+
sim organizations search sources permissions get <sourceId> [options]
4089+
```
4090+
4091+
**Arguments**
4092+
4093+
<CommandTable>
4094+
4095+
| Argument | Required | Description |
4096+
| --- | --- | --- |
4097+
| `sourceId` | Yes | Identifier of the configured Search source. |
4098+
4099+
</CommandTable>
4100+
4101+
**Options**
4102+
4103+
<CommandTable>
4104+
4105+
| Option | Required | Description |
4106+
| --- | --- | --- |
4107+
| `--organization <value>` | Yes | Organization identifier. |
4108+
4109+
</CommandTable>
4110+
4111+
API request and response schemas: [getSearchSourcePermissions](/api-reference/organizations/getSearchSourcePermissions).
4112+
4113+
### sim organizations search sources permissions replace
4114+
4115+
Replace search source permissions (OAuth login or personal API key required)
4116+
4117+
This replaces the source’s permission grants. Readers omitted from the new grants lose access.
4118+
4119+
```bash
4120+
sim organizations search sources permissions replace <sourceId> [options]
4121+
```
4122+
4123+
**Arguments**
4124+
4125+
<CommandTable>
4126+
4127+
| Argument | Required | Description |
4128+
| --- | --- | --- |
4129+
| `sourceId` | Yes | Identifier of the configured Search source. |
4130+
4131+
</CommandTable>
4132+
4133+
**Options**
4134+
4135+
<CommandTable>
4136+
4137+
| Option | Required | Description |
4138+
| --- | --- | --- |
4139+
| `--organization <value>` | Yes | Organization identifier. |
4140+
| `--expected-revision <value>` | Yes | Permission revision read before exporting the grants. |
4141+
| `--permissions <json\|@file>` | Yes | Complete permission grants in the source provider’s format. (JSON, or @path / @- to read a file or stdin). |
4142+
| `-y, --yes` | Yes | Confirm this operation. |
4143+
4144+
</CommandTable>
4145+
4146+
API request and response schemas: [replaceSearchSourcePermissions](/api-reference/organizations/replaceSearchSourcePermissions).
4147+
39814148
### sim organizations invitations create
39824149

39834150
Create organization invitation (OAuth login or personal API key required)
@@ -4609,71 +4776,6 @@ sim organizations usage events [options]
46094776

46104777
API request and response schemas: [listOrganizationUsageEvents](/api-reference/organizations/listOrganizationUsageEvents).
46114778

4612-
### sim organizations search sources permissions get
4613-
4614-
Get search source permission revision (OAuth login or personal API key required)
4615-
4616-
```bash
4617-
sim organizations search sources permissions get <sourceId> [options]
4618-
```
4619-
4620-
**Arguments**
4621-
4622-
<CommandTable>
4623-
4624-
| Argument | Required | Description |
4625-
| --- | --- | --- |
4626-
| `sourceId` | Yes | Identifier of the configured Search source. |
4627-
4628-
</CommandTable>
4629-
4630-
**Options**
4631-
4632-
<CommandTable>
4633-
4634-
| Option | Required | Description |
4635-
| --- | --- | --- |
4636-
| `--organization <value>` | Yes | Organization identifier. |
4637-
4638-
</CommandTable>
4639-
4640-
API request and response schemas: [getSearchSourcePermissions](/api-reference/organizations/getSearchSourcePermissions).
4641-
4642-
### sim organizations search sources permissions replace
4643-
4644-
Replace search source permissions (OAuth login or personal API key required)
4645-
4646-
This replaces the source’s permission grants. Readers omitted from the new grants lose access.
4647-
4648-
```bash
4649-
sim organizations search sources permissions replace <sourceId> [options]
4650-
```
4651-
4652-
**Arguments**
4653-
4654-
<CommandTable>
4655-
4656-
| Argument | Required | Description |
4657-
| --- | --- | --- |
4658-
| `sourceId` | Yes | Identifier of the configured Search source. |
4659-
4660-
</CommandTable>
4661-
4662-
**Options**
4663-
4664-
<CommandTable>
4665-
4666-
| Option | Required | Description |
4667-
| --- | --- | --- |
4668-
| `--organization <value>` | Yes | Organization identifier. |
4669-
| `--expected-revision <value>` | Yes | Permission revision read before exporting the grants. |
4670-
| `--permissions <json\|@file>` | Yes | Complete permission grants in the source provider’s format. (JSON, or @path / @- to read a file or stdin). |
4671-
| `-y, --yes` | Yes | Confirm this operation. |
4672-
4673-
</CommandTable>
4674-
4675-
API request and response schemas: [replaceSearchSourcePermissions](/api-reference/organizations/replaceSearchSourcePermissions).
4676-
46774779
### sim organizations list
46784780

46794781
List organizations (OAuth login or personal API key required)

0 commit comments

Comments
 (0)