Skip to content

feat: orgs#229

Merged
echarles merged 49 commits into
mainfrom
feat/orgs
Jun 7, 2026
Merged

feat: orgs#229
echarles merged 49 commits into
mainfrom
feat/orgs

Conversation

@echarles

@echarles echarles commented Jun 7, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 7, 2026 08:02
@netlify

netlify Bot commented Jun 7, 2026

Copy link
Copy Markdown

Deploy Preview for datalayer-core failed.

Name Link
🔨 Latest commit cccbab6
🔍 Latest deploy log https://app.netlify.com/projects/datalayer-core/deploys/6a2525b569c6ab0008d8273d

@echarles echarles merged commit ff4e11d into main Jun 7, 2026
7 of 19 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces organization/team-aware “principal” scoping across the UI and client/CLI, along with a broad terminology/API shift from “runtime snapshots” to “code sandbox snapshots”. It also expands the Python CLI/client with new capabilities (Ray, evals, pools, memberships) and updates documentation links.

Changes:

  • Add principal + billable-account selection state (Zustand stores + selector hooks) and thread principal scoping into datasource views and mutations.
  • Rename snapshot domain types/APIs throughout TS + Python from RuntimeSnapshot* to CodeSandboxSnapshot*, updating UI components and API routes accordingly.
  • Extend Python client/CLI with Ray + evals mixins and new CLI commands; refresh docs URLs and minor UI/UX improvements (runtime picker/reservation, dialog accept hook).

Reviewed changes

Copilot reviewed 123 out of 123 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/views/profile/UserBadge.tsx Add callback hook when viewing expired token claims.
src/views/otel/OtelHeader.tsx Add option to hide account controls (badge/sign-out).
src/views/datasources/Datasources.tsx Add principal-scoped datasource listing.
src/views/datasources/DatasourceNew.tsx Add principal-scoped datasource creation + contextual principal UI slot.
src/views/datasources/DatasourceDetail.tsx Add principal-scoped datasource read/update.
src/utils/Snapshot.ts Rename snapshot name generator for code sandbox terminology.
src/utils/Name.ts Add random timestamp name helper.
src/utils/index.ts Export Handles utilities from the utils barrel.
src/utils/Handles.ts Add handle normalization + friendly display helpers.
src/utils/Format.ts Add formatByteSize helper.
src/stateful/runtimes/snapshots.ts Rename browser snapshot helpers to sandbox naming and endpoints.
src/stateful/runtimes/apis.ts Update snapshot types and runtime manager method naming.
src/stateful/runtimes/actions.ts Validate creditsLimit; rename snapshot endpoints/types and adjust behavior for async snapshot completion.
src/state/substates/RuntimesState.ts Rename snapshot-related store methods/types to code sandbox terminology.
src/state/substates/CoreState.ts Update default docs URL.
src/services/index.ts Minor export ordering cleanup.
src/models/User.ts Map Stripe customer ID field from API payload.
src/models/RuntimeDTO.ts Update snapshot DTO type returned from createSnapshot.
src/models/Profile.ts Rename profile field for Stripe customer ID.
src/models/Page.ts Add selected principal fields; update snapshot type mapping.
src/models/index.ts Export CodeSandboxSnapshot models instead of RuntimeSnapshot.
src/models/IAM.ts Add shareable principals response types.
src/models/CodeSandboxSnapshotDTO.ts Rename DTO/types for code sandbox snapshots.
src/models/CodeSandboxSnapshot.ts Rename snapshot model interfaces and mapper.
src/models/tests/Snapshot.test.ts Update unit tests for CodeSandboxSnapshot DTO types.
src/models/tests/RuntimeSnapshot.test.ts Update unit tests for CodeSandboxSnapshot DTO types.
src/index.ts Update public exports for code sandbox snapshots and renamed snapshot helpers.
src/hooks/useUsageRefreshStore.ts Add usage refresh request store.
src/hooks/useSelectedPrincipal.ts Add selector hook for current UI-scoped principal.
src/hooks/useSelectedBillableAccount.ts Add selector hook for billable account derived from principal.
src/hooks/usePrincipalStore.ts Add persisted principal selection store.
src/hooks/useBillableAccountStore.ts Add persisted billable account selection store.
src/hooks/index.ts Export new principal/billing/refresh hooks.
src/examples/README.md Update documentation URL.
src/components/storage/ContentsBrowser.tsx Replace refresh icon with Octicons SyncIcon.
src/components/snapshots/SandboxSnapshotMenu.tsx Rename snapshot menu UI/logic to sandbox snapshots and update copy/icons.
src/components/snapshots/index.ts Re-export sandbox snapshot menu from snapshots barrel.
src/components/sharing/SharingEditor.tsx Add JSON-based sharing payload editor scaffold with validation.
src/components/sharing/index.ts Add sharing barrel exports (incl. principal components).
src/components/runtimes/RuntimeReservationControl.tsx Clamp time reservation input and normalize onChange behavior.
src/components/runtimes/RuntimePickerNotebook.tsx Improve time/credits/run allowance handling and burning-rate resolution.
src/components/runtimes/RuntimePickerCell.tsx Defer runtime start and adjust submit label for assignment flow.
src/components/runtimes/RuntimePickerBase.tsx Fix runtime selection comparison logic and naming clarity.
src/components/runtimes/RuntimeLauncherDialog.tsx Add deferred-start mode, submitLabel, and refine credits/run allowance logic.
src/components/principal/PrincipalDetailsOverlay.tsx Add principal details overlay and profile path builder.
src/components/principal/PrincipalBanner.tsx Add banner to indicate currently selected principal.
src/components/principal/PrincipalBadge.tsx Add principal badge component with hydration via cache hooks.
src/components/principal/PrincipalAvatar.tsx Add principal avatar renderer with fallbacks.
src/components/principal/Principal.tsx Add unified principal renderer (avatar + details overlay).
src/components/principal/index.ts Add principal components barrel exports.
src/components/index.ts Export new billing and sharing component groups.
src/components/display/JupyterDialog.tsx Add async onWillAccept hook + pending state handling/spinner.
src/components/billing/index.ts Export billing components barrel.
src/client/mixins/RuntimesMixin.ts Update client snapshot DTO types and snapshot API naming.
src/client/index.ts Update snapshot DTO/type exports to CodeSandboxSnapshot naming.
src/client/tests/client.runtimes.integration.test.ts Update integration tests for CodeSandboxSnapshot DTO.
src/client/tests/client.models.integration.test.ts Update integration tests + logs for code sandbox snapshot naming.
src/api/runtimes/snapshots.ts Update API routes/payload types to sandbox snapshots.
src/api/runtimes/checkpoints.ts Update docs text to refer to code sandbox snapshots.
src/api/iam/profile.ts Add IAM endpoint wrapper for shareable principals.
src/api/DatalayerApi.ts Improve redirect URL normalization and https enforcement.
src/api/tests/runtimes.integration.test.ts Update integration test descriptions for sandbox snapshots.
README.md Update documentation links to new domain/path.
pyproject.toml Unpin keyring dependency.
package.json Bump package version and remove fuse.js dependency.
examples/streamlit/README.md Update documentation link.
examples/README.md Add evals workflow example + update documentation link.
examples/pytorch/README.md Update documentation link.
examples/nextjs/src/components/Footer.tsx Update docs link in Next.js example footer.
examples/nextjs/README.md Update documentation link.
examples/fastapi/README.md Update documentation link.
examples/decorator/README.md Update terminology to “code sandbox snapshots” + docs link.
docs/docusaurus.config.js Update docs navbar link URL.
datalayer_core/utils/urls.py Add Ray URL to URL resolution/config model.
datalayer_core/tests/test_usage.py Add usage history integration tests across billable scopes.
datalayer_core/tests/test_ray.py Add Ray URL + Ray mixin path tests.
datalayer_core/tests/test_client.py Update snapshot model references + rename snapshot test.
datalayer_core/tests/test_cli.py Add CLI help coverage for evals command.
datalayer_core/tests/test_cli_main.py Add tests for global option normalization in CLI main.
datalayer_core/runtimes/sandbox_snapshot.py Rename snapshot parsing to sandbox snapshot model.
datalayer_core/runtimes/runtime.py Swap runtime snapshot mixin/model for sandbox snapshot equivalents.
datalayer_core/runtimes/agent_runtime.py Add reusable cloud agent runtime provisioning helpers.
datalayer_core/models/sandbox_snapshot.py Rename runtime snapshot model to sandbox snapshot model.
datalayer_core/models/iam.py Add shareable principals Pydantic models.
datalayer_core/models/init.py Update exported model names for sandbox snapshot.
datalayer_core/mixins/usage.py Update subscription endpoints to plans endpoints.
datalayer_core/mixins/sandbox_snapshots.py Rename runtime snapshot mixins to sandbox snapshot mixins + endpoints.
datalayer_core/mixins/runtimes.py Add agent spec + billing fields; add get/update runtime mixins.
datalayer_core/mixins/ray.py Add Ray management mixin (clusters/jobs).
datalayer_core/mixins/evals.py Add evals management mixin (evalsets/experiments/runs/live).
datalayer_core/mixins/init.py Export sandbox snapshot mixin instead of runtime snapshot mixin.
datalayer_core/displays/sandbox_snapshots.py Rename runtime snapshot display helpers to sandbox snapshot equivalents.
datalayer_core/displays/agent_nodes.py Add Rich display helper for agent nodes.
datalayer_core/decorators/datalayer.py Update docs string to “code sandbox snapshot”.
datalayer_core/client/client.py Add Ray/Evals mixins; add runtime get/update; rename snapshot models/types.
datalayer_core/cli/commands/tokens.py Rename list to ls and remove alias command.
datalayer_core/cli/commands/subscription.py Update plan field names/paths and admin reporting fields.
datalayer_core/cli/commands/secrets.py Rename list to ls and remove alias command.
datalayer_core/cli/commands/sandbox_snapshots.py Rename snapshot CLI group and commands to sandbox snapshots + ls.
datalayer_core/cli/commands/runtimes.py Add iam-url support + billable account options + ls command naming.
datalayer_core/cli/commands/runtime_checkpoints.py Rename list to ls and adjust alias semantics.
datalayer_core/cli/commands/pools.py Add runtime pool admin CLI commands.
datalayer_core/cli/commands/memberships.py Add memberships CLI to list org/team memberships.
datalayer_core/cli/commands/envs.py Add iam-url support and rename list to ls.
datalayer_core/cli/commands/authn.py Add JWT claim inspection + memberships display in whoami.
datalayer_core/cli/commands/agent_nodes.py Add agent-nodes CLI command.
datalayer_core/cli/commands/about.py Print an ANSI footer after about markdown.
datalayer_core/cli/main.py Add many global URL overrides, new commands, and argv normalization.
datalayer_core/base/serverapplication.py Update default docs URL.
datalayer_core/assets/about.md Refresh about copy and documentation link.
datalayer_core/version.py Bump Python package version.
Comments suppressed due to low confidence (1)

src/models/CodeSandboxSnapshotDTO.ts:18

  • Typo in the public snapshot model docstring: "runthime" → "runtime" (and this is now a code sandbox snapshot).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/api/DatalayerApi.ts
Comment on lines +310 to 333
try {
const resolved = new URL(normalizedRedirect, baseUrl);
const base = new URL(baseUrl, typeof window !== 'undefined' ? window.location.origin : undefined);

// If a proxy emits an http Location for the same host while the
// original request is https, force https to avoid mixed-content errors
// that browsers often report as CORS/network failures.
if (
base.protocol === 'https:' &&
resolved.protocol === 'http:' &&
resolved.hostname === base.hostname
) {
resolved.protocol = 'https:';
if (resolved.port === '80') {
resolved.port = '';
}
}

redirect = resolved.toString();
} catch {
const parsedURL = URLExt.parse(baseUrl);
const fallbackBase = parsedURL.protocol + '//' + parsedURL.hostname;
redirect = URLExt.join(fallbackBase, normalizedRedirect);
}
Comment on lines +197 to 201
if (!data.success) {
throw new Error(
`Failed to take the runtime snapshot ${options.id} - ${data}`,
`Failed to take the code sandbox snapshot ${options.id} - ${data}`,
);
}
Comment on lines 186 to 188
onClick: () => {
this.handleButton(idx);
},
Comment on lines +104 to +110
kind: 'team',
uid: selectedPrincipalUid,
handle: `${orgHandle}/${teamHandle}`,
accountHandle: teamHandle,
displayName: `@${formatFriendlyHandle(orgHandle)}/${formatFriendlyHandle(teamHandle)}`,
origin: 'Datalayer',
};
Comment thread src/index.ts
Comment on lines 225 to 229
export {
getEnvironments,
createRuntime,
getRuntimes,
deleteRuntime,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants