Skip to content

Commit 967bf2f

Browse files
Lionel-Wilsonactions-user
authored andcommitted
Eng 3205 phase 3 cursor cloud agent execution with credentials (#4339)
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Introduces new cloud-agent secret/env templates and a workflow for resolving Azure credentials via `inject-secrets`, which could affect how integration tests authenticate and increases the chance of accidental credential leakage if misused. > > **Overview** > Adds Cloud Agent support files to run Azure integration tests by resolving 1Password `op://...` references at runtime: new `.github/env/op.azure-cloud-agent.secret` (Azure SP + subscription IDs) and `.github/env/op.azure-cloud-agent.env` (enables tests). > > Updates Azure integration test docs with Cloud Agent setup, manual `inject-secrets` invocation, and security guidance, and ignores the generated resolved env output (`.env.azure-cloud-agent`) to prevent committing real credentials. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cd999e1ccb7fc7eca180a207ada4a45dc5b4b53d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> GitOrigin-RevId: 07940caa380eefdf5ff95738f50f4867fdf48355
1 parent 80fed94 commit 967bf2f

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

sources/azure/integration-tests/README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,46 @@ For tearing down the infra for the Compute API resources.
8181

8282
```bash
8383
go test ./integration-tests -run "TestCompute.*/Teardown" -v
84-
```
84+
```
85+
86+
## Running Integration Tests via Cloud Agents
87+
88+
Cursor Cloud Agents can run Azure integration tests autonomously when configured with the correct credentials.
89+
90+
### Prerequisites
91+
92+
1. **1Password vault**: Azure credentials are stored in the "cursor" 1Password vault under the item "Azure Integration Tests"
93+
2. **Cursor Cloud Agent secret**: Configure only `OP_SERVICE_ACCOUNT_TOKEN` in `https://cursor.com/dashboard/cloud-agents`
94+
3. **Repo env files**: `op.azure-cloud-agent.secret` and `op.azure-cloud-agent.env` exist with required `op://...` references
95+
96+
### How it works
97+
98+
When a Cloud Agent picks up a Linear issue to create an Azure adapter:
99+
100+
1. Cursor injects `OP_SERVICE_ACCOUNT_TOKEN` into the Cloud Agent environment
101+
2. `inject-secrets` reads `op://...` references from env files using the 1Password SDK
102+
3. `inject-secrets` writes resolved values to a local env file
103+
4. The shell sources that file before test execution
104+
5. The `DefaultAzureCredential` chain picks up `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, and `AZURE_TENANT_ID` from environment
105+
6. Integration tests use `AZURE_SUBSCRIPTION_ID` and `RUN_AZURE_INTEGRATION_TESTS=true`
106+
107+
To inject credentials manually (e.g. for debugging), run:
108+
109+
```bash
110+
go run build/inject-secrets/main.go \
111+
--secret-file .github/env/op.azure-cloud-agent.secret \
112+
--env-file .github/env/op.azure-cloud-agent.env \
113+
--output-file .env.azure-cloud-agent
114+
115+
set -a
116+
source .env.azure-cloud-agent
117+
set +a
118+
```
119+
120+
### Security
121+
122+
- The service principal has **read-write access** scoped to the integration test subscription only
123+
- Cloud Agent dashboard stores only the bootstrap token (`OP_SERVICE_ACCOUNT_TOKEN`)
124+
- Azure credentials remain in 1Password and are resolved only at runtime via `inject-secrets`
125+
- All test resources are created in the `overmind-integration-tests` resource group
126+
- Teardown steps clean up created resources after each test run

0 commit comments

Comments
 (0)