Add controller repo to VariantAnalysis type
This adds the `controllerRepo` field to the `VariantAnalysis` shared type. This is technically a breaking change since the old history won't have this field and all calls on this will fail. However, the feature is not available so this should be fine.
This commit is contained in:
@@ -3,7 +3,7 @@ import { AnalysisAlert, AnalysisRawResults } from './analysis-result';
|
||||
|
||||
export interface VariantAnalysis {
|
||||
id: number,
|
||||
controllerRepoId: number,
|
||||
controllerRepo: Repository;
|
||||
query: {
|
||||
name: string,
|
||||
filePath: string,
|
||||
|
||||
@@ -51,7 +51,7 @@ export class VariantAnalysisMonitor extends DisposableObject {
|
||||
|
||||
variantAnalysisSummary = await ghApiClient.getVariantAnalysis(
|
||||
credentials,
|
||||
variantAnalysis.controllerRepoId,
|
||||
variantAnalysis.controllerRepo.id,
|
||||
variantAnalysis.id
|
||||
);
|
||||
|
||||
|
||||
@@ -52,7 +52,11 @@ export function processUpdatedVariantAnalysis(
|
||||
|
||||
const variantAnalysis: VariantAnalysis = {
|
||||
id: response.id,
|
||||
controllerRepoId: response.controller_repo.id,
|
||||
controllerRepo: {
|
||||
id: response.controller_repo.id,
|
||||
fullName: response.controller_repo.full_name,
|
||||
private: response.controller_repo.private,
|
||||
},
|
||||
query: previousVariantAnalysis.query,
|
||||
databases: previousVariantAnalysis.databases,
|
||||
executionStartTime: previousVariantAnalysis.executionStartTime,
|
||||
|
||||
@@ -24,7 +24,11 @@ const Template: ComponentStory<typeof VariantAnalysisComponent> = (args) => (
|
||||
|
||||
const variantAnalysis: VariantAnalysisDomainModel = {
|
||||
id: 1,
|
||||
controllerRepoId: 1,
|
||||
controllerRepo: {
|
||||
id: 1,
|
||||
fullName: 'octodemo/variant-analysis-controller',
|
||||
private: false,
|
||||
},
|
||||
actionsWorkflowRunId: 789263,
|
||||
query: {
|
||||
name: 'Example query',
|
||||
|
||||
@@ -37,7 +37,11 @@ export const Example = Template.bind({});
|
||||
Example.args = {
|
||||
variantAnalysis: {
|
||||
id: 1,
|
||||
controllerRepoId: 1,
|
||||
controllerRepo: {
|
||||
id: 1,
|
||||
fullName: 'octodemo/variant-analysis-controller',
|
||||
private: false,
|
||||
},
|
||||
query: {
|
||||
name: 'Query name',
|
||||
filePath: 'example.ql',
|
||||
|
||||
@@ -68,7 +68,11 @@ const Template: ComponentStory<typeof VariantAnalysisHeader> = (args) => (
|
||||
|
||||
const buildVariantAnalysis = (data: Partial<VariantAnalysis>) => ({
|
||||
id: 1,
|
||||
controllerRepoId: 1,
|
||||
controllerRepo: {
|
||||
id: 1,
|
||||
fullName: 'octodemo/variant-analysis-controller',
|
||||
private: false,
|
||||
},
|
||||
query: {
|
||||
name: 'Query name',
|
||||
filePath: 'example.ql',
|
||||
|
||||
@@ -30,7 +30,11 @@ const Template: ComponentStory<typeof VariantAnalysisOutcomePanels> = (args) =>
|
||||
|
||||
const buildVariantAnalysis = (data: Partial<VariantAnalysis>) => ({
|
||||
id: 1,
|
||||
controllerRepoId: 1,
|
||||
controllerRepo: {
|
||||
id: 1,
|
||||
fullName: 'octodemo/variant-analysis-controller',
|
||||
private: false,
|
||||
},
|
||||
query: {
|
||||
name: 'Query name',
|
||||
filePath: 'example.ql',
|
||||
|
||||
@@ -11,7 +11,11 @@ import { VariantAnalysisAnalyzedRepos, VariantAnalysisAnalyzedReposProps } from
|
||||
describe(VariantAnalysisAnalyzedRepos.name, () => {
|
||||
const defaultVariantAnalysis = {
|
||||
id: 1,
|
||||
controllerRepoId: 1,
|
||||
controllerRepo: {
|
||||
id: 1,
|
||||
fullName: 'octodemo/variant-analysis-controller',
|
||||
private: false,
|
||||
},
|
||||
actionsWorkflowRunId: 789263,
|
||||
query: {
|
||||
name: 'Example query',
|
||||
|
||||
@@ -10,7 +10,11 @@ import { VariantAnalysisOutcomePanelProps, VariantAnalysisOutcomePanels } from '
|
||||
describe(VariantAnalysisOutcomePanels.name, () => {
|
||||
const defaultVariantAnalysis = {
|
||||
id: 1,
|
||||
controllerRepoId: 1,
|
||||
controllerRepo: {
|
||||
id: 1,
|
||||
fullName: 'octodemo/variant-analysis-controller',
|
||||
private: false,
|
||||
},
|
||||
actionsWorkflowRunId: 789263,
|
||||
query: {
|
||||
name: 'Example query',
|
||||
|
||||
@@ -16,7 +16,13 @@ export function createMockVariantAnalysis(
|
||||
): VariantAnalysis {
|
||||
const variantAnalysis: VariantAnalysis = {
|
||||
id: faker.datatype.number(),
|
||||
controllerRepoId: faker.datatype.number(),
|
||||
controllerRepo: {
|
||||
id: faker.datatype.number(),
|
||||
fullName: 'github/' + faker.datatype.hexadecimal({
|
||||
prefix: '',
|
||||
}),
|
||||
private: faker.datatype.boolean(),
|
||||
},
|
||||
query: {
|
||||
name: 'a-query-name',
|
||||
filePath: 'a-query-file-path',
|
||||
|
||||
Reference in New Issue
Block a user