Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ci: probe whether the Cloud CI API key can manage Nexus endpoints
TEMPORARY, not for merge. Creates and deletes one Nexus endpoint through the
Cloud Ops API in the Cloud job, logging whether the CI API key is permitted to.
Nexus suites can only run against Cloud if endpoints can be created this way,
since Cloud rejects the OperatorService.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
  • Loading branch information
THardy98 and claude committed Oct 12, 2026
commit 05e16d520531907989fc7e1344fe162d48f81701
40 changes: 39 additions & 1 deletion .github/scripts/cloud-namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,49 @@ async function deleteNamespace(namespace: string): Promise<void> {
});
}

// TEMP(nexus-probe): checks whether the CI API key may manage Nexus endpoints. Not for merge.
async function probeNexusEndpoint(namespace: string): Promise<void> {
await withCloudClient(async (client) => {
const name = `sdk-typescript-ci-probe-${requiredEnv('GITHUB_RUN_ID')}-${requiredEnv('GITHUB_RUN_ATTEMPT')}`;
let created: temporal.api.cloud.cloudservice.v1.CreateNexusEndpointResponse;
try {
created = await client.cloudService.createNexusEndpoint({
asyncOperationId: randomUUID(),
spec: {
name,
targetSpec: { workerTargetSpec: { namespaceId: namespace, taskQueue: 'nexus-probe' } },
policySpecs: [{ allowedCloudNamespacePolicySpec: { namespaceId: namespace } }],
},
});
} catch (error) {
console.log(`NEXUS PROBE: createNexusEndpoint FAILED: ${(error as Error).message}`);
throw error;
}
console.log(`NEXUS PROBE: createNexusEndpoint accepted (endpoint ${created.endpointId})`);
if (!created.asyncOperation) throw new Error('Create endpoint response did not include an operation');
await waitForOperation(client, created.asyncOperation);
console.log('NEXUS PROBE: endpoint creation fulfilled');

const existing = await client.cloudService.getNexusEndpoint({ endpointId: created.endpointId });
const resourceVersion = existing.endpoint?.resourceVersion;
if (!resourceVersion) throw new Error(`Nexus endpoint ${created.endpointId} did not include a resource version`);
const deleted = await client.cloudService.deleteNexusEndpoint({
endpointId: created.endpointId,
resourceVersion,
asyncOperationId: randomUUID(),
});
if (!deleted.asyncOperation) throw new Error('Delete endpoint response did not include an operation');
await waitForOperation(client, deleted.asyncOperation);
console.log('NEXUS PROBE: endpoint deleted');
});
}

async function main(): Promise<void> {
const [command, namespace] = process.argv.slice(2);
if (command === 'create' && namespace === undefined) return await create();
if (command === 'delete' && namespace !== undefined) return await deleteNamespace(namespace);
throw new Error('Usage: cloud-namespace.ts create | delete <namespace>');
if (command === 'nexus-probe' && namespace !== undefined) return await probeNexusEndpoint(namespace);
throw new Error('Usage: cloud-namespace.ts create | delete <namespace> | nexus-probe <namespace>');
}

main().catch((error) => {
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,14 @@ jobs:
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
TEMPORAL_CLIENT_CLOUD_API_VERSION: v0.19.1

# TEMP(nexus-probe): does the CI API key allow managing Nexus endpoints? Not for merge.
- name: Probe Cloud Nexus endpoint permissions
continue-on-error: true
run: pnpm exec tsx .github/scripts/cloud-namespace.ts nexus-probe "${{ steps.create-cloud-namespace.outputs.namespace }}"
env:
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
TEMPORAL_CLIENT_CLOUD_API_VERSION: v0.19.1

- name: Run tests against Temporal Cloud
# Fail a hung suite while leaving job-level time for namespace cleanup and log upload.
timeout-minutes: 20
Expand Down
Loading