Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): stop doubling '@' in Publisher scope display

Jose Ramirezbe9f521eb82f
diff --git a/control-ui/components/PublisherView/DockerCredentials.tsx b/control-ui/components/PublisherView/DockerCredentials.tsx
index 8892a2e05..16a75f7fd 100644
--- a/control-ui/components/PublisherView/DockerCredentials.tsx
+++ b/control-ui/components/PublisherView/DockerCredentials.tsx
@@ -15,6 +15,7 @@ import { useToast } from '../Toast'
import { Button } from '../ui'
import { DockerCredentialModal } from './DockerCredentialModal'
import { RetryBanner } from './RetryBanner'
+import { dockerNamespace } from './dockerCredential'
// Mirrors RegistryApiKeysPanel's state machine: the org registry-keys route is
// user+owner-gated, so a non-owner admin on an org-bound deploy (Publisher is
@@ -129,8 +130,8 @@ export function DockerCredentialsPanel({ orgScope }: { orgScope: string }) {
<div className="cu-card__body">
<p className="cu-field__hint">
Generate a durable credential to <code>docker push</code> images to{' '}
- <code>registry.evenfire.ai/{orgScope}/…</code>. Keys are listable and revocable for CI
- hygiene.
+ <code>registry.evenfire.ai/{dockerNamespace(orgScope)}/…</code>. Keys are listable and
+ revocable for CI hygiene.
</p>
{isReady ? (
diff --git a/control-ui/components/PublisherView/dockerCredential.ts b/control-ui/components/PublisherView/dockerCredential.ts
index ee3dc7bf9..e0545ab1b 100644
--- a/control-ui/components/PublisherView/dockerCredential.ts
+++ b/control-ui/components/PublisherView/dockerCredential.ts
@@ -6,8 +6,18 @@ export function buildDockerLoginCommand(registry: string, key: string): string {
return `docker login ${registry} -u _ -p ${key}`
}
+/**
+ * The Docker namespace for an org scope. resolvePublishScope() returns the scope
+ * already prefixed as `@<org>`, but a Docker repo path must not contain '@' (it
+ * is the digest delimiter — `docker` rejects it with "invalid reference format"),
+ * so the leading '@' is dropped.
+ */
+export function dockerNamespace(orgScope: string): string {
+ return orgScope.replace(/^@/, '')
+}
+
export function buildPushCoordinate(registry: string, orgScope: string): string {
- return `${registry}/${orgScope}/<name>:<tag>`
+ return `${registry}/${dockerNamespace(orgScope)}/<name>:<tag>`
}
export function deriveDockerconfigjson(registry: string, key: string): string {
diff --git a/control-ui/components/PublisherView/index.tsx b/control-ui/components/PublisherView/index.tsx
index 3811eda4c..03ce4caf0 100644
--- a/control-ui/components/PublisherView/index.tsx
+++ b/control-ui/components/PublisherView/index.tsx
@@ -44,7 +44,8 @@ export function PublisherView({ activeTab }: { activeTab: PublisherTab }) {
return (
<section>
<div className="cu-card cu-card--viewport-fill">
- <TablePanelHeader title={`Publisher — @${orgScope}`} />
+ {/* orgScope (scope.scope) is already `@<org>`-prefixed by resolvePublishScope(); do not add another '@'. */}
+ <TablePanelHeader title={`Publisher — ${orgScope}`} />
<div className="cu-card__body">
<TabBar<PublisherTab>
ariaLabel="Publisher sections"
diff --git a/control-ui/components/__tests__/DockerCredentials.test.tsx b/control-ui/components/__tests__/DockerCredentials.test.tsx
index 618d14e0b..22c9dc43e 100644
--- a/control-ui/components/__tests__/DockerCredentials.test.tsx
+++ b/control-ui/components/__tests__/DockerCredentials.test.tsx
@@ -44,6 +44,14 @@ describe('DockerCredentialsPanel', () => {
expect(await screen.findByText('efrk_abc')).toBeInTheDocument()
})
+ it('push hint strips the leading @ from the org scope (valid Docker path)', async () => {
+ // orgScope is `@<org>`-prefixed; the hint must show a valid Docker path.
+ vi.mocked(api.listRegistryApiKeys).mockResolvedValue({ org: 'acme', keys: [] })
+ render(<DockerCredentialsPanel orgScope="@acme" />)
+ expect(await screen.findByText('registry.evenfire.ai/acme/…')).toBeInTheDocument()
+ expect(screen.queryByText(/@acme/)).not.toBeInTheDocument()
+ })
+
it('generate → shows the reveal modal (docker login snippet) → refetches', async () => {
vi.mocked(api.listRegistryApiKeys)
.mockResolvedValueOnce({ org: 'acme', keys: [] })
diff --git a/control-ui/components/__tests__/PublisherView.test.tsx b/control-ui/components/__tests__/PublisherView.test.tsx
index f9ad1ea5d..7c56d5354 100644
--- a/control-ui/components/__tests__/PublisherView.test.tsx
+++ b/control-ui/components/__tests__/PublisherView.test.tsx
@@ -58,6 +58,20 @@ describe('PublisherView', () => {
expect(await screen.findByText('owned-entries-panel')).toBeInTheDocument()
})
+ it('header renders the already-@-prefixed org scope once (no double @@)', () => {
+ // resolvePublishScope() in control-api returns `scope` already prefixed as
+ // `@<org>` (registryClient.ts). The header must render it verbatim and must
+ // NOT prepend a second '@', otherwise it reads "Publisher — @@acme".
+ vi.mocked(hook.usePublishScope).mockReturnValue({
+ scope: { scope: '@acme', curator: false, orgName: 'Acme' },
+ loading: false,
+ error: false,
+ })
+ render(<PublisherView activeTab="entries" />)
+ expect(screen.getByText('Publisher — @acme')).toBeInTheDocument()
+ expect(screen.queryByText(/@@/)).not.toBeInTheDocument()
+ })
+
it('renders the docker-credentials panel on the credentials tab', () => {
vi.mocked(hook.usePublishScope).mockReturnValue({
scope: { scope: 'acme', curator: false, orgName: 'Acme' },
diff --git a/control-ui/components/__tests__/dockerCredential.test.ts b/control-ui/components/__tests__/dockerCredential.test.ts
index cb9064243..198d33389 100644
--- a/control-ui/components/__tests__/dockerCredential.test.ts
+++ b/control-ui/components/__tests__/dockerCredential.test.ts
@@ -19,6 +19,15 @@ describe('dockerCredential helpers', () => {
)
})
+ it('strips the leading @ from an org-scoped coordinate', () => {
+ // resolvePublishScope() returns `scope` already prefixed as `@<org>`, but a
+ // Docker repo path must not contain '@' (it is the digest delimiter), so the
+ // coordinate the user copies must be `registry/<org>/…`, not `registry/@<org>/…`.
+ expect(buildPushCoordinate('registry.evenfire.ai', '@acme')).toBe(
+ 'registry.evenfire.ai/acme/<name>:<tag>'
+ )
+ })
+
it('derives dockerconfigjson with username _, password key, and base64 auth', () => {
const json = deriveDockerconfigjson('registry.evenfire.ai', 'efrk_secret')
const parsed = JSON.parse(json)
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 0964bb65e..2cb64779c 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.331",
+ "version": "0.1.332",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.331",
+ "version": "0.1.332",
"dependencies": {
"@clerum/llm-providers": "file:../packages/llm-providers",
"@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",
diff --git a/control-ui/package.json b/control-ui/package.json
index 3e7d83caa..0f5bed389 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.331",
+ "version": "0.1.332",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",