@app-vitals/agent-lib 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin-types.ts +5 -1
- package/package.json +1 -1
- package/web/toolbar.ts +6 -1
- package/web/toolbar.unit.test.ts +22 -0
package/admin-types.ts
CHANGED
|
@@ -281,7 +281,7 @@ export interface paths {
|
|
|
281
281
|
head?: never;
|
|
282
282
|
/**
|
|
283
283
|
* Update an agent
|
|
284
|
-
* @description Admin-only. Updates `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `slackId`, `trialExpiresAt`, `accountId` (platform admin only — 403 for session members; `null` clears it; reconciles the workload of in-cluster agents; does not move historical task-store rows), and/or `podServiceAccountName` (platform admin only — 403 otherwise; `null` clears it; 409 unless SHIPWRIGHT_K8S_AGENT_POD_SERVICE_ACCOUNT_ENABLED is on; 422 for agents with a per-agent federated identity; reconciles the workload so the pod is recreated under the new ServiceAccount). `specialty` (platform admin only — 403 otherwise; 422 when the type is unknown; a no-op when unchanged; otherwise persists the new type, reconciles the agent's system crons against it — system crons the new type does not declare are deleted, user crons survive — and reconciles the workload of in-cluster agents so the pod runs the image mapped to the new specialty). `trialExpiryWarnedAt` is not updatable via this route. `repos` here REPLACES the whole list; for incremental changes use `POST /agents/{id}/repos` (add) and `DELETE /agents/{id}/repos/{owner}/{name}` (remove). Returns the updated agent, including a `warning` field when `restrictSlackToMembers` is set true on an agent with zero members.
|
|
284
|
+
* @description Admin-only. Updates `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `slackId`, `trialExpiresAt`, `githubUsername` (platform admin only — 403 otherwise; `null` clears it; lower-cased on save; 422 for invalid GitHub login syntax; no GitHub call), `accountId` (platform admin only — 403 for session members; `null` clears it; reconciles the workload of in-cluster agents; does not move historical task-store rows), and/or `podServiceAccountName` (platform admin only — 403 otherwise; `null` clears it; 409 unless SHIPWRIGHT_K8S_AGENT_POD_SERVICE_ACCOUNT_ENABLED is on; 422 for agents with a per-agent federated identity; reconciles the workload so the pod is recreated under the new ServiceAccount). `specialty` (platform admin only — 403 otherwise; 422 when the type is unknown; a no-op when unchanged; otherwise persists the new type, reconciles the agent's system crons against it — system crons the new type does not declare are deleted, user crons survive — and reconciles the workload of in-cluster agents so the pod runs the image mapped to the new specialty). `trialExpiryWarnedAt` is not updatable via this route. `repos` here REPLACES the whole list; for incremental changes use `POST /agents/{id}/repos` (add) and `DELETE /agents/{id}/repos/{owner}/{name}` (remove). Returns the updated agent, including a `warning` field when `restrictSlackToMembers` is set true on an agent with zero members.
|
|
285
285
|
*/
|
|
286
286
|
patch: {
|
|
287
287
|
parameters: {
|
|
@@ -3406,6 +3406,8 @@ export interface components {
|
|
|
3406
3406
|
trialExpiresAt?: string | null;
|
|
3407
3407
|
/** Format: date-time */
|
|
3408
3408
|
trialExpiryWarnedAt?: string | null;
|
|
3409
|
+
/** @example octocat */
|
|
3410
|
+
githubUsername?: string | null;
|
|
3409
3411
|
/** @example [
|
|
3410
3412
|
* "example-marketplace",
|
|
3411
3413
|
* "shipwright"
|
|
@@ -3463,6 +3465,8 @@ export interface components {
|
|
|
3463
3465
|
accountId?: string | null;
|
|
3464
3466
|
/** @example agent-pod-sa */
|
|
3465
3467
|
podServiceAccountName?: string | null;
|
|
3468
|
+
/** @example octocat */
|
|
3469
|
+
githubUsername?: string | null;
|
|
3466
3470
|
/**
|
|
3467
3471
|
* Format: date-time
|
|
3468
3472
|
* @example 2026-12-01T00:00:00.000Z
|
package/package.json
CHANGED
package/web/toolbar.ts
CHANGED
|
@@ -27,6 +27,11 @@ export interface ShipwrightToolbarOptions {
|
|
|
27
27
|
* Defaults to false so other services sharing this toolbar never show it.
|
|
28
28
|
*/
|
|
29
29
|
showAccount?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Render the admin-only "Settings" nav entry (enterprise GitHub apps,
|
|
32
|
+
* GHE-1.4). Defaults to false.
|
|
33
|
+
*/
|
|
34
|
+
showSettings?: boolean;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
export function baseStyles(): string {
|
|
@@ -230,7 +235,7 @@ export function renderShipwrightToolbar(
|
|
|
230
235
|
<a href="${adminBase}/admin/prs" class="vos-nav-link${active("/admin/prs")}">PRs</a>
|
|
231
236
|
<a href="${adminBase}/admin/chat" class="vos-nav-link${active("/admin/chat")}">Chat</a>
|
|
232
237
|
<a href="${adminBase}/admin/queue-activity" class="vos-nav-link${isQueueActivity ? " active" : ""}">Queue & Activity</a>
|
|
233
|
-
${opts.showAccount ? `<a href="${adminBase}/admin/account" class="vos-nav-link${active("/admin/account")}">Account</a>\n ` : ""}<a href="${metricsUrl}" class="vos-nav-link${active(metricsUrl)}">Metrics</a>
|
|
238
|
+
${opts.showAccount ? `<a href="${adminBase}/admin/account" class="vos-nav-link${active("/admin/account")}">Account</a>\n ` : ""}${opts.showSettings ? `<a href="${adminBase}/admin/settings/github-enterprise" class="vos-nav-link${active("/admin/settings")}">Settings</a>\n ` : ""}<a href="${metricsUrl}" class="vos-nav-link${active(metricsUrl)}">Metrics</a>
|
|
234
239
|
</div>
|
|
235
240
|
<div class="vos-user">
|
|
236
241
|
<span class="vos-username">${escapeHtml(userName)}</span>
|
package/web/toolbar.unit.test.ts
CHANGED
|
@@ -241,3 +241,25 @@ describe("renderShipwrightToolbar Account entry (SSP-3.2)", () => {
|
|
|
241
241
|
expect(html).not.toContain("/admin/account");
|
|
242
242
|
});
|
|
243
243
|
});
|
|
244
|
+
|
|
245
|
+
describe("renderShipwrightToolbar Settings entry (GHE-1.4)", () => {
|
|
246
|
+
const base = {
|
|
247
|
+
userName: "a@x.com",
|
|
248
|
+
activePath: "/admin/settings/github-enterprise",
|
|
249
|
+
logoutAction: "/admin/logout",
|
|
250
|
+
};
|
|
251
|
+
test("omitted by default", () => {
|
|
252
|
+
expect(renderShipwrightToolbar(base)).not.toContain("/admin/settings");
|
|
253
|
+
});
|
|
254
|
+
test("rendered and active when showSettings is true", () => {
|
|
255
|
+
const html = renderShipwrightToolbar({ ...base, showSettings: true });
|
|
256
|
+
expect(html).toContain(
|
|
257
|
+
'href="/admin/settings/github-enterprise" class="vos-nav-link active">Settings</a>',
|
|
258
|
+
);
|
|
259
|
+
});
|
|
260
|
+
test("readOnly never renders it", () => {
|
|
261
|
+
expect(
|
|
262
|
+
renderShipwrightToolbar({ ...base, readOnly: true, showSettings: true }),
|
|
263
|
+
).not.toContain("/admin/settings");
|
|
264
|
+
});
|
|
265
|
+
});
|