refactor to alpha exports

Signed-off-by: Kurt King <kurtaking@gmail.com>
This commit is contained in:
Kurt King
2025-05-10 12:07:47 -06:00
committed by benjdlambert
parent dbde1805b6
commit 04106ae76e
11 changed files with 33 additions and 30 deletions
@@ -50,7 +50,6 @@ import {
import { createConditionAuthorizer } from '@backstage/plugin-permission-node';
import { actionExecutePermission } from '@backstage/plugin-scaffolder-common/alpha';
import {
CheckpointContext,
TaskContext,
TemplateAction,
TemplateFilter,
@@ -61,7 +60,10 @@ import { scaffolderActionRules } from '../../service/rules';
import { createCounterMetric, createHistogramMetric } from '../../util/metrics';
import { BackstageLoggerTransport, WinstonLogger } from './logger';
import { convertFiltersToRecord } from '../../util/templating';
import { CheckpointState } from '@backstage/plugin-scaffolder-node';
import {
CheckpointState,
CheckpointContext,
} from '@backstage/plugin-scaffolder-node/alpha';
type NunjucksWorkflowRunnerOptions = {
workingDirectory: string;
@@ -23,7 +23,6 @@ import {
import { Config } from '@backstage/config';
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
import {
CheckpointState,
SerializedTask,
SerializedTaskEvent,
TaskBroker,
@@ -32,9 +31,12 @@ import {
TaskContext,
TaskSecrets,
TaskStatus,
UpdateTaskCheckpointOptions,
} from '@backstage/plugin-scaffolder-node';
import { WorkspaceProvider } from '@backstage/plugin-scaffolder-node/alpha';
import {
CheckpointState,
WorkspaceProvider,
UpdateTaskCheckpointOptions,
} from '@backstage/plugin-scaffolder-node/alpha';
import { JsonObject, Observable, createDeferred } from '@backstage/types';
import ObservableImpl from 'zen-observable';
import { DefaultWorkspaceService, WorkspaceService } from './WorkspaceService';
@@ -21,10 +21,8 @@ import {
mockServices,
} from '@backstage/backend-test-utils';
import { JsonObject, JsonValue } from '@backstage/types';
import {
ActionContext,
CheckpointContext,
} from '@backstage/plugin-scaffolder-node';
import { ActionContext } from '@backstage/plugin-scaffolder-node';
import { CheckpointContext } from '@backstage/plugin-scaffolder-node/alpha';
import { loggerToWinstonLogger } from './loggerToWinstonLogger';
/**
+1 -1
View File
@@ -23,7 +23,7 @@ import {
BackstageCredentials,
LoggerService,
} from '@backstage/backend-plugin-api';
import { CheckpointContext } from '../checkpoints';
import { CheckpointContext } from '../alpha';
/**
* ActionContext is passed into scaffolder actions.
@@ -1,5 +1,5 @@
/*
* Copyright 2024 The Backstage Authors
* 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.
@@ -13,5 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './types';
@@ -18,14 +18,14 @@ import { JsonValue } from '@backstage/types';
/**
* The status of a checkpoint, indicating whether it succeeded or failed.
*
* @public
* @alpha
*/
export type CheckpointStatus = 'failed' | 'success';
/**
* Represents a successful checkpoint state with a value.
*
* @public
* @alpha
*/
export type CheckpointSuccessState<T extends JsonValue = JsonValue> = {
status: 'success';
@@ -35,7 +35,7 @@ export type CheckpointSuccessState<T extends JsonValue = JsonValue> = {
/**
* Represents a failed checkpoint state with a reason for failure.
*
* @public
* @alpha
*/
export type CheckpointFailedState = {
status: 'failed';
@@ -45,7 +45,7 @@ export type CheckpointFailedState = {
/**
* Represents the union of all possible checkpoint state values.
*
* @public
* @alpha
*/
export type CheckpointStateValue =
| CheckpointSuccessState
@@ -54,7 +54,7 @@ export type CheckpointStateValue =
/**
* A map of checkpoint keys to their states.
*
* @public
* @alpha
*/
export type CheckpointState = {
[key: string]: CheckpointStateValue;
@@ -63,7 +63,7 @@ export type CheckpointState = {
/**
* Context for checkpoint function invocation.
*
* @public
* @alpha
*/
export type CheckpointContext<T extends JsonValue | void = JsonValue> = {
/**
@@ -28,6 +28,7 @@ export * from '../tasks/alpha';
export * from './filters';
export * from './globals';
export * from './types';
export * from './checkpoints';
/**
* Extension point for managing scaffolder actions.
-1
View File
@@ -24,4 +24,3 @@ export * from './actions';
export * from './tasks';
export * from './files';
export * from './types';
export * from './checkpoints';
@@ -1,3 +1,5 @@
import { CheckpointStateValue } from '../alpha';
/*
* Copyright 2024 The Backstage Authors
*
@@ -14,3 +16,12 @@
* limitations under the License.
*/
export * from './serializer';
/**
* Options for updating a checkpoint in a task.
*
* @alpha
*/
export type UpdateTaskCheckpointOptions = {
key: string;
} & CheckpointStateValue;
+1 -1
View File
@@ -25,5 +25,5 @@ export type {
TaskContext,
TaskEventType,
TaskStatus,
UpdateTaskCheckpointOptions,
// UpdateTaskCheckpointOptions,
} from './types';
+1 -10
View File
@@ -17,7 +17,7 @@
import { BackstageCredentials } from '@backstage/backend-plugin-api';
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
import { JsonObject, Observable } from '@backstage/types';
import { CheckpointStateValue } from '../checkpoints';
import { UpdateTaskCheckpointOptions } from '../alpha';
/**
* TaskSecrets
@@ -105,15 +105,6 @@ export type TaskBrokerDispatchOptions = {
createdBy?: string;
};
/**
* Options for updating a checkpoint in a task.
*
* @public
*/
export type UpdateTaskCheckpointOptions = {
key: string;
} & CheckpointStateValue;
/**
* Task
*