Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions .changeset/39335-connector-credentials-setup-group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@objectstack/service-automation": patch
---

Clause-②: no
Metadata-protocol: none

The Connector Credentials and Connector Connections Setup entries now name the Integrations & Developer group by its live id, `group_integrations_dev`, instead of the retired `group_integrations`. The entries render in the same place as before; a boot no longer logs a `nav_contribution_group_renamed` warning against the platform's own navigation.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import { describe, expect, it } from 'vitest';
import { LiteKernel } from '@objectstack/core';
import { ManifestSchema } from '@objectstack/spec/kernel';
import { PLATFORM_CAPABILITIES } from '@objectstack/spec/security';
import { SchemaRegistry, checkNavContributionGroupRenames } from '@objectstack/objectql';
import { SETUP_APP } from '@objectstack/platform-objects';

import { AutomationServicePlugin } from './plugin.js';
import {
Expand All @@ -44,7 +46,7 @@ describe('[#27238] the connector credentials UI bundle', () => {
expect(CONNECTOR_CREDENTIALS_UI_BUNDLE.navigationContributions).toEqual([
{
app: 'setup',
group: 'group_integrations',
group: 'group_integrations_dev',
priority: 120,
items: [
{
Expand Down Expand Up @@ -76,6 +78,44 @@ describe('[#27238] the connector credentials UI bundle', () => {
});
});

/**
* The bundle's Setup contribution names a live Setup group id, read off
* `SETUP_APP` rather than spelled here: a retired id still lands through the
* successor's `renamedFrom`, but warns `nav_contribution_group_renamed` on every
* boot, so "it renders in the right group" alone would not catch it.
*/
describe('the connector credentials UI bundle names a live Setup group', () => {
const contributions = CONNECTOR_CREDENTIALS_UI_BUNDLE.navigationContributions;
const groups = (SETUP_APP.navigation ?? []).filter((n: any) => n?.type === 'group') as any[];

it('targets a group SETUP_APP declares, not one a group lists under renamedFrom', () => {
const live = new Set(groups.map((g) => g.id));
const retired = new Set(groups.flatMap((g) => g.renamedFrom ?? []));
for (const c of contributions) {
expect(live.has(c.group)).toBe(true);
expect(retired.has(c.group)).toBe(false);
}
});

it('draws no retired-group-id diagnostic, and the retired spelling would', () => {
expect(checkNavContributionGroupRenames([SETUP_APP as any], contributions as any)).toEqual([]);
// Non-vacuity: the spelling this entry used to carry is reported.
expect(
checkNavContributionGroupRenames([SETUP_APP as any], [{ ...contributions[0], group: 'group_integrations' }] as any)
.map((d) => d.renamedTo),
).toEqual([contributions[0].group]);
});

it('lands both items in that group of the merged Setup tree', () => {
const registry = new SchemaRegistry({ multiTenant: false, collisionPolicy: 'error' });
(registry as any).logLevel = 'silent';
registry.registerApp(structuredClone(SETUP_APP) as any, '@objectstack/platform-objects');
registry.registerAppNavContribution(structuredClone(contributions[0]) as any, CONNECTOR_CREDENTIALS_UI_BUNDLE.id);
const group = ((registry.getApp('setup') as any)?.navigation ?? []).find((n: any) => n?.id === contributions[0].group);
expect((group?.children ?? []).map((c: any) => c?.id)).toEqual(['nav_connector_credentials', 'nav_connector_connections']);
});
});

/** Boot a kernel whose `manifest` service (when given) records every registration. */
async function boot(opts: { withManifest: boolean; armRuntime?: boolean }) {
const registered: Array<{ id?: string }> = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ export const CONNECTOR_CONNECTIONS_NAV_CAPABILITY = 'manage_connector_connection

/**
* `priority` orders contributions within a group, lowest first. The group's
* other contributors, read where they are declared: Webhooks / HTTP Deliveries
* (`@objectstack/plugin-webhooks`) and Datasources
* (`@objectstack/service-datasource`) at 100, Cloud Connection
* (`@objectstack/cloud-connection`) at 200 — so 120 sorts this entry after the
* other contributors, read where they are declared: Datasources
* (`@objectstack/service-datasource`) at 105, Cloud Connection
* (`@objectstack/cloud-connection`) at 110, Webhooks / HTTP Deliveries
* (`@objectstack/plugin-webhooks`) at 115 — so 120 sorts this entry after the
* connection surfaces it serves.
*
* `group` names Setup's Integrations & Developer group by its live id. The
* retired `group_integrations` still lands there through that group's
* `renamedFrom`, but draws a `nav_contribution_group_renamed` warning on every
* boot — the diagnostic meant for an app's stale group id, not the platform's.
*/
export const CONNECTOR_CREDENTIALS_UI_BUNDLE = {
id: 'com.objectstack.service-automation.connector-credentials-ui',
Expand All @@ -59,7 +64,7 @@ export const CONNECTOR_CREDENTIALS_UI_BUNDLE = {
navigationContributions: [
{
app: 'setup',
group: 'group_integrations',
group: 'group_integrations_dev',
priority: 120,
items: [
{
Expand Down
Loading