[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72T10FWW0B4Q0V55AXA9S8S":3,"skill-same:01M72T10FWW0B4Q0V55AXA9S8S":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M72T10FWW0B4Q0V55AXA9S8S","connector-testing",null,"Test a generated connector through full-mock, integration\u002Fcache, and live end-to-end phases using the public utilities under glean.indexing.testing.","gleanwork\u002Fglean-indexing-sdk","gleanwork","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F100331376?v=4","01M72SZSP4ZSMMBB7EMJGZQ2FJ","Glean Technologies Inc","01M72SZSPTYKMJHZFSB7ZEXY0H",10,"MIT","https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fconnector-testing\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: connector-testing\ndescription: Test a generated connector through full-mock, integration\u002Fcache, and live end-to-end phases using the public utilities under glean.indexing.testing.\n---\n\n# Connector Testing\n\nUse this skill after implementing or changing a connector. Exercise the connector with the public SDK testing layer under `src\u002Fglean\u002Findexing\u002Ftesting\u002F`; do not test the SDK testing layer itself.\n\n## Rules\n\n- Never run files under the repository's `tests\u002F` directory while using this skill. Those tests validate the SDK implementation and belong to SDK-maintainer CI, not the connector-building workflow.\n- Use only public utilities exported by `glean.indexing.testing`, including `TestHarness`, `TestConfig`, static data clients, `MockGleanClient`, and `run_connector`.\n- Before validation, ask for confirmation once for the whole testing step and state which phases will run. Do not ask again for each phase in the same batch.\n- Before the live end-to-end phase specifically, state the resolved `GLEAN_SERVER_URL` \u002F `GLEAN_INSTANCE` target and confirm with the user before proceeding. Live uploads can finalize replacement state and stale-delete documents omitted by a bounded crawl, so use only a disposable datasource. Only call `run_end_to_end(confirm=True, allow_destructive=True)` \u002F `run_end_to_end_async(confirm=True, allow_destructive=True)` after both conditions are satisfied.\n- Use the existing task context, including the connector-local `.env` file if identified, to determine whether source and Glean credentials are present.\n- If connector code changes after a run, ask whether to run the connector validation again.\n- Never print secrets, commit `.env`, or include recorded source data.\n- Ensure test data includes at least one representative document for every type the connector can emit across mock, integration, and live end-to-end validation when available.\n\n## Public Testing Layer\n\nUse these SDK files and their public exports:\n\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fharness\u002Fharness.py`: `TestHarness`\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fharness\u002Fconfig.py`: `TestConfig`, `ClientConfig`\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fdata_clients.py`: static sync, streaming, and async clients\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fmock_client.py`: `MockGleanClient`\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Frunner.py`: `run_connector`, `run_connector_async`\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fharness\u002Fcache\u002F`: source recording and replay\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fharness\u002Fpermissions.py`: permission-payload assertions\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fvalidation.py`: deterministic connector-output validation\n- `src\u002Fglean\u002Findexing\u002Fpush\u002Fstatus.py`: shared one-shot and polling status checks\n\n## Connector Validation Phases\n\nEach phase is available from the CLI as well as from Python. Use the CLI when you\njust need the phase run and reported; use the harness directly when you need to\nassert on the returned client.\n\n```bash\nglean-idx test --phase mock          # or integration, live\nglean-idx test --phase all           # every phase in order\n```\n\n`--phase all` stops at the first failure and skips any phase that cannot run,\nreporting which. `--max-items N` caps what each data client yields.\n\n### 1. Full mock\n\nUse static test data representative of every connector output type. Run:\n\n```bash\nglean-idx test --phase mock\n```\n\nor, to assert on the result:\n\n```python\nharness.run_full_mock()\n```\n\nThis phase must not call the source or Glean. Inspect the returned `MockGleanClient` for emitted documents, users, groups, memberships, and employees. Deterministic output validation runs automatically.\n\n### 2. Integration\u002Fcache\n\nRegister the connector's real source clients in `TestHarness.clients`, keep Glean mocked, and run:\n\n```bash\nglean-idx test --phase integration   # add --refresh-cache to re-record\n```\n\nor, to assert on the result:\n\n```python\nharness.run_integration_test()\n```\n\nThe CLI discovers the connector's data clients by type, so `TestHarness.clients`\ndoes not have to be spelled out when running it that way.\n\nThis phase fetches a bounded source sample on a cache miss and records it locally; later runs replay the cache. Verify source parsing, transformation, document counts, and permission payloads without calling Glean.\n\nUse `run_integration_test_async()` for async streaming connectors.\n\n### 3. Live end-to-end\n\n> **Production safety:** this phase uploads real documents to whichever Glean\n> instance `GLEAN_SERVER_URL` (or `GLEAN_INSTANCE`) resolves to, and there is\n> **no automated cleanup**. Before running it, state the resolved target and\n> confirm with the user before proceeding. See **Cleaning up after a live\n> run** below for how to remove what it uploads.\n\nThe built-in live phase is document-only. It rejects people connectors and datasource connectors that override `get_identities()`, because the document cleanup command cannot restore replaced employee, user, group, or membership data. Validate those outputs with mock\u002Fintegration tests or a purpose-built live smoke test with explicit identity cleanup.\n\nRun only when source credentials and `GLEAN_INDEXING_API_TOKEN` plus `GLEAN_SERVER_URL` or `GLEAN_INSTANCE` are available:\n\n```bash\nglean-idx test --phase live --allow-destructive-live\n```\n\nThis prompts for confirmation (showing the resolved target) unless `--yes` is passed. `--yes` only skips the prompt; it does not replace the required `--allow-destructive-live` acknowledgement. The CLI carries the confirmed target into the harness, which refuses to upload if the configured target changes before live execution.\n\nor, to assert on the result:\n\n```python\nharness.run_end_to_end(confirm=True, allow_destructive=True)\n```\n\n`confirm=True` confirms the target. The separate `allow_destructive=True` acknowledges replacement finalization and possible stale deletion; without it the harness raises `UnsafeLiveEndToEndRunError`. Use `run_end_to_end_async()` for async streaming connectors. This phase uses the current bounded source client and real Glean APIs; it never reads or writes integration fixtures.\n\nAfter upload, the harness waits for normal indexing, requests `processalldocuments` once when needed, ignores a rate-limit response from that request, and polls status for a bounded period. If the result is `PENDING`, tell the user:\n\n> Source data was pulled successfully, and Glean accepted the document upload without validation errors. The documents are queued for asynchronous indexing, which may take longer.\n\nThen determine the next step from the confirmed connector plan and ask whether they want to proceed. Do not treat pending asynchronous indexing as connector failure or generate connector-specific processing code.\n\nIf live credentials are unavailable, explicitly report that the live phase was skipped. Full-mock and integration results do not prove that Glean accepted or indexed the documents.\n\n## Document Indexing Status\n\nFor checking document status during testing, use `glean-idx document status --datasource \u003Cdatasource> --document \u003Cobject-type> \u003Cdocument-id> --poll`; omit `--poll` for an ad-hoc single check. Repeat `--document \u003Cobject-type> \u003Cdocument-id>` to check multiple documents.\n\nWhen a document uploaded but never became searchable, `glean-idx document events --datasource \u003Cdatasource> --object-type \u003Ctype> --id \u003Cid>` shows its lifecycle, and `glean-idx datasource status --datasource \u003Cdatasource>` compares uploaded against indexed counts.\n\n## Cleaning up after a live run\n\nA live end-to-end run has no automated cleanup. On success, the harness logs a `glean-idx document delete --datasource \u003Cname> --document \u003Cobject-type> \u003Cid> ...` command naming every document it just uploaded -- run that command (or `PushUploader.delete_document(...)` from Python) to remove them. Do this whenever the live phase ran against anything other than a disposable test datasource.\n\n## Run Report\n\nAfter the selected phases finish, report:\n\n- phases run and skipped\n- source records fetched or replayed\n- documents and identities emitted\n- object types represented\n- deterministic validation results\n- live upload and indexing result, when E2E ran\n- any remaining production-readiness gaps\n","# Connector Testing\n\nUse this skill after implementing or changing a connector. Exercise the connector with the public SDK testing layer under `src\u002Fglean\u002Findexing\u002Ftesting\u002F`; do not test the SDK testing layer itself.\n\n## Rules\n\n- Never run files under the repository's `tests\u002F` directory while using this skill. Those tests validate the SDK implementation and belong to SDK-maintainer CI, not the connector-building workflow.\n- Use only public utilities exported by `glean.indexing.testing`, including `TestHarness`, `TestConfig`, static data clients, `MockGleanClient`, and `run_connector`.\n- Before validation, ask for confirmation once for the whole testing step and state which phases will run. Do not ask again for each phase in the same batch.\n- Before the live end-to-end phase specifically, state the resolved `GLEAN_SERVER_URL` \u002F `GLEAN_INSTANCE` target and confirm with the user before proceeding. Live uploads can finalize replacement state and stale-delete documents omitted by a bounded crawl, so use only a disposable datasource. Only call `run_end_to_end(confirm=True, allow_destructive=True)` \u002F `run_end_to_end_async(confirm=True, allow_destructive=True)` after both conditions are satisfied.\n- Use the existing task context, including the connector-local `.env` file if identified, to determine whether source and Glean credentials are present.\n- If connector code changes after a run, ask whether to run the connector validation again.\n- Never print secrets, commit `.env`, or include recorded source data.\n- Ensure test data includes at least one representative document for every type the connector can emit across mock, integration, and live end-to-end validation when available.\n\n## Public Testing Layer\n\nUse these SDK files and their public exports:\n\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fharness\u002Fharness.py`: `TestHarness`\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fharness\u002Fconfig.py`: `TestConfig`, `ClientConfig`\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fdata_clients.py`: static sync, streaming, and async clients\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fmock_client.py`: `MockGleanClient`\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Frunner.py`: `run_connector`, `run_connector_async`\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fharness\u002Fcache\u002F`: source recording and replay\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fharness\u002Fpermissions.py`: permission-payload assertions\n- `src\u002Fglean\u002Findexing\u002Ftesting\u002Fvalidation.py`: deterministic connector-output validation\n- `src\u002Fglean\u002Findexing\u002Fpush\u002Fstatus.py`: shared one-shot and polling status checks\n\n## Connector Validation Phases\n\nEach phase is available from the CLI as well as from Python. Use the CLI when you\njust need the phase run and reported; use the harness directly when you need to\nassert on the returned client.\n\n```bash\nglean-idx test --phase mock          # or integration, live\nglean-idx test --phase all           # every phase in order\n```\n\n`--phase all` stops at the first failure and skips any phase that cannot run,\nreporting which. `--max-items N` caps what each data client yields.\n\n### 1. Full mock\n\nUse static test data representative of every connector output type. Run:\n\n```bash\nglean-idx test --phase mock\n```\n\nor, to assert on the result:\n\n```python\nharness.run_full_mock()\n```\n\nThis phase must not call the source or Glean. Inspect the returned `MockGleanClient` for emitted documents, users, groups, memberships, and employees. Deterministic output validation runs automatically.\n\n### 2. Integration\u002Fcache\n\nRegister the connector's real source clients in `TestHarness.clients`, keep Glean mocked, and run:\n\n```bash\nglean-idx test --phase integration   # add --refresh-cache to re-record\n```\n\nor, to assert on the result:\n\n```python\nharness.run_integration_test()\n```\n\nThe CLI discovers the connector's data clients by type, so `TestHarness.clients`\ndoes not have to be spelled out when running it that way.\n\nThis phase fetches a bounded source sample on a cache miss and records it locally; later runs replay the cache. Verify source parsing, transformation, document counts, and permission payloads without calling Glean.\n\nUse `run_integration_test_async()` for async streaming connectors.\n\n### 3. Live end-to-end\n\n> **Production safety:** this phase uploads real documents to whichever Glean\n> instance `GLEAN_SERVER_URL` (or `GLEAN_INSTANCE`) resolves to, and there is\n> **no automated cleanup**. Before running it, state the resolved target and\n> confirm with the user before proceeding. See **Cleaning up after a live\n> run** below for how to remove what it uploads.\n\nThe built-in live phase is document-only. It rejects people connectors and datasource connectors that override `get_identities()`, because the document cleanup command cannot restore replaced employee, user, group, or membership data. Validate those outputs with mock\u002Fintegration tests or a purpose-built live smoke test with explicit identity cleanup.\n\nRun only when source credentials and `GLEAN_INDEXING_API_TOKEN` plus `GLEAN_SERVER_URL` or `GLEAN_INSTANCE` are available:\n\n```bash\nglean-idx test --phase live --allow-destructive-live\n```\n\nThis prompts for confirmation (showing the resolved target) unless `--yes` is passed. `--yes` only skips the prompt; it does not replace the required `--allow-destructive-live` acknowledgement. The CLI carries the confirmed target into the harness, which refuses to upload if the configured target changes before live execution.\n\nor, to assert on the result:\n\n```python\nharness.run_end_to_end(confirm=True, allow_destructive=True)\n```\n\n`confirm=True` confirms the target. The separate `allow_destructive=True` acknowledges replacement finalization and possible stale deletion; without it the harness raises `UnsafeLiveEndToEndRunError`. Use `run_end_to_end_async()` for async streaming connectors. This phase uses the current bounded source client and real Glean APIs; it never reads or writes integration fixtures.\n\nAfter upload, the harness waits for normal indexing, requests `processalldocuments` once when needed, ignores a rate-limit response from that request, and polls status for a bounded period. If the result is `PENDING`, tell the user:\n\n> Source data was pulled successfully, and Glean accepted the document upload without validation errors. The documents are queued for asynchronous indexing, which may take longer.\n\nThen determine the next step from the confirmed connector plan and ask whether they want to proceed. Do not treat pending asynchronous indexing as connector failure or generate connector-specific processing code.\n\nIf live credentials are unavailable, explicitly report that the live phase was skipped. Full-mock and integration results do not prove that Glean accepted or indexed the documents.\n\n## Document Indexing Status\n\nFor checking document status during testing, use `glean-idx document status --datasource \u003Cdatasource> --document \u003Cobject-type> \u003Cdocument-id> --poll`; omit `--poll` for an ad-hoc single check. Repeat `--document \u003Cobject-type> \u003Cdocument-id>` to check multiple documents.\n\nWhen a document uploaded but never became searchable, `glean-idx document events --datasource \u003Cdatasource> --object-type \u003Ctype> --id \u003Cid>` shows its lifecycle, and `glean-idx datasource status --datasource \u003Cdatasource>` compares uploaded against indexed counts.\n\n## Cleaning up after a live run\n\nA live end-to-end run has no automated cleanup. On success, the harness logs a `glean-idx document delete --datasource \u003Cname> --document \u003Cobject-type> \u003Cid> ...` command naming every document it just uploaded -- run that command (or `PushUploader.delete_document(...)` from Python) to remove them. Do this whenever the live phase ran against anything other than a disposable test datasource.\n\n## Run Report\n\nAfter the selected phases finish, report:\n\n- phases run and skipped\n- source records fetched or replayed\n- documents and identities emitted\n- object types represented\n- deterministic validation results\n- live upload and indexing result, when E2E ran\n- any remaining production-readiness gaps\n",{"name":5,"description":7},"main","ee846524264723549ef24dd32ef4324844268f9e","skills\u002Fconnector-testing",2,"https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk","https:\u002F\u002Fgithub.com\u002Fgleanwork","https:\u002F\u002Fwww.glean.com\u002F","The AI-powered work assistant. Across all your company’s data.","2026-10-31 16:38:59",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add gleanwork\u002Fglean-indexing-sdk --skill connector-testing",{"tool":39,"command":40},"bunx","bunx skills add gleanwork\u002Fglean-indexing-sdk --skill connector-testing",{"tool":42,"command":43},"pnpm","pnpm dlx skills add gleanwork\u002Fglean-indexing-sdk --skill connector-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fconnector-testing\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M72T0XKXAG5WGQHPVNB968DS","connector-push","Implement Glean-side push\u002Fupload logic for Glean Indexing SDK connectors. Use when mapping source entities to Glean documents, identities, groups, memberships, and status checks.","https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fconnector-push\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M72T0ETD7GXZ7TTZ3MFYHBGS","connector-pull","Implement source-side pull logic for Glean Indexing SDK connectors. Use after API exploration when writing data clients that fetch from third-party APIs.","https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fconnector-pull\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M72T0C64RTR08AZ15JVYF30V","connector-observability","Plan and implement logging, metrics, and evaluation visibility for Glean Indexing SDK connectors. Use when wiring connector runtime observability or deciding what to verify after a connector run.","https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fconnector-observability\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M72T09KTGEXN4BRQ4SK8D8XF","connector-deployment","Plan and operate customer-hosted deployment for Glean Indexing SDK connectors using glean-idx deploy. Use when the user wants deployment artifacts, cloud secrets, Kubernetes CronJobs, logs, status, or teardown for a generated connector.","https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fconnector-deployment\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M72T071ZHBP6C83HW7S8D51D","connector-builder","Build Glean Indexing SDK connectors from source-system documentation. Use when planning, generating, validating, or evaluating a custom connector built with the Glean Indexing SDK.","https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fconnector-builder\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M72T03JN19YNA6SEMXDMB45C","connector-auth","Plan source API authentication for Glean Indexing SDK connectors. Use during connector planning and implementation to separate API-exploration credentials from production connector auth.","https:\u002F\u002Fgithub.com\u002Fgleanwork\u002Fglean-indexing-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fconnector-auth\u002FSKILL.md",[],[]]