feat: update templates list to namespaced names#227
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0ba58ba3e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Bugbot Autofix prepared fixes for 2 of the 2 bugs found in the latest run.
Or push these changes by commenting: Preview (b62a1789d3)diff --git a/src/configs/mock-data.ts b/src/configs/mock-data.ts
--- a/src/configs/mock-data.ts
+++ b/src/configs/mock-data.ts
@@ -15,6 +15,7 @@
const DEFAULT_TEMPLATES: DefaultTemplate[] = [
{
aliases: ['code-interpreter'],
+ names: ['code-interpreter'],
buildID: 'build_000',
cpuCount: 1,
memoryMB: 1024,
@@ -36,6 +37,7 @@
},
{
aliases: ['web-starter'],
+ names: ['web-starter'],
buildID: 'build_005',
cpuCount: 2,
memoryMB: 2048,
@@ -54,6 +56,7 @@
},
{
aliases: ['data-science'],
+ names: ['data-science'],
buildID: 'build_006',
cpuCount: 4,
memoryMB: 8192,
@@ -78,6 +81,7 @@
const TEMPLATES: Template[] = [
{
aliases: ['node-typescript', 'node-ts'],
+ names: ['node-typescript', 'node-ts'],
buildID: 'build_001',
cpuCount: 2,
memoryMB: 2048,
@@ -97,6 +101,7 @@
},
{
aliases: ['react-vite'],
+ names: ['react-vite'],
buildID: 'build_002',
cpuCount: 1,
memoryMB: 1024,
@@ -113,6 +118,7 @@
},
{
aliases: ['postgres', 'pg'],
+ names: ['postgres', 'pg'],
buildID: 'build_003',
cpuCount: 2,
memoryMB: 4096,
@@ -129,6 +135,7 @@
},
{
aliases: ['redis'],
+ names: ['redis'],
buildID: 'build_004',
cpuCount: 1,
memoryMB: 2048,
@@ -145,6 +152,7 @@
},
{
aliases: ['python-ml', 'ml'],
+ names: ['python-ml', 'ml'],
buildID: 'build_005',
cpuCount: 4,
memoryMB: 8192,
@@ -161,6 +169,7 @@
},
{
aliases: ['elastic', 'es'],
+ names: ['elastic', 'es'],
buildID: 'build_006',
cpuCount: 2,
memoryMB: 4096,
@@ -177,6 +186,7 @@
},
{
aliases: ['grafana'],
+ names: ['grafana'],
buildID: 'build_007',
cpuCount: 1,
memoryMB: 2048,
@@ -193,6 +203,7 @@
},
{
aliases: ['nginx'],
+ names: ['nginx'],
buildID: 'build_008',
cpuCount: 1,
memoryMB: 1024,
@@ -209,6 +220,7 @@
},
{
aliases: ['mongodb', 'mongo'],
+ names: ['mongodb', 'mongo'],
buildID: 'build_009',
cpuCount: 2,
memoryMB: 4096,
@@ -225,6 +237,7 @@
},
{
aliases: ['mysql'],
+ names: ['mysql'],
buildID: 'build_010',
envdVersion: '0.1.0',
cpuCount: 2,
@@ -241,6 +254,7 @@
},
{
aliases: ['nextjs', 'next'],
+ names: ['nextjs', 'next'],
buildID: 'build_011',
envdVersion: '0.1.0',
cpuCount: 2,
@@ -260,6 +274,7 @@
},
{
aliases: ['vue', 'vue3'],
+ names: ['vue', 'vue3'],
buildID: 'build_012',
cpuCount: 1,
envdVersion: '0.1.0',
@@ -276,6 +291,7 @@
},
{
aliases: ['django'],
+ names: ['django'],
buildID: 'build_013',
envdVersion: '0.1.0',
cpuCount: 2,
@@ -295,6 +311,7 @@
},
{
aliases: ['flask'],
+ names: ['flask'],
buildID: 'build_014',
envdVersion: '0.1.0',
cpuCount: 1,
@@ -311,6 +328,7 @@
},
{
aliases: ['golang', 'go'],
+ names: ['golang', 'go'],
buildID: 'build_015',
envdVersion: '0.1.0',
cpuCount: 2,
@@ -330,6 +348,7 @@
},
{
aliases: ['rust'],
+ names: ['rust'],
buildID: 'build_016',
cpuCount: 2,
memoryMB: 2048,
@@ -346,6 +365,7 @@
},
{
aliases: ['java-spring', 'spring'],
+ names: ['java-spring', 'spring'],
buildID: 'build_017',
cpuCount: 3,
memoryMB: 4096,
@@ -365,6 +385,7 @@
},
{
aliases: ['dotnet', 'csharp'],
+ names: ['dotnet', 'csharp'],
buildID: 'build_018',
cpuCount: 2,
memoryMB: 3072,
@@ -381,6 +402,7 @@
},
{
aliases: ['php-laravel', 'laravel'],
+ names: ['php-laravel', 'laravel'],
buildID: 'build_019',
cpuCount: 2,
memoryMB: 2048,
@@ -400,6 +422,7 @@
},
{
aliases: ['ruby-rails', 'rails'],
+ names: ['ruby-rails', 'rails'],
buildID: 'build_020',
cpuCount: 2,
memoryMB: 2048,
@@ -416,6 +439,7 @@
},
{
aliases: ['jupyter', 'notebook'],
+ names: ['jupyter', 'notebook'],
buildID: 'build_021',
cpuCount: 4,
memoryMB: 6144,
@@ -435,6 +459,7 @@
},
{
aliases: ['tensorflow'],
+ names: ['tensorflow'],
buildID: 'build_022',
cpuCount: 8,
memoryMB: 16384,
@@ -454,6 +479,7 @@
},
{
aliases: ['pytorch'],
+ names: ['pytorch'],
buildID: 'build_023',
cpuCount: 8,
memoryMB: 16384,
@@ -473,6 +499,7 @@
},
{
aliases: ['cassandra'],
+ names: ['cassandra'],
buildID: 'build_024',
cpuCount: 4,
memoryMB: 8192,
@@ -489,6 +516,7 @@
},
{
aliases: ['docker', 'dind'],
+ names: ['docker', 'dind'],
buildID: 'build_025',
cpuCount: 2,
memoryMB: 4096,
@@ -508,6 +536,7 @@
},
{
aliases: ['kubernetes', 'k8s'],
+ names: ['kubernetes', 'k8s'],
buildID: 'build_026',
cpuCount: 4,
memoryMB: 8192,
@@ -527,6 +556,7 @@
},
{
aliases: ['terraform'],
+ names: ['terraform'],
buildID: 'build_027',
cpuCount: 2,
memoryMB: 2048,
@@ -543,6 +573,7 @@
},
{
aliases: ['ansible'],
+ names: ['ansible'],
buildID: 'build_028',
cpuCount: 1,
memoryMB: 1536,
@@ -562,6 +593,7 @@
},
{
aliases: ['prometheus'],
+ names: ['prometheus'],
buildID: 'build_029',
cpuCount: 2,
memoryMB: 3072,
@@ -578,6 +610,7 @@
},
{
aliases: ['jenkins'],
+ names: ['jenkins'],
buildID: 'build_030',
cpuCount: 3,
envdVersion: '0.1.0',
@@ -597,6 +630,7 @@
},
{
aliases: ['gitlab-ci'],
+ names: ['gitlab-ci'],
buildID: 'build_031',
cpuCount: 2,
envdVersion: '0.1.0',
@@ -613,6 +647,7 @@
},
{
aliases: ['apache-spark', 'spark'],
+ names: ['apache-spark', 'spark'],
buildID: 'build_032',
cpuCount: 8,
envdVersion: '0.1.0',
@@ -632,6 +667,7 @@
},
{
aliases: ['kafka'],
+ names: ['kafka'],
envdVersion: '0.1.0',
buildID: 'build_033',
cpuCount: 3,
@@ -648,6 +684,7 @@
},
{
aliases: ['rabbitmq'],
+ names: ['rabbitmq'],
buildID: 'build_034',
cpuCount: 2,
memoryMB: 2048,
@@ -667,6 +704,7 @@
},
{
aliases: ['zookeeper'],
+ names: ['zookeeper'],
envdVersion: '0.1.0',
buildID: 'build_035',
cpuCount: 1,
@@ -683,6 +721,7 @@
},
{
aliases: ['solr'],
+ names: ['solr'],
buildID: 'build_036',
cpuCount: 2,
memoryMB: 4096,
@@ -702,6 +741,7 @@
},
{
aliases: ['logstash'],
+ names: ['logstash'],
buildID: 'build_037',
cpuCount: 2,
memoryMB: 3072,
@@ -718,6 +758,7 @@
},
{
aliases: ['kibana'],
+ names: ['kibana'],
buildID: 'build_038',
cpuCount: 1,
memoryMB: 2048,
@@ -734,6 +775,7 @@
},
{
aliases: ['minio'],
+ names: ['minio'],
buildID: 'build_039',
cpuCount: 2,
memoryMB: 2048,
@@ -753,6 +795,7 @@
},
{
aliases: ['vault'],
+ names: ['vault'],
buildID: 'build_040',
cpuCount: 1,
envdVersion: '0.1.0',
diff --git a/src/features/dashboard/templates/list/table-cells.tsx b/src/features/dashboard/templates/list/table-cells.tsx
--- a/src/features/dashboard/templates/list/table-cells.tsx
+++ b/src/features/dashboard/templates/list/table-cells.tsx
@@ -292,7 +292,7 @@
// Prefer a name without "/" as the primary display name
const primaryName = names.find((name) => !name.includes('/')) ?? names[0]
- const additionalCount = names.length - 1
+ const additionalNames = names.filter((name) => name !== primaryName)
return (
<div
@@ -304,16 +304,16 @@
)}
>
<span>{primaryName ?? 'N/A'}</span>
- {additionalCount > 0 && (
+ {additionalNames.length > 0 && (
<HelpTooltip
trigger={
<span className="text-fg-tertiary bg-bg-muted rounded px-1.5 py-0.5 text-xs font-medium">
- +{additionalCount}
+ +{additionalNames.length}
</span>
}
>
<div className="flex flex-col gap-1">
- {names.slice(1).map((name) => (
+ {additionalNames.map((name) => (
<span key={name} className="font-mono text-xs">
{name}
</span> |
e0ba58b to
1f4dba5
Compare
| <span>{team.id}</span> | ||
| <CopyButton value={team.id} variant="ghost" className="size-5" /> | ||
| </div> | ||
| <div className="flex items-center gap-2"> |
There was a problem hiding this comment.
add also team slug to the teams info
1f4dba5 to
8aeec95
Compare
8aeec95 to
22704a6
Compare
| required: | ||
| - alias |
There was a problem hiding this comment.
Should we do something like:
oneOf:
- required: [ alias ]
- required: [ name ]
There was a problem hiding this comment.
alias is deprecated + the oneOf generator in go is not great
| name: | ||
| description: Name of the template. Can include a tag with colon separator (e.g. "my-template" or "my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array. | ||
| type: string | ||
| tags: |
There was a problem hiding this comment.
Silly question - what's the difference between a name and a tag? Is a name more important than a tag?
There was a problem hiding this comment.
name is the name of the template, tag is a pointer to a specific build within the template
There was a problem hiding this comment.
(docs for context: https://e2b.dev/docs/template/tags) let me know please if something is not clear 🙏
22704a6 to
e2b4fb0
Compare
e2b4fb0 to
e7bdb0a
Compare
|
Bugbot Autofix prepared fixes for 1 of the 1 bugs found in the latest run.
Or push these changes by commenting: Preview (998b7633c8)diff --git a/spec/openapi.infra.yaml b/spec/openapi.infra.yaml
--- a/spec/openapi.infra.yaml
+++ b/spec/openapi.infra.yaml
@@ -933,6 +933,8 @@
description: Whether the step should be forced to run regardless of the cache
TemplateBuildRequestV3:
+ required:
+ - name
properties:
name:
description: Name of the template. Can include a tag with colon separator (e.g. "my-template" or "my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array.
diff --git a/src/types/infra-api.types.ts b/src/types/infra-api.types.ts
--- a/src/types/infra-api.types.ts
+++ b/src/types/infra-api.types.ts
@@ -2289,7 +2289,7 @@
};
TemplateBuildRequestV3: {
/** @description Name of the template. Can include a tag with colon separator (e.g. "my-template" or "my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array. */
- name?: string;
+ name: string;
/** @description Tags to assign to the template build */
tags?: string[];
/** |

Note
Medium Risk
Changes API contracts and generated types (new endpoints, deprecated fields) and updates the template list rendering logic, which can break clients if backend responses don’t match the new
names/tagging shapes.Overview
Updates the templates API and UI to support namespaced template names via a new
namesarray, deprecatingaliasesfor display and wiring default-template fetching to build names fromenv_aliases.namespace+alias.Extends the OpenAPI spec with template tagging endpoints (
POST/DELETE /templates/tags), aGET /templates/aliases/{alias}lookup, and a newPATCH /v2/templates/{templateID}(while deprecating the existing/templates/{templateID}patch); also updates generated types and mock data accordingly, plus showsteam.slugin settings.Written by Cursor Bugbot for commit 6513daf. This will update automatically on new commits. Configure here.