Merge pull request #31235 from backstage/blam/breakl
`scaffolder`: Removing old deprecated types and cleanup
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-bitbucket-cloud': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-notifications': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-bitbucket': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-gerrit': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-github': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-gitlab': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-sentry': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-yeoman': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-azure': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-gitea': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-rails': patch
|
||||
---
|
||||
|
||||
Updating import for the `scaffolderActionsExtensionPoint` to be the main export
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-node': minor
|
||||
---
|
||||
|
||||
**BREAKING** - Marking optional fields as required in the `TaskBroker`, these can be fixed with a no-op `() => void` if you don't want to implement the functions.
|
||||
|
||||
- `cancel`, `recoverTasks` and `retry` are the required methods on the `TaskBroker` interface.
|
||||
|
||||
**NOTE**: If you're affected by this breaking change, please reach out to us in an issue as we're thinking about completely removing the `TaskBroker` extension point soon and would like to hear your use cases for the upcoming re-architecture of the `scaffolder-backend` plugin.
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-node': patch
|
||||
---
|
||||
|
||||
**BREAKING ALPHA**: We've moved the `scaffolderActionsExtensionPoint` from `/alpha` to the main export.
|
||||
|
||||
```tsx
|
||||
// before
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
|
||||
// after
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-node': patch
|
||||
---
|
||||
|
||||
**DEPRECATION**: We're going to be working on refactoring a lot of the internals of the Scaffolder backend plugin, and with that comes a lot of deprecations and removals for public types that are making these things hard.
|
||||
|
||||
If you're using these types, please reach out to us either on Discord or a GitHub issue with your use cases.
|
||||
|
||||
- `SerializedTask`, `SerializedTaskEvent`, `TaskBroker`, `TaskContext`, `TaskBrokerDispatchOptions`, `TaskBrokerDispatchResult`, `TaskCompletionState`, `TaskEventType`, `TaskFilter`, `TaskFilters`, `TaskStatus` are the types that have now been marked as deprecated, and will be removed in a future release.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': major
|
||||
---
|
||||
|
||||
**BREAKING** - Removing the deprecated types and interfaces, there's no replacement for these types, and hopefully not currently used as they offer no value with the plugin being on the new backend system and no way to consume them.
|
||||
|
||||
Affected types: `CreateWorkerOptions`, `CurrentClaimedTask`, `DatabaseTaskStore`, `DatabaseTaskStoreOptions`, `TaskManager`, `TaskStore`, `TaskStoreCreateTaskOptions`, `TaskStoreCreateTaskResult`, `TaskStoreEmitOptions`, `TaskStoreListEventsOptions`, `TaskStoreRecoverTaskOptions`, `TaskStoreShutDownTaskOptions`, `TaskWorker` and `TemplateActionRegistry`.
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
coreServices,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import { createPublishAzureAction } from './actions';
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,10 +17,7 @@ import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
scaffolderActionsExtensionPoint,
|
||||
scaffolderAutocompleteExtensionPoint,
|
||||
} from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderAutocompleteExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { createBitbucketCloudBranchRestrictionAction } from './actions/bitbucketCloudBranchRestriction';
|
||||
import {
|
||||
createBitbucketPipelinesRunAction,
|
||||
@@ -29,6 +26,7 @@ import {
|
||||
} from './actions';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { handleAutocompleteRequest } from './autocomplete/autocomplete';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import {
|
||||
createPublishBitbucketServerAction,
|
||||
createPublishBitbucketServerPullRequestAction,
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import {
|
||||
createBitbucketPipelinesRunAction,
|
||||
createPublishBitbucketCloudAction,
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
createBackendModule,
|
||||
coreServices,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import { createConfluenceToMarkdownAction } from './actions';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import { createFetchCookiecutterAction } from './actions';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import {
|
||||
createPublishGerritAction,
|
||||
createPublishGerritReviewAction,
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
createBackendModule,
|
||||
coreServices,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import { createPublishGiteaAction } from './actions';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
|
||||
|
||||
@@ -17,10 +17,7 @@ import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
scaffolderActionsExtensionPoint,
|
||||
scaffolderAutocompleteExtensionPoint,
|
||||
} from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderAutocompleteExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import {
|
||||
createGithubActionsDispatchAction,
|
||||
createGithubAutolinksAction,
|
||||
@@ -42,6 +39,7 @@ import {
|
||||
} from '@backstage/integration';
|
||||
import { createHandleAutocompleteRequest } from './autocomplete/autocomplete';
|
||||
import { catalogServiceRef } from '@backstage/plugin-catalog-node';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
||||
@@ -18,10 +18,7 @@ import {
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import {
|
||||
scaffolderActionsExtensionPoint,
|
||||
scaffolderAutocompleteExtensionPoint,
|
||||
} from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderAutocompleteExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import {
|
||||
createGitlabGroupEnsureExistsAction,
|
||||
createGitlabIssueAction,
|
||||
@@ -36,6 +33,7 @@ import {
|
||||
} from './actions';
|
||||
import { createGitlabProjectMigrateAction } from './actions/gitlabProjectMigrate';
|
||||
import { createHandleAutocompleteRequest } from './autocomplete/autocomplete';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { createBackendModule } from '@backstage/backend-plugin-api';
|
||||
import { notificationService } from '@backstage/plugin-notifications-node';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import { createSendNotificationAction } from './actions';
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import { createFetchRailsAction } from './actions';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
coreServices,
|
||||
createBackendModule,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import { createSentryCreateProjectAction } from './actions/createProject';
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { createBackendModule } from '@backstage/backend-plugin-api';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
|
||||
import { createRunYeomanAction } from './actions';
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,45 +3,21 @@
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
import { AuditorService } from '@backstage/backend-plugin-api';
|
||||
import { AuthService } from '@backstage/backend-plugin-api';
|
||||
import { BackendFeature } from '@backstage/backend-plugin-api';
|
||||
import { BackstageCredentials } from '@backstage/backend-plugin-api';
|
||||
import { CatalogService } from '@backstage/plugin-catalog-node';
|
||||
import { Config } from '@backstage/config';
|
||||
import { DatabaseService } from '@backstage/backend-plugin-api';
|
||||
import { Duration } from 'luxon';
|
||||
import { EventsService } from '@backstage/plugin-events-node';
|
||||
import { HumanDuration } from '@backstage/types';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { Knex } from 'knex';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { PermissionCriteria } from '@backstage/plugin-permission-common';
|
||||
import { PermissionEvaluator } from '@backstage/plugin-permission-common';
|
||||
import { PermissionRule } from '@backstage/plugin-permission-node';
|
||||
import { PermissionRuleParams } from '@backstage/plugin-permission-common';
|
||||
import { RESOURCE_TYPE_SCAFFOLDER_ACTION } from '@backstage/plugin-scaffolder-common/alpha';
|
||||
import { RESOURCE_TYPE_SCAFFOLDER_TEMPLATE } from '@backstage/plugin-scaffolder-common/alpha';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { SerializedTask } from '@backstage/plugin-scaffolder-node';
|
||||
import { SerializedTaskEvent } from '@backstage/plugin-scaffolder-node';
|
||||
import { TaskBroker } from '@backstage/plugin-scaffolder-node';
|
||||
import { TaskCompletionState } from '@backstage/plugin-scaffolder-node';
|
||||
import { TaskContext } from '@backstage/plugin-scaffolder-node';
|
||||
import { TaskFilters } from '@backstage/plugin-scaffolder-node';
|
||||
import { TaskRecovery } from '@backstage/plugin-scaffolder-common';
|
||||
import { TaskSecrets } from '@backstage/plugin-scaffolder-node';
|
||||
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
|
||||
import { TaskSpecV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TaskStatus } from '@backstage/plugin-scaffolder-node';
|
||||
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
|
||||
import { TemplateEntityStepV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateFilter } from '@backstage/plugin-scaffolder-node';
|
||||
import { TemplateGlobal } from '@backstage/plugin-scaffolder-node';
|
||||
import { TemplateParametersV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { UpdateTaskCheckpointOptions } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { UrlReaderService } from '@backstage/backend-plugin-api';
|
||||
import { WorkspaceProvider } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
|
||||
// @public (undocumented)
|
||||
export type ActionPermissionRuleInput<
|
||||
@@ -267,359 +243,10 @@ export function createWaitAction(options?: {
|
||||
'v2'
|
||||
>;
|
||||
|
||||
// @public @deprecated
|
||||
export type CreateWorkerOptions = {
|
||||
taskBroker: TaskBroker;
|
||||
actionRegistry: TemplateActionRegistry;
|
||||
integrations: ScmIntegrations;
|
||||
workingDirectory: string;
|
||||
logger: LoggerService;
|
||||
auditor?: AuditorService;
|
||||
config?: Config;
|
||||
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
||||
concurrentTasksLimit?: number;
|
||||
additionalTemplateGlobals?: Record<string, TemplateGlobal>;
|
||||
permissions?: PermissionEvaluator;
|
||||
gracefulShutdown?: boolean;
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface CurrentClaimedTask {
|
||||
createdBy?: string;
|
||||
secrets?: TaskSecrets;
|
||||
spec: TaskSpec;
|
||||
state?: JsonObject;
|
||||
taskId: string;
|
||||
workspace?: Promise<Buffer>;
|
||||
}
|
||||
|
||||
// @public @deprecated
|
||||
export class DatabaseTaskStore implements TaskStore {
|
||||
// (undocumented)
|
||||
cancelTask(
|
||||
options: TaskStoreEmitOptions<
|
||||
{
|
||||
message: string;
|
||||
} & JsonObject
|
||||
>,
|
||||
): Promise<void>;
|
||||
// (undocumented)
|
||||
claimTask(): Promise<SerializedTask | undefined>;
|
||||
// (undocumented)
|
||||
cleanWorkspace({ taskId }: { taskId: string }): Promise<void>;
|
||||
// (undocumented)
|
||||
completeTask(options: {
|
||||
taskId: string;
|
||||
status: TaskStatus;
|
||||
eventBody: JsonObject;
|
||||
}): Promise<void>;
|
||||
// (undocumented)
|
||||
static create(options: DatabaseTaskStoreOptions): Promise<DatabaseTaskStore>;
|
||||
// (undocumented)
|
||||
createTask(
|
||||
options: TaskStoreCreateTaskOptions,
|
||||
): Promise<TaskStoreCreateTaskResult>;
|
||||
// (undocumented)
|
||||
emitLogEvent(
|
||||
options: TaskStoreEmitOptions<
|
||||
{
|
||||
message: string;
|
||||
} & JsonObject
|
||||
>,
|
||||
): Promise<void>;
|
||||
// (undocumented)
|
||||
getTask(taskId: string): Promise<SerializedTask>;
|
||||
// (undocumented)
|
||||
getTaskState({ taskId }: { taskId: string }): Promise<
|
||||
| {
|
||||
state: JsonObject;
|
||||
}
|
||||
| undefined
|
||||
>;
|
||||
// (undocumented)
|
||||
heartbeatTask(taskId: string): Promise<void>;
|
||||
// (undocumented)
|
||||
list(options: {
|
||||
createdBy?: string;
|
||||
status?: TaskStatus;
|
||||
filters?: {
|
||||
createdBy?: string | string[];
|
||||
status?: TaskStatus | TaskStatus[];
|
||||
};
|
||||
pagination?: {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
};
|
||||
order?: {
|
||||
order: 'asc' | 'desc';
|
||||
field: string;
|
||||
}[];
|
||||
permissionFilters?: PermissionCriteria<TaskFilters>;
|
||||
}): Promise<{
|
||||
tasks: SerializedTask[];
|
||||
totalTasks?: number;
|
||||
}>;
|
||||
// (undocumented)
|
||||
listEvents(options: TaskStoreListEventsOptions): Promise<{
|
||||
events: SerializedTaskEvent[];
|
||||
}>;
|
||||
// (undocumented)
|
||||
listStaleTasks(options: { timeoutS: number }): Promise<{
|
||||
tasks: {
|
||||
taskId: string;
|
||||
recovery?: TaskRecovery;
|
||||
}[];
|
||||
}>;
|
||||
// (undocumented)
|
||||
recoverTasks(options: TaskStoreRecoverTaskOptions): Promise<{
|
||||
ids: string[];
|
||||
}>;
|
||||
// (undocumented)
|
||||
rehydrateWorkspace(options: {
|
||||
taskId: string;
|
||||
targetPath: string;
|
||||
}): Promise<void>;
|
||||
// (undocumented)
|
||||
retryTask?(options: { secrets?: TaskSecrets; taskId: string }): Promise<void>;
|
||||
// (undocumented)
|
||||
saveTaskState(options: { taskId: string; state?: JsonObject }): Promise<void>;
|
||||
// (undocumented)
|
||||
serializeWorkspace(options: { path: string; taskId: string }): Promise<void>;
|
||||
// (undocumented)
|
||||
shutdownTask(options: TaskStoreShutDownTaskOptions): Promise<void>;
|
||||
}
|
||||
|
||||
// @public @deprecated
|
||||
export type DatabaseTaskStoreOptions = {
|
||||
database: DatabaseService | Knex;
|
||||
events?: EventsService;
|
||||
};
|
||||
|
||||
// @public
|
||||
const scaffolderPlugin: BackendFeature;
|
||||
export default scaffolderPlugin;
|
||||
|
||||
// @public @deprecated
|
||||
export class TaskManager implements TaskContext {
|
||||
// (undocumented)
|
||||
get cancelSignal(): AbortSignal;
|
||||
// (undocumented)
|
||||
cleanWorkspace?(): Promise<void>;
|
||||
// (undocumented)
|
||||
complete(result: TaskCompletionState, metadata?: JsonObject): Promise<void>;
|
||||
// (undocumented)
|
||||
static create(
|
||||
task: CurrentClaimedTask,
|
||||
storage: TaskStore,
|
||||
abortSignal: AbortSignal,
|
||||
logger: LoggerService,
|
||||
auth?: AuthService,
|
||||
config?: Config,
|
||||
additionalWorkspaceProviders?: Record<string, WorkspaceProvider>,
|
||||
): TaskManager;
|
||||
// (undocumented)
|
||||
get createdBy(): string | undefined;
|
||||
// (undocumented)
|
||||
get done(): boolean;
|
||||
// (undocumented)
|
||||
emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
|
||||
// (undocumented)
|
||||
getInitiatorCredentials(): Promise<BackstageCredentials>;
|
||||
// (undocumented)
|
||||
getTaskState?(): Promise<
|
||||
| {
|
||||
state?: JsonObject;
|
||||
}
|
||||
| undefined
|
||||
>;
|
||||
// (undocumented)
|
||||
getWorkspaceName(): Promise<string>;
|
||||
// (undocumented)
|
||||
rehydrateWorkspace?(options: {
|
||||
taskId: string;
|
||||
targetPath: string;
|
||||
}): Promise<void>;
|
||||
// (undocumented)
|
||||
get secrets(): TaskSecrets | undefined;
|
||||
// (undocumented)
|
||||
serializeWorkspace?(options: { path: string }): Promise<void>;
|
||||
// (undocumented)
|
||||
get spec(): TaskSpecV1beta3;
|
||||
// (undocumented)
|
||||
get taskId(): string;
|
||||
// (undocumented)
|
||||
updateCheckpoint?(options: UpdateTaskCheckpointOptions): Promise<void>;
|
||||
}
|
||||
|
||||
// @public @deprecated
|
||||
export interface TaskStore {
|
||||
// (undocumented)
|
||||
cancelTask?(options: TaskStoreEmitOptions): Promise<void>;
|
||||
// (undocumented)
|
||||
claimTask(): Promise<SerializedTask | undefined>;
|
||||
// (undocumented)
|
||||
cleanWorkspace?({ taskId }: { taskId: string }): Promise<void>;
|
||||
// (undocumented)
|
||||
completeTask(options: {
|
||||
taskId: string;
|
||||
status: TaskStatus;
|
||||
eventBody: JsonObject;
|
||||
}): Promise<void>;
|
||||
// (undocumented)
|
||||
createTask(
|
||||
options: TaskStoreCreateTaskOptions,
|
||||
): Promise<TaskStoreCreateTaskResult>;
|
||||
// (undocumented)
|
||||
emitLogEvent(options: TaskStoreEmitOptions): Promise<void>;
|
||||
// (undocumented)
|
||||
getTask(taskId: string): Promise<SerializedTask>;
|
||||
// (undocumented)
|
||||
getTaskState?({ taskId }: { taskId: string }): Promise<
|
||||
| {
|
||||
state: JsonObject;
|
||||
}
|
||||
| undefined
|
||||
>;
|
||||
// (undocumented)
|
||||
heartbeatTask(taskId: string): Promise<void>;
|
||||
// (undocumented)
|
||||
list?(options: {
|
||||
filters?: {
|
||||
createdBy?: string | string[];
|
||||
status?: TaskStatus | TaskStatus[];
|
||||
};
|
||||
pagination?: {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
};
|
||||
permissionFilters?: PermissionCriteria<TaskFilters>;
|
||||
order?: {
|
||||
order: 'asc' | 'desc';
|
||||
field: string;
|
||||
}[];
|
||||
}): Promise<{
|
||||
tasks: SerializedTask[];
|
||||
totalTasks?: number;
|
||||
}>;
|
||||
// @deprecated (undocumented)
|
||||
list?(options: {
|
||||
createdBy?: string;
|
||||
status?: TaskStatus;
|
||||
filters?: {
|
||||
createdBy?: string | string[];
|
||||
status?: TaskStatus | TaskStatus[];
|
||||
};
|
||||
pagination?: {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
};
|
||||
order?: {
|
||||
order: 'asc' | 'desc';
|
||||
field: string;
|
||||
}[];
|
||||
}): Promise<{
|
||||
tasks: SerializedTask[];
|
||||
totalTasks?: number;
|
||||
}>;
|
||||
// (undocumented)
|
||||
listEvents(options: TaskStoreListEventsOptions): Promise<{
|
||||
events: SerializedTaskEvent[];
|
||||
}>;
|
||||
// (undocumented)
|
||||
listStaleTasks(options: { timeoutS: number }): Promise<{
|
||||
tasks: {
|
||||
taskId: string;
|
||||
}[];
|
||||
}>;
|
||||
// (undocumented)
|
||||
recoverTasks?(options: TaskStoreRecoverTaskOptions): Promise<{
|
||||
ids: string[];
|
||||
}>;
|
||||
// (undocumented)
|
||||
rehydrateWorkspace?(options: {
|
||||
taskId: string;
|
||||
targetPath: string;
|
||||
}): Promise<void>;
|
||||
// (undocumented)
|
||||
retryTask?(options: { secrets?: TaskSecrets; taskId: string }): Promise<void>;
|
||||
// (undocumented)
|
||||
saveTaskState?(options: {
|
||||
taskId: string;
|
||||
state?: JsonObject;
|
||||
}): Promise<void>;
|
||||
// (undocumented)
|
||||
serializeWorkspace?({
|
||||
path,
|
||||
taskId,
|
||||
}: {
|
||||
path: string;
|
||||
taskId: string;
|
||||
}): Promise<void>;
|
||||
// (undocumented)
|
||||
shutdownTask?(options: TaskStoreShutDownTaskOptions): Promise<void>;
|
||||
}
|
||||
|
||||
// @public @deprecated
|
||||
export type TaskStoreCreateTaskOptions = {
|
||||
spec: TaskSpec;
|
||||
createdBy?: string;
|
||||
secrets?: TaskSecrets;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
export type TaskStoreCreateTaskResult = {
|
||||
taskId: string;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
export type TaskStoreEmitOptions<TBody = JsonObject> = {
|
||||
taskId: string;
|
||||
body: TBody;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
export type TaskStoreListEventsOptions = {
|
||||
isTaskRecoverable?: boolean;
|
||||
taskId: string;
|
||||
after?: number | undefined;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
export type TaskStoreRecoverTaskOptions = {
|
||||
timeout: HumanDuration;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
export type TaskStoreShutDownTaskOptions = {
|
||||
taskId: string;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
export class TaskWorker {
|
||||
// (undocumented)
|
||||
static create(options: CreateWorkerOptions): Promise<TaskWorker>;
|
||||
// (undocumented)
|
||||
protected onReadyToClaimTask(): Promise<void>;
|
||||
// (undocumented)
|
||||
recoverTasks(): Promise<void>;
|
||||
// (undocumented)
|
||||
runOneTask(task: TaskContext): Promise<void>;
|
||||
// (undocumented)
|
||||
start(): void;
|
||||
// (undocumented)
|
||||
stop(): Promise<void>;
|
||||
}
|
||||
|
||||
// @public @deprecated
|
||||
export class TemplateActionRegistry {
|
||||
// (undocumented)
|
||||
get(actionId: string): TemplateAction<any, any, any>;
|
||||
// (undocumented)
|
||||
list(): TemplateAction<any, any, any>[];
|
||||
// (undocumented)
|
||||
register(action: TemplateAction<any, any, any>): void;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export type TemplatePermissionRuleInput<
|
||||
TParams extends PermissionRuleParams = PermissionRuleParams,
|
||||
|
||||
@@ -21,7 +21,11 @@ import {
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { catalogServiceRef } from '@backstage/plugin-catalog-node';
|
||||
import { eventsServiceRef } from '@backstage/plugin-events-node';
|
||||
import { TaskBroker, TemplateAction } from '@backstage/plugin-scaffolder-node';
|
||||
import {
|
||||
scaffolderActionsExtensionPoint,
|
||||
TaskBroker,
|
||||
TemplateAction,
|
||||
} from '@backstage/plugin-scaffolder-node';
|
||||
import {
|
||||
AutocompleteHandler,
|
||||
CreatedTemplateFilter,
|
||||
@@ -29,7 +33,6 @@ import {
|
||||
createTemplateFilter,
|
||||
createTemplateGlobalFunction,
|
||||
createTemplateGlobalValue,
|
||||
scaffolderActionsExtensionPoint,
|
||||
scaffolderAutocompleteExtensionPoint,
|
||||
scaffolderTaskBrokerExtensionPoint,
|
||||
scaffolderTemplatingExtensionPoint,
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
*/
|
||||
|
||||
export { scaffolderPlugin as default } from './ScaffolderPlugin';
|
||||
export * from './scaffolder';
|
||||
|
||||
export * from './scaffolder/actions/builtin';
|
||||
|
||||
export {
|
||||
type TemplatePermissionRuleInput,
|
||||
type ActionPermissionRuleInput,
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
|
||||
import { ConflictError, NotFoundError } from '@backstage/errors';
|
||||
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
|
||||
|
||||
/**
|
||||
* Registry of all registered template actions.
|
||||
* @public
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
*/
|
||||
export class TemplateActionRegistry {
|
||||
private readonly actions = new Map<string, TemplateAction>();
|
||||
|
||||
@@ -85,8 +85,6 @@ export type RawDbTaskEventRow = {
|
||||
|
||||
/**
|
||||
* DatabaseTaskStore
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
* @public
|
||||
*/
|
||||
export type DatabaseTaskStoreOptions = {
|
||||
database: DatabaseService | Knex;
|
||||
@@ -118,8 +116,6 @@ const parseSqlDateToIsoString = <T>(input: T): T | string => {
|
||||
|
||||
/**
|
||||
* DatabaseTaskStore
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
* @public
|
||||
*/
|
||||
export class DatabaseTaskStore implements TaskStore {
|
||||
private readonly db: Knex;
|
||||
@@ -723,7 +719,7 @@ export class DatabaseTaskStore implements TaskStore {
|
||||
});
|
||||
}
|
||||
|
||||
async retryTask?(options: {
|
||||
async retryTask(options: {
|
||||
secrets?: TaskSecrets;
|
||||
taskId: string;
|
||||
}): Promise<void> {
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
SecureTemplater,
|
||||
SecureTemplateRenderer,
|
||||
} from '../../lib/templating/SecureTemplater';
|
||||
import { TemplateActionRegistry } from '../actions';
|
||||
import { TemplateActionRegistry } from '../actions/TemplateActionRegistry';
|
||||
import { generateExampleOutput, isTruthy } from './helper';
|
||||
import { TaskTrackType, WorkflowResponse, WorkflowRunner } from './types';
|
||||
|
||||
|
||||
@@ -50,8 +50,6 @@ type TaskState = {
|
||||
};
|
||||
/**
|
||||
* TaskManager
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
* @public
|
||||
*/
|
||||
export class TaskManager implements TaskContext {
|
||||
private isDone = false;
|
||||
@@ -488,7 +486,7 @@ export class StorageTaskBroker implements TaskBroker {
|
||||
});
|
||||
}
|
||||
|
||||
async retry?(options: {
|
||||
async retry(options: {
|
||||
secrets?: TaskSecrets;
|
||||
taskId: string;
|
||||
}): Promise<void> {
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
TemplateGlobal,
|
||||
} from '@backstage/plugin-scaffolder-node';
|
||||
import PQueue from 'p-queue';
|
||||
import { TemplateActionRegistry } from '../actions';
|
||||
import { TemplateActionRegistry } from '../actions/TemplateActionRegistry';
|
||||
import { NunjucksWorkflowRunner } from './NunjucksWorkflowRunner';
|
||||
import { WorkflowRunner } from './types';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
@@ -36,8 +36,6 @@ const DEFAULT_TASK_PARAMETER_MAX_LENGTH = 256;
|
||||
|
||||
/**
|
||||
* TaskWorkerOptions
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
* @public
|
||||
*/
|
||||
export type TaskWorkerOptions = {
|
||||
taskBroker: TaskBroker;
|
||||
@@ -54,8 +52,6 @@ export type TaskWorkerOptions = {
|
||||
|
||||
/**
|
||||
* CreateWorkerOptions
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
* @public
|
||||
*/
|
||||
export type CreateWorkerOptions = {
|
||||
taskBroker: TaskBroker;
|
||||
@@ -86,8 +82,6 @@ export type CreateWorkerOptions = {
|
||||
|
||||
/**
|
||||
* TaskWorker
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
* @public
|
||||
*/
|
||||
export class TaskWorker {
|
||||
private taskQueue: PQueue;
|
||||
|
||||
@@ -30,8 +30,6 @@ import { PermissionCriteria } from '@backstage/plugin-permission-common';
|
||||
/**
|
||||
* TaskStoreEmitOptions
|
||||
*
|
||||
* @public
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
*/
|
||||
export type TaskStoreEmitOptions<TBody = JsonObject> = {
|
||||
taskId: string;
|
||||
@@ -41,8 +39,6 @@ export type TaskStoreEmitOptions<TBody = JsonObject> = {
|
||||
/**
|
||||
* TaskStoreListEventsOptions
|
||||
*
|
||||
* @public
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
*/
|
||||
export type TaskStoreListEventsOptions = {
|
||||
isTaskRecoverable?: boolean;
|
||||
@@ -53,8 +49,6 @@ export type TaskStoreListEventsOptions = {
|
||||
/**
|
||||
* TaskStoreShutDownTaskOptions
|
||||
*
|
||||
* @public
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
*/
|
||||
export type TaskStoreShutDownTaskOptions = {
|
||||
taskId: string;
|
||||
@@ -62,8 +56,6 @@ export type TaskStoreShutDownTaskOptions = {
|
||||
|
||||
/**
|
||||
* The options passed to {@link TaskStore.createTask}
|
||||
* @public
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
*/
|
||||
export type TaskStoreCreateTaskOptions = {
|
||||
spec: TaskSpec;
|
||||
@@ -73,8 +65,6 @@ export type TaskStoreCreateTaskOptions = {
|
||||
|
||||
/**
|
||||
* The options passed to {@link TaskStore.recoverTasks}
|
||||
* @public
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
*/
|
||||
export type TaskStoreRecoverTaskOptions = {
|
||||
timeout: HumanDuration;
|
||||
@@ -82,8 +72,6 @@ export type TaskStoreRecoverTaskOptions = {
|
||||
|
||||
/**
|
||||
* The response from {@link TaskStore.createTask}
|
||||
* @public
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
*/
|
||||
export type TaskStoreCreateTaskResult = {
|
||||
taskId: string;
|
||||
@@ -92,19 +80,17 @@ export type TaskStoreCreateTaskResult = {
|
||||
/**
|
||||
* TaskStore
|
||||
*
|
||||
* @public
|
||||
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
||||
*/
|
||||
export interface TaskStore {
|
||||
cancelTask?(options: TaskStoreEmitOptions): Promise<void>;
|
||||
cancelTask(options: TaskStoreEmitOptions): Promise<void>;
|
||||
|
||||
createTask(
|
||||
options: TaskStoreCreateTaskOptions,
|
||||
): Promise<TaskStoreCreateTaskResult>;
|
||||
|
||||
retryTask?(options: { secrets?: TaskSecrets; taskId: string }): Promise<void>;
|
||||
retryTask(options: { secrets?: TaskSecrets; taskId: string }): Promise<void>;
|
||||
|
||||
recoverTasks?(
|
||||
recoverTasks(
|
||||
options: TaskStoreRecoverTaskOptions,
|
||||
): Promise<{ ids: string[] }>;
|
||||
|
||||
@@ -137,51 +123,31 @@ export interface TaskStore {
|
||||
order?: { order: 'asc' | 'desc'; field: string }[];
|
||||
}): Promise<{ tasks: SerializedTask[]; totalTasks?: number }>;
|
||||
|
||||
/**
|
||||
* @deprecated Make sure to pass `createdBy` and `status` in the `filters` parameter instead
|
||||
*/
|
||||
list?(options: {
|
||||
createdBy?: string;
|
||||
status?: TaskStatus;
|
||||
filters?: {
|
||||
createdBy?: string | string[];
|
||||
status?: TaskStatus | TaskStatus[];
|
||||
};
|
||||
pagination?: {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
};
|
||||
order?: { order: 'asc' | 'desc'; field: string }[];
|
||||
}): Promise<{ tasks: SerializedTask[]; totalTasks?: number }>;
|
||||
|
||||
emitLogEvent(options: TaskStoreEmitOptions): Promise<void>;
|
||||
|
||||
getTaskState?({ taskId }: { taskId: string }): Promise<
|
||||
getTaskState({ taskId }: { taskId: string }): Promise<
|
||||
| {
|
||||
state: JsonObject;
|
||||
}
|
||||
| undefined
|
||||
>;
|
||||
|
||||
saveTaskState?(options: {
|
||||
taskId: string;
|
||||
state?: JsonObject;
|
||||
}): Promise<void>;
|
||||
saveTaskState(options: { taskId: string; state?: JsonObject }): Promise<void>;
|
||||
|
||||
listEvents(
|
||||
options: TaskStoreListEventsOptions,
|
||||
): Promise<{ events: SerializedTaskEvent[] }>;
|
||||
|
||||
shutdownTask?(options: TaskStoreShutDownTaskOptions): Promise<void>;
|
||||
shutdownTask(options: TaskStoreShutDownTaskOptions): Promise<void>;
|
||||
|
||||
rehydrateWorkspace?(options: {
|
||||
taskId: string;
|
||||
targetPath: string;
|
||||
}): Promise<void>;
|
||||
|
||||
cleanWorkspace?({ taskId }: { taskId: string }): Promise<void>;
|
||||
cleanWorkspace({ taskId }: { taskId: string }): Promise<void>;
|
||||
|
||||
serializeWorkspace?({
|
||||
serializeWorkspace({
|
||||
path,
|
||||
taskId,
|
||||
}: {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { TaskBroker } from '@backstage/plugin-scaffolder-node';
|
||||
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
|
||||
import { TemplateFilter as TemplateFilter_2 } from '@backstage/plugin-scaffolder-node';
|
||||
import { TemplateGlobal as TemplateGlobal_2 } from '@backstage/plugin-scaffolder-node';
|
||||
import { z } from 'zod';
|
||||
@@ -123,15 +122,6 @@ export const restoreWorkspace: (opts: {
|
||||
buffer?: Buffer;
|
||||
}) => Promise<void>;
|
||||
|
||||
// @alpha
|
||||
export interface ScaffolderActionsExtensionPoint {
|
||||
// (undocumented)
|
||||
addActions(...actions: TemplateAction<any, any, any>[]): void;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export const scaffolderActionsExtensionPoint: ExtensionPoint<ScaffolderActionsExtensionPoint>;
|
||||
|
||||
// @alpha
|
||||
export interface ScaffolderAutocompleteExtensionPoint {
|
||||
// (undocumented)
|
||||
@@ -147,13 +137,13 @@ export interface ScaffolderAutocompleteExtensionPoint {
|
||||
// @alpha
|
||||
export const scaffolderAutocompleteExtensionPoint: ExtensionPoint<ScaffolderAutocompleteExtensionPoint>;
|
||||
|
||||
// @alpha
|
||||
// @alpha @deprecated
|
||||
export interface ScaffolderTaskBrokerExtensionPoint {
|
||||
// (undocumented)
|
||||
setTaskBroker(taskBroker: TaskBroker): void;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
// @alpha @deprecated
|
||||
export const scaffolderTaskBrokerExtensionPoint: ExtensionPoint<ScaffolderTaskBrokerExtensionPoint>;
|
||||
|
||||
// @alpha
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { BackstageCredentials } from '@backstage/backend-plugin-api';
|
||||
import { CheckpointContext } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
import { Expand } from '@backstage/types';
|
||||
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
@@ -306,6 +307,15 @@ export const parseRepoUrl: (
|
||||
project?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface ScaffolderActionsExtensionPoint {
|
||||
// (undocumented)
|
||||
addActions(...actions: TemplateAction<any, any, any>[]): void;
|
||||
}
|
||||
|
||||
// @public
|
||||
export const scaffolderActionsExtensionPoint: ExtensionPoint<ScaffolderActionsExtensionPoint>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface SerializedFile {
|
||||
// (undocumented)
|
||||
@@ -327,7 +337,7 @@ export function serializeDirectoryContents(
|
||||
},
|
||||
): Promise<SerializedFile[]>;
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type SerializedTask = {
|
||||
id: string;
|
||||
spec: TaskSpec;
|
||||
@@ -339,7 +349,7 @@ export type SerializedTask = {
|
||||
state?: JsonObject;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type SerializedTaskEvent = {
|
||||
id: number;
|
||||
isTaskRecoverable?: boolean;
|
||||
@@ -353,10 +363,10 @@ export type SerializedTaskEvent = {
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export interface TaskBroker {
|
||||
// (undocumented)
|
||||
cancel?(taskId: string): Promise<void>;
|
||||
cancel(taskId: string): Promise<void>;
|
||||
// (undocumented)
|
||||
claim(): Promise<TaskContext>;
|
||||
// (undocumented)
|
||||
@@ -370,7 +380,7 @@ export interface TaskBroker {
|
||||
// (undocumented)
|
||||
get(taskId: string): Promise<SerializedTask>;
|
||||
// (undocumented)
|
||||
list?(options?: {
|
||||
list(options?: {
|
||||
filters?: {
|
||||
createdBy?: string | string[];
|
||||
status?: TaskStatus | TaskStatus[];
|
||||
@@ -388,35 +398,30 @@ export interface TaskBroker {
|
||||
tasks: SerializedTask[];
|
||||
totalTasks?: number;
|
||||
}>;
|
||||
// @deprecated (undocumented)
|
||||
list?(options: { createdBy?: string; status?: TaskStatus }): Promise<{
|
||||
tasks: SerializedTask[];
|
||||
totalTasks?: number;
|
||||
}>;
|
||||
// (undocumented)
|
||||
recoverTasks?(): Promise<void>;
|
||||
recoverTasks(): Promise<void>;
|
||||
// (undocumented)
|
||||
retry?(options: { secrets?: TaskSecrets; taskId: string }): Promise<void>;
|
||||
retry(options: { secrets?: TaskSecrets; taskId: string }): Promise<void>;
|
||||
// (undocumented)
|
||||
vacuumTasks(options: { timeoutS: number }): Promise<void>;
|
||||
}
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type TaskBrokerDispatchOptions = {
|
||||
spec: TaskSpec;
|
||||
secrets?: TaskSecrets;
|
||||
createdBy?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type TaskBrokerDispatchResult = {
|
||||
taskId: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type TaskCompletionState = 'failed' | 'completed';
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export interface TaskContext {
|
||||
// (undocumented)
|
||||
cancelSignal: AbortSignal;
|
||||
@@ -460,16 +465,16 @@ export interface TaskContext {
|
||||
updateCheckpoint?(options: UpdateTaskCheckpointOptions): Promise<void>;
|
||||
}
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type TaskEventType = 'completion' | 'log' | 'cancelled' | 'recovered';
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type TaskFilter = {
|
||||
key: string;
|
||||
values?: string[];
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type TaskFilters =
|
||||
| {
|
||||
anyOf: TaskFilter[];
|
||||
@@ -487,7 +492,7 @@ export type TaskSecrets = Record<string, string> & {
|
||||
backstageToken?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type TaskStatus =
|
||||
| 'cancelled'
|
||||
| 'completed'
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import { createExtensionPoint } from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
TaskBroker,
|
||||
TemplateAction,
|
||||
TemplateFilter,
|
||||
TemplateGlobal,
|
||||
} from '@backstage/plugin-scaffolder-node';
|
||||
@@ -30,29 +29,11 @@ export * from './globals';
|
||||
export * from './types';
|
||||
export * from './checkpoints';
|
||||
|
||||
/**
|
||||
* Extension point for managing scaffolder actions.
|
||||
*
|
||||
* @alpha
|
||||
*/
|
||||
export interface ScaffolderActionsExtensionPoint {
|
||||
addActions(...actions: TemplateAction<any, any, any>[]): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extension point for managing scaffolder actions.
|
||||
*
|
||||
* @alpha
|
||||
*/
|
||||
export const scaffolderActionsExtensionPoint =
|
||||
createExtensionPoint<ScaffolderActionsExtensionPoint>({
|
||||
id: 'scaffolder.actions',
|
||||
});
|
||||
|
||||
/**
|
||||
* Extension point for replacing the scaffolder task broker.
|
||||
*
|
||||
* @alpha
|
||||
* @deprecated this extension point is planned to be removed, please reach out to us in an issue if you're using this extension point and your use cases.
|
||||
*/
|
||||
export interface ScaffolderTaskBrokerExtensionPoint {
|
||||
setTaskBroker(taskBroker: TaskBroker): void;
|
||||
@@ -62,6 +43,7 @@ export interface ScaffolderTaskBrokerExtensionPoint {
|
||||
* Extension point for replacing the scaffolder task broker.
|
||||
*
|
||||
* @alpha
|
||||
* @deprecated this extension point is planned to be removed, please reach out to us in an issue if you're using this extension point and your use cases.
|
||||
*/
|
||||
export const scaffolderTaskBrokerExtensionPoint =
|
||||
createExtensionPoint<ScaffolderTaskBrokerExtensionPoint>({
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2025 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { createExtensionPoint } from '@backstage/backend-plugin-api';
|
||||
import { TemplateAction } from './actions';
|
||||
|
||||
/**
|
||||
* Extension point for managing scaffolder actions.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface ScaffolderActionsExtensionPoint {
|
||||
addActions(...actions: TemplateAction<any, any, any>[]): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extension point for managing scaffolder actions.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const scaffolderActionsExtensionPoint =
|
||||
createExtensionPoint<ScaffolderActionsExtensionPoint>({
|
||||
id: 'scaffolder.actions',
|
||||
});
|
||||
@@ -24,3 +24,4 @@ export * from './actions';
|
||||
export * from './tasks';
|
||||
export * from './files';
|
||||
export * from './types';
|
||||
export * from './extensions';
|
||||
|
||||
@@ -33,6 +33,8 @@ export type TaskSecrets = Record<string, string> & {
|
||||
* The status of each step of the Task
|
||||
*
|
||||
* @public
|
||||
* @deprecated this type is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this type and your use cases.
|
||||
*/
|
||||
export type TaskStatus =
|
||||
| 'cancelled'
|
||||
@@ -46,6 +48,8 @@ export type TaskStatus =
|
||||
* The state of a completed task.
|
||||
*
|
||||
* @public
|
||||
* @deprecated this interface is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this interface and your use cases.
|
||||
*/
|
||||
export type TaskCompletionState = 'failed' | 'completed';
|
||||
|
||||
@@ -53,6 +57,8 @@ export type TaskCompletionState = 'failed' | 'completed';
|
||||
* SerializedTask
|
||||
*
|
||||
* @public
|
||||
* @deprecated this type is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this type and your use cases.
|
||||
*/
|
||||
export type SerializedTask = {
|
||||
id: string;
|
||||
@@ -69,6 +75,8 @@ export type SerializedTask = {
|
||||
* TaskEventType
|
||||
*
|
||||
* @public
|
||||
* @deprecated this type is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this type and your use cases.
|
||||
*/
|
||||
export type TaskEventType = 'completion' | 'log' | 'cancelled' | 'recovered';
|
||||
|
||||
@@ -76,6 +84,8 @@ export type TaskEventType = 'completion' | 'log' | 'cancelled' | 'recovered';
|
||||
* SerializedTaskEvent
|
||||
*
|
||||
* @public
|
||||
* @deprecated this type is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this type and your use cases.
|
||||
*/
|
||||
export type SerializedTaskEvent = {
|
||||
id: number;
|
||||
@@ -94,6 +104,8 @@ export type SerializedTaskEvent = {
|
||||
* The result of {@link TaskBroker.dispatch}
|
||||
*
|
||||
* @public
|
||||
* @deprecated this interface is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this interface and your use cases.
|
||||
*/
|
||||
export type TaskBrokerDispatchResult = {
|
||||
taskId: string;
|
||||
@@ -104,6 +116,8 @@ export type TaskBrokerDispatchResult = {
|
||||
* Currently a spec and optional secrets
|
||||
*
|
||||
* @public
|
||||
* @deprecated this interface is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this interface and your use cases.
|
||||
*/
|
||||
export type TaskBrokerDispatchOptions = {
|
||||
spec: TaskSpec;
|
||||
@@ -114,6 +128,8 @@ export type TaskBrokerDispatchOptions = {
|
||||
/**
|
||||
* TaskFilter
|
||||
* @public
|
||||
* @deprecated this type is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this type and your use cases.
|
||||
*/
|
||||
export type TaskFilter = {
|
||||
key: string;
|
||||
@@ -123,6 +139,8 @@ export type TaskFilter = {
|
||||
/**
|
||||
* TaskFilters
|
||||
* @public
|
||||
* @deprecated this type is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this type and your use cases.
|
||||
*/
|
||||
export type TaskFilters =
|
||||
| { anyOf: TaskFilter[] }
|
||||
@@ -131,9 +149,12 @@ export type TaskFilters =
|
||||
| TaskFilter;
|
||||
|
||||
/**
|
||||
* Task
|
||||
* TaskContext
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @deprecated this interface is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this interface and your use cases.
|
||||
*/
|
||||
export interface TaskContext {
|
||||
taskId?: string;
|
||||
@@ -175,15 +196,17 @@ export interface TaskContext {
|
||||
* TaskBroker
|
||||
*
|
||||
* @public
|
||||
* @deprecated this interface is planned to be removed.
|
||||
* Please reach out to us in an issue if you're using this interface and your use cases.
|
||||
*/
|
||||
export interface TaskBroker {
|
||||
cancel?(taskId: string): Promise<void>;
|
||||
cancel(taskId: string): Promise<void>;
|
||||
|
||||
retry?(options: { secrets?: TaskSecrets; taskId: string }): Promise<void>;
|
||||
retry(options: { secrets?: TaskSecrets; taskId: string }): Promise<void>;
|
||||
|
||||
claim(): Promise<TaskContext>;
|
||||
|
||||
recoverTasks?(): Promise<void>;
|
||||
recoverTasks(): Promise<void>;
|
||||
|
||||
dispatch(
|
||||
options: TaskBrokerDispatchOptions,
|
||||
@@ -198,7 +221,7 @@ export interface TaskBroker {
|
||||
|
||||
get(taskId: string): Promise<SerializedTask>;
|
||||
|
||||
list?(options?: {
|
||||
list(options?: {
|
||||
filters?: {
|
||||
createdBy?: string | string[];
|
||||
status?: TaskStatus | TaskStatus[];
|
||||
@@ -210,12 +233,4 @@ export interface TaskBroker {
|
||||
order?: { order: 'asc' | 'desc'; field: string }[];
|
||||
permissionFilters?: PermissionCriteria<TaskFilters>;
|
||||
}): Promise<{ tasks: SerializedTask[]; totalTasks?: number }>;
|
||||
|
||||
/**
|
||||
* @deprecated Make sure to pass `createdBy` and `status` in the `filters` parameter instead
|
||||
*/
|
||||
list?(options: {
|
||||
createdBy?: string;
|
||||
status?: TaskStatus;
|
||||
}): Promise<{ tasks: SerializedTask[]; totalTasks?: number }>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user