feat(scaffolder): implement scaffolderServiceRef for credentials aware communication (#33044)

* add scaffolderServiceRef to scaffolder-node

Signed-off-by: benjdlambert <ben@blam.sh>

* make ScaffolderApi methods required, add tests

Signed-off-by: benjdlambert <ben@blam.sh>

* use request objects for single-string params in ScaffolderService

Signed-off-by: benjdlambert <ben@blam.sh>

* add scaffolderServiceMock test utility

Signed-off-by: benjdlambert <ben@blam.sh>

* adjust review comments

Signed-off-by: benjdlambert <ben@blam.sh>

* add scaffolderApiMock test utility to scaffolder-react

Signed-off-by: benjdlambert <ben@blam.sh>

* use items/totalItems response shape for listTasks

Signed-off-by: benjdlambert <ben@blam.sh>

* pass credentials through for autocomplete

Signed-off-by: benjdlambert <ben@blam.sh>

---------

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
Ben Lambert
2026-02-27 17:24:49 +01:00
committed by GitHub
parent 1b3dea2092
commit f598909f0f
26 changed files with 1188 additions and 112 deletions
@@ -38,6 +38,9 @@ describe('TemplateEditorToolbar', () => {
listActions: jest.fn(),
listTasks: jest.fn(),
autocomplete: jest.fn(),
retry: jest.fn(),
listTemplatingExtensions: jest.fn(),
dryRun: jest.fn(),
};
scaffolderApiMock.listActions.mockResolvedValue([
@@ -54,6 +54,9 @@ const scaffolderApiMock: jest.Mocked<ScaffolderApi> = {
listActions: jest.fn(),
listTasks: jest.fn(),
autocomplete: jest.fn(),
retry: jest.fn(),
listTemplatingExtensions: jest.fn(),
dryRun: jest.fn(),
};
const scaffolderDecoratorsMock: jest.Mocked<ScaffolderFormDecoratorsApi> = {
@@ -34,6 +34,9 @@ const scaffolderApiMock: jest.Mocked<ScaffolderApi> = {
listActions: jest.fn(),
listTasks: jest.fn(),
autocomplete: jest.fn(),
retry: jest.fn(),
listTemplatingExtensions: jest.fn(),
dryRun: jest.fn(),
};
const mockPermissionApi = { authorize: jest.fn() };
@@ -40,6 +40,8 @@ const scaffolderApiMock: jest.Mocked<ScaffolderApi> = {
listTemplatingExtensions,
listTasks: jest.fn(),
autocomplete: jest.fn(),
retry: jest.fn(),
dryRun: jest.fn(),
};
const mockPermissionApi = { authorize: jest.fn() };