chore: fix up some types

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-09-28 04:56:34 +02:00
parent 154b86e1da
commit 5bdbb6caec
4 changed files with 9 additions and 10 deletions
@@ -364,9 +364,11 @@ describe('DefaultWorkflowRunner', () => {
const { output } = await runner.execute(task);
expect(output.foo.host).toEqual('github.com');
expect(output.foo.owner).toEqual('owner');
expect(output.foo.repo).toEqual('repo');
expect(output.foo).toEqual({
host: 'github.com',
owner: 'owner',
repo: 'repo',
});
});
});
});
@@ -91,7 +91,8 @@ export class DefaultWorkflowRunner implements WorkflowRunner {
// TODO(blam): let's work out how we can deprecate these.
// We shouln't really need to be exposing these now we can deal with
// objects in the params block
// objects in the params block.
// Maybe we can expose a new RepoUrlPicker with secrets for V3 that provides an object already.
this.nunjucks.addFilter('parseRepoUrl', repoUrl => {
return JSON.stringify(parseRepoUrl(repoUrl, this.options.integrations));
});
@@ -14,15 +14,11 @@
* limitations under the License.
*/
import os from 'os';
import { getVoidLogger, DatabaseManager } from '@backstage/backend-common';
import { ConfigReader, JsonObject } from '@backstage/config';
import { createTemplateAction, TemplateActionRegistry } from '../actions';
import { RepoSpec } from '../actions/builtin/publish/util';
import { ConfigReader } from '@backstage/config';
import { DatabaseTaskStore } from './DatabaseTaskStore';
import { StorageTaskBroker } from './StorageTaskBroker';
import { TaskWorker } from './TaskWorker';
import { ScmIntegrations } from '@backstage/integration';
import { WorkflowRunner } from './types';
import { LegacyWorkflowRunner } from './LegacyWorkflowRunner';
@@ -141,7 +141,7 @@ export interface TaskStore {
}: TaskStoreGetEventsOptions): Promise<{ events: DbTaskEventRow[] }>;
}
export type WorkflowResponse = { output: { [key: string]: JsonObject } };
export type WorkflowResponse = { output: { [key: string]: JsonValue } };
export interface WorkflowRunner {
execute(task: Task): Promise<WorkflowResponse>;
}