diff --git a/js_modules/ui-core/client.json b/js_modules/ui-core/client.json index b6945962cb92e..a85ed147fa7cb 100644 --- a/js_modules/ui-core/client.json +++ b/js_modules/ui-core/client.json @@ -108,7 +108,7 @@ "LatestRunTagQuery": "6b18755e69bb01ee63d4ef02333c219a8c935b087e938b5da89ca99b95824e60", "VersionNumberQuery": "1947790817d11313027a8addb9ceb992f0c79e96f3aa6b99cbece967e3458c40", "RepositoryLocationStatusQuery": "7129557ca993e0638a147e30c6fe3bdff04a929d4e6775c3e4e5dc9fa3c88d94", - "ReloadWorkspaceMutation": "763808cb236e2d60a426cd891a4f60efd6851a755345d4a3ef019549f35e0a5e", + "ReloadWorkspaceMutation": "278b658d1b59a3696426e5b5280590d28e8fed553533343ec97b764bc7f91d15", "ReloadRepositoryLocationMutation": "19f0c7c1764ac7327424133d498295b6417cb00ef06d88f30a458a7d33926e26", "UsedSolidDetailsQuery": "9f501125e94979298e2b290f5c8dac2fd8aa0e0d4a5d9f6dfde007186a707665", "OpsRootQuery": "a8ce0cedc4ebcc5ed0007d8795360ce5635ceefe1882802f88162b457f2058a4", diff --git a/js_modules/ui-core/src/graphql/builders.ts b/js_modules/ui-core/src/graphql/builders.ts index bad1803cc1771..8448f4696740f 100644 --- a/js_modules/ui-core/src/graphql/builders.ts +++ b/js_modules/ui-core/src/graphql/builders.ts @@ -4566,7 +4566,12 @@ type ReloadWorkspaceMutation = { Output: ReloadWorkspaceMutationResult; }; -type ReloadWorkspaceMutationResult = PythonError | UnauthorizedError | Workspace; +type ReloadWorkspaceMutationResult = PythonError | ReloadWorkspaceSuccess | UnauthorizedError; + +type ReloadWorkspaceSuccess = { + __typename: 'ReloadWorkspaceSuccess'; + success: Scalars['Boolean']['output']; +}; type ReportAssetCheckEvaluationResult = | PythonError @@ -14022,6 +14027,18 @@ export const buildReloadWorkspaceMutation = ( }; }; +export const buildReloadWorkspaceSuccess = ( + overrides?: Partial, + _relationshipsToOmit: Set = new Set(), +): {__typename: 'ReloadWorkspaceSuccess'} & ReloadWorkspaceSuccess => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ReloadWorkspaceSuccess'); + return { + __typename: 'ReloadWorkspaceSuccess', + success: overrides && overrides.hasOwnProperty('success') ? overrides.success! : true, + }; +}; + export const buildReportAssetCheckEvaluationsParams = ( overrides?: Partial, _relationshipsToOmit: Set = new Set(), diff --git a/js_modules/ui-core/src/graphql/possibleTypes.generated.json b/js_modules/ui-core/src/graphql/possibleTypes.generated.json index 58736930633dc..57c500e4cb3e1 100644 --- a/js_modules/ui-core/src/graphql/possibleTypes.generated.json +++ b/js_modules/ui-core/src/graphql/possibleTypes.generated.json @@ -1 +1 @@ -{"DisplayableEvent":["EngineEvent","ExecutionStepOutputEvent","ExpectationResult","FailureMetadata","HandledOutputEvent","LoadedInputEvent","ObjectStoreOperationResult","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","TypeCheck","FailedToMaterializeEvent","HealthChangedEvent"],"MarkerEvent":["EngineEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent"],"ErrorEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepUpForRetryEvent","HookErroredEvent","RunCanceledEvent","RunFailureEvent","ResourceInitFailureEvent"],"MessageEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepRestartEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","HandledOutputEvent","HookCompletedEvent","HookErroredEvent","HookSkippedEvent","LoadedInputEvent","LogMessageEvent","ObjectStoreOperationEvent","RunCanceledEvent","RunCancelingEvent","RunDequeuedEvent","RunEnqueuedEvent","RunFailureEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","RunStartEvent","RunStartingEvent","RunSuccessEvent","StepExpectationResultEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","AssetMaterializationPlannedEvent","FailedToMaterializeEvent","HealthChangedEvent","LogsCapturedEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"RunEvent":["RunCanceledEvent","RunCancelingEvent","RunDequeuedEvent","RunEnqueuedEvent","RunFailureEvent","RunStartEvent","RunStartingEvent","RunSuccessEvent","AssetMaterializationPlannedEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent"],"PipelineRunStepStats":["RunStepStats"],"StepEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepRestartEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","HandledOutputEvent","HookCompletedEvent","HookErroredEvent","HookSkippedEvent","LoadedInputEvent","ObjectStoreOperationEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepExpectationResultEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","FailedToMaterializeEvent","HealthChangedEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"AssetResultEventType":["FailedToMaterializeEvent","MaterializationEvent","ObservationEvent"],"PartitionKeysOrError":["PartitionKeys","PartitionSubsetDeserializationError"],"AutoMaterializeRuleEvaluationData":["TextRuleEvaluationData","ParentMaterializedRuleEvaluationData","WaitingOnKeysRuleEvaluationData"],"InternalFreshnessPolicy":["TimeWindowFreshnessPolicy","CronFreshnessPolicy"],"AssetOwner":["UserAssetOwner","TeamAssetOwner"],"AssetPartitionStatuses":["DefaultPartitionStatuses","MultiPartitionStatuses","TimePartitionStatuses"],"PartitionStatus1D":["TimePartitionStatuses","DefaultPartitionStatuses"],"AssetCheckOrError":["AssetCheck","AssetCheckNotFoundError","AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError"],"AssetCheckPartitionStatuses":["AssetCheckDefaultPartitionStatuses","AssetCheckMultiPartitionStatuses","AssetCheckTimePartitionStatuses"],"AssetCheckPartitionStatus1D":["AssetCheckTimePartitionStatuses","AssetCheckDefaultPartitionStatuses"],"AssetChecksOrError":["AssetChecks","AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError"],"Instigator":["Schedule","Sensor"],"AssetHealthMaterializationMeta":["AssetHealthMaterializationDegradedPartitionedMeta","AssetHealthMaterializationHealthyPartitionedMeta","AssetHealthMaterializationDegradedNotPartitionedMeta"],"AssetHealthCheckMeta":["AssetHealthCheckDegradedMeta","AssetHealthCheckWarningMeta","AssetHealthCheckUnknownMeta"],"EvaluationStackEntry":["EvaluationStackListItemEntry","EvaluationStackPathEntry","EvaluationStackMapKeyEntry","EvaluationStackMapValueEntry"],"IPipelineSnapshot":["Pipeline","PipelineSnapshot","Job"],"DefinitionOwner":["UserDefinitionOwner","TeamDefinitionOwner"],"PipelineConfigValidationError":["FieldNotDefinedConfigError","FieldsNotDefinedConfigError","MissingFieldConfigError","MissingFieldsConfigError","RuntimeMismatchConfigError","SelectorTypeConfigError"],"PipelineConfigValidationInvalid":["RunConfigValidationInvalid"],"PipelineConfigValidationResult":["InvalidSubsetError","PipelineConfigValidationValid","RunConfigValidationInvalid","PipelineNotFoundError","PythonError"],"PipelineReference":["PipelineSnapshot","UnknownPipeline"],"PipelineRun":["Run"],"DagsterRunEvent":["ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","ExecutionStepRestartEvent","HealthChangedEvent","LogMessageEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","RunFailureEvent","RunStartEvent","RunEnqueuedEvent","RunDequeuedEvent","RunStartingEvent","RunCancelingEvent","RunCanceledEvent","RunSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","HandledOutputEvent","LoadedInputEvent","LogsCapturedEvent","ObjectStoreOperationEvent","StepExpectationResultEvent","MaterializationEvent","ObservationEvent","FailedToMaterializeEvent","EngineEvent","HookCompletedEvent","HookSkippedEvent","HookErroredEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent","AssetMaterializationPlannedEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"PipelineRunLogsSubscriptionPayload":["PipelineRunLogsSubscriptionSuccess","PipelineRunLogsSubscriptionFailure"],"RunOrError":["Run","RunNotFoundError","PythonError"],"PipelineRunStatsSnapshot":["RunStatsSnapshot"],"RunStatsSnapshotOrError":["RunStatsSnapshot","PythonError"],"PipelineSnapshotOrError":["PipelineNotFoundError","PipelineSnapshot","PipelineSnapshotNotFoundError","PythonError"],"RunsFeedEntry":["Run","PartitionBackfill"],"AssetOrError":["Asset","AssetNotFoundError"],"AssetsOrError":["AssetConnection","PythonError"],"DeletePipelineRunResult":["DeletePipelineRunSuccess","UnauthorizedError","PythonError","RunNotFoundError"],"ExecutionPlanOrError":["ExecutionPlan","RunConfigValidationInvalid","PipelineNotFoundError","InvalidSubsetError","PythonError"],"LaunchMultipleRunsResultOrError":["LaunchMultipleRunsResult","PythonError"],"PipelineOrError":["Pipeline","PipelineNotFoundError","InvalidSubsetError","PythonError"],"ReloadRepositoryLocationMutationResult":["WorkspaceLocationEntry","ReloadNotSupported","RepositoryLocationNotFound","UnauthorizedError","PythonError"],"RepositoryLocationOrLoadError":["RepositoryLocation","PythonError"],"ReloadWorkspaceMutationResult":["Workspace","UnauthorizedError","PythonError"],"ShutdownRepositoryLocationMutationResult":["ShutdownRepositoryLocationSuccess","RepositoryLocationNotFound","UnauthorizedError","PythonError"],"TerminatePipelineExecutionFailure":["TerminateRunFailure"],"TerminatePipelineExecutionSuccess":["TerminateRunSuccess"],"TerminateRunResult":["TerminateRunSuccess","TerminateRunFailure","RunNotFoundError","UnauthorizedError","PythonError"],"ScheduleMutationResult":["PythonError","UnauthorizedError","ScheduleStateResult","ScheduleNotFoundError"],"ScheduleOrError":["Schedule","ScheduleNotFoundError","PythonError"],"SchedulerOrError":["Scheduler","SchedulerNotDefinedError","PythonError"],"SchedulesOrError":["Schedules","RepositoryNotFoundError","PythonError"],"ScheduleTickSpecificData":["ScheduleTickSuccessData","ScheduleTickFailureData"],"LaunchBackfillResult":["LaunchBackfillSuccess","PartitionSetNotFoundError","PartitionKeysNotFoundError","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"ConfigTypeOrError":["EnumConfigType","CompositeConfigType","RegularConfigType","PipelineNotFoundError","ConfigTypeNotFoundError","PythonError"],"ConfigType":["ArrayConfigType","CompositeConfigType","EnumConfigType","NullableConfigType","RegularConfigType","ScalarUnionConfigType","MapConfigType"],"WrappingConfigType":["ArrayConfigType","NullableConfigType"],"DagsterType":["ListDagsterType","NullableDagsterType","RegularDagsterType"],"DagsterTypeOrError":["RegularDagsterType","PipelineNotFoundError","DagsterTypeNotFoundError","PythonError"],"WrappingDagsterType":["ListDagsterType","NullableDagsterType"],"Error":["PartitionSubsetDeserializationError","AssetCheckNotFoundError","AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError","PartitionKeysNotFoundError","AssetNotFoundError","ConflictingExecutionParamsError","ConfigTypeNotFoundError","DagsterTypeNotFoundError","InvalidPipelineRunsFilterError","InvalidSubsetError","ModeNotFoundError","NoModeProvidedError","PartitionSetNotFoundError","PipelineNotFoundError","RunConflict","PipelineSnapshotNotFoundError","PresetNotFoundError","PythonError","ErrorChainLink","UnauthorizedError","ReloadNotSupported","RepositoryLocationNotFound","RepositoryNotFoundError","ResourceNotFoundError","RunGroupNotFoundError","RunNotFoundError","ScheduleNotFoundError","SchedulerNotDefinedError","SensorNotFoundError","UnsupportedOperationError","DuplicateDynamicPartitionError","InstigationStateNotFoundError","SolidStepStatusUnavailableError","GraphNotFoundError","BackfillNotFoundError","AutoMaterializeAssetEvaluationNeedsMigrationError"],"PipelineRunConflict":["RunConflict"],"PipelineRunNotFoundError":["RunNotFoundError"],"RepositoriesOrError":["RepositoryConnection","RepositoryNotFoundError","PythonError"],"RepositoryOrError":["PythonError","Repository","RepositoryNotFoundError"],"WorkspaceLocationEntryOrError":["WorkspaceLocationEntry","PythonError"],"InstigationTypeSpecificData":["SensorData","ScheduleData"],"InstigationStateOrError":["InstigationState","InstigationStateNotFoundError","PythonError"],"InstigationStatesOrError":["InstigationStates","PythonError"],"MetadataEntry":["TableColumnLineageMetadataEntry","TableSchemaMetadataEntry","TableMetadataEntry","FloatMetadataEntry","IntMetadataEntry","JsonMetadataEntry","BoolMetadataEntry","MarkdownMetadataEntry","PathMetadataEntry","NotebookMetadataEntry","PythonArtifactMetadataEntry","TextMetadataEntry","UrlMetadataEntry","PipelineRunMetadataEntry","AssetMetadataEntry","JobMetadataEntry","CodeReferencesMetadataEntry","NullMetadataEntry","TimestampMetadataEntry","PoolMetadataEntry"],"SourceLocation":["LocalFileCodeReference","UrlCodeReference"],"PartitionRunConfigOrError":["PartitionRunConfig","PythonError"],"AssetBackfillStatus":["AssetPartitionsStatusCounts","UnpartitionedAssetStatus"],"PartitionSetOrError":["PartitionSet","PartitionSetNotFoundError","PythonError"],"PartitionSetsOrError":["PartitionSets","PipelineNotFoundError","PythonError"],"PartitionsOrError":["Partitions","PythonError"],"PartitionStatusesOrError":["PartitionStatuses","PythonError"],"PartitionTagsOrError":["PartitionTags","PythonError"],"RunConfigSchemaOrError":["RunConfigSchema","PipelineNotFoundError","InvalidSubsetError","ModeNotFoundError","PythonError"],"LaunchRunResult":["LaunchRunSuccess","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"LaunchRunReexecutionResult":["LaunchRunSuccess","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"LaunchPipelineRunSuccess":["LaunchRunSuccess"],"RunsOrError":["Runs","InvalidPipelineRunsFilterError","PythonError"],"PipelineRuns":["Runs"],"RunGroupOrError":["RunGroup","RunGroupNotFoundError","PythonError"],"SensorOrError":["Sensor","SensorNotFoundError","UnauthorizedError","PythonError"],"SensorsOrError":["Sensors","RepositoryNotFoundError","PythonError"],"StopSensorMutationResultOrError":["StopSensorMutationResult","UnauthorizedError","PythonError"],"ISolidDefinition":["CompositeSolidDefinition","SolidDefinition"],"SolidContainer":["Pipeline","PipelineSnapshot","Job","CompositeSolidDefinition","Graph"],"SolidStepStatsOrError":["SolidStepStatsConnection","SolidStepStatusUnavailableError"],"AppManagedComponentsOrError":["AppManagedComponents","PythonError"],"SetAppManagedComponentResult":["SetAppManagedComponentSuccess","UnauthorizedError","PythonError"],"DeleteAppManagedComponentResult":["DeleteAppManagedComponentSuccess","UnauthorizedError","PythonError"],"ComponentTypesOrError":["ComponentTypes","RepositoryLocationNotFound","PythonError"],"WorkspaceOrError":["Workspace","PythonError"],"WorkspaceLocationStatusEntriesOrError":["WorkspaceLocationStatusEntries","PythonError"],"ResourcesOrError":["ResourceConnection","PipelineNotFoundError","InvalidSubsetError","PythonError"],"GraphOrError":["Graph","GraphNotFoundError","PythonError"],"ResourceDetailsOrError":["ResourceDetails","ResourceNotFoundError","PythonError"],"ResourceDetailsListOrError":["ResourceDetailsList","RepositoryNotFoundError","PythonError"],"EnvVarWithConsumersOrError":["EnvVarWithConsumersList","PythonError"],"RunsFeedConnectionOrError":["RunsFeedConnection","PythonError"],"RunsFeedCountOrError":["RunsFeedCount","PythonError"],"RunTagKeysOrError":["PythonError","RunTagKeys"],"RunTagsOrError":["PythonError","RunTags"],"RunIdsOrError":["RunIds","InvalidPipelineRunsFilterError","PythonError"],"AssetRecordsOrError":["AssetRecordConnection","PythonError"],"AssetNodeOrError":["AssetNode","AssetNotFoundError"],"PartitionBackfillOrError":["PartitionBackfill","BackfillNotFoundError","PythonError"],"PartitionBackfillsOrError":["PartitionBackfills","PythonError"],"EventConnectionOrError":["EventConnection","RunNotFoundError","PythonError"],"AutoMaterializeAssetEvaluationRecordsOrError":["AutoMaterializeAssetEvaluationRecords","AutoMaterializeAssetEvaluationNeedsMigrationError"],"AssetConditionEvaluationNode":["UnpartitionedAssetConditionEvaluationNode","PartitionedAssetConditionEvaluationNode","SpecificPartitionAssetConditionEvaluationNode"],"EntityKey":["AssetKey","AssetCheckhandle"],"AssetConditionEvaluationRecordsOrError":["AssetConditionEvaluationRecords","AutoMaterializeAssetEvaluationNeedsMigrationError"],"SensorDryRunResult":["PythonError","SensorNotFoundError","UnauthorizedError","DryRunInstigationTick"],"ScheduleDryRunResult":["DryRunInstigationTick","PythonError","ScheduleNotFoundError","UnauthorizedError"],"TerminateRunsResultOrError":["TerminateRunsResult","PythonError"],"AssetWipeMutationResult":["AssetNotFoundError","UnauthorizedError","PythonError","UnsupportedOperationError","AssetWipeSuccess"],"ReportRunlessAssetEventsResult":["UnauthorizedError","PythonError","ReportRunlessAssetEventsSuccess"],"ReportAssetCheckEvaluationResult":["UnauthorizedError","PythonError","ReportAssetCheckEvaluationsSuccess"],"ResumeBackfillResult":["ResumeBackfillSuccess","UnauthorizedError","PythonError"],"CancelBackfillResult":["CancelBackfillSuccess","UnauthorizedError","PythonError"],"LogTelemetryMutationResult":["LogTelemetrySuccess","PythonError"],"AddDynamicPartitionResult":["AddDynamicPartitionSuccess","UnauthorizedError","PythonError","DuplicateDynamicPartitionError"],"DeleteDynamicPartitionsResult":["DeleteDynamicPartitionsSuccess","UnauthorizedError","PythonError"]} \ No newline at end of file +{"DisplayableEvent":["EngineEvent","ExecutionStepOutputEvent","ExpectationResult","FailureMetadata","HandledOutputEvent","LoadedInputEvent","ObjectStoreOperationResult","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","TypeCheck","FailedToMaterializeEvent","HealthChangedEvent"],"MarkerEvent":["EngineEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent"],"ErrorEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepUpForRetryEvent","HookErroredEvent","RunCanceledEvent","RunFailureEvent","ResourceInitFailureEvent"],"MessageEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepRestartEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","HandledOutputEvent","HookCompletedEvent","HookErroredEvent","HookSkippedEvent","LoadedInputEvent","LogMessageEvent","ObjectStoreOperationEvent","RunCanceledEvent","RunCancelingEvent","RunDequeuedEvent","RunEnqueuedEvent","RunFailureEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","RunStartEvent","RunStartingEvent","RunSuccessEvent","StepExpectationResultEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","AssetMaterializationPlannedEvent","FailedToMaterializeEvent","HealthChangedEvent","LogsCapturedEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"RunEvent":["RunCanceledEvent","RunCancelingEvent","RunDequeuedEvent","RunEnqueuedEvent","RunFailureEvent","RunStartEvent","RunStartingEvent","RunSuccessEvent","AssetMaterializationPlannedEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent"],"PipelineRunStepStats":["RunStepStats"],"StepEvent":["EngineEvent","ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepRestartEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","HandledOutputEvent","HookCompletedEvent","HookErroredEvent","HookSkippedEvent","LoadedInputEvent","ObjectStoreOperationEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","StepExpectationResultEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","MaterializationEvent","ObservationEvent","FailedToMaterializeEvent","HealthChangedEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"AssetResultEventType":["FailedToMaterializeEvent","MaterializationEvent","ObservationEvent"],"PartitionKeysOrError":["PartitionKeys","PartitionSubsetDeserializationError"],"AutoMaterializeRuleEvaluationData":["TextRuleEvaluationData","ParentMaterializedRuleEvaluationData","WaitingOnKeysRuleEvaluationData"],"InternalFreshnessPolicy":["TimeWindowFreshnessPolicy","CronFreshnessPolicy"],"AssetOwner":["UserAssetOwner","TeamAssetOwner"],"AssetPartitionStatuses":["DefaultPartitionStatuses","MultiPartitionStatuses","TimePartitionStatuses"],"PartitionStatus1D":["TimePartitionStatuses","DefaultPartitionStatuses"],"AssetCheckOrError":["AssetCheck","AssetCheckNotFoundError","AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError"],"AssetCheckPartitionStatuses":["AssetCheckDefaultPartitionStatuses","AssetCheckMultiPartitionStatuses","AssetCheckTimePartitionStatuses"],"AssetCheckPartitionStatus1D":["AssetCheckTimePartitionStatuses","AssetCheckDefaultPartitionStatuses"],"AssetChecksOrError":["AssetChecks","AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError"],"Instigator":["Schedule","Sensor"],"AssetHealthMaterializationMeta":["AssetHealthMaterializationDegradedPartitionedMeta","AssetHealthMaterializationHealthyPartitionedMeta","AssetHealthMaterializationDegradedNotPartitionedMeta"],"AssetHealthCheckMeta":["AssetHealthCheckDegradedMeta","AssetHealthCheckWarningMeta","AssetHealthCheckUnknownMeta"],"EvaluationStackEntry":["EvaluationStackListItemEntry","EvaluationStackPathEntry","EvaluationStackMapKeyEntry","EvaluationStackMapValueEntry"],"IPipelineSnapshot":["Pipeline","PipelineSnapshot","Job"],"DefinitionOwner":["UserDefinitionOwner","TeamDefinitionOwner"],"PipelineConfigValidationError":["FieldNotDefinedConfigError","FieldsNotDefinedConfigError","MissingFieldConfigError","MissingFieldsConfigError","RuntimeMismatchConfigError","SelectorTypeConfigError"],"PipelineConfigValidationInvalid":["RunConfigValidationInvalid"],"PipelineConfigValidationResult":["InvalidSubsetError","PipelineConfigValidationValid","RunConfigValidationInvalid","PipelineNotFoundError","PythonError"],"PipelineReference":["PipelineSnapshot","UnknownPipeline"],"PipelineRun":["Run"],"DagsterRunEvent":["ExecutionStepFailureEvent","ExecutionStepInputEvent","ExecutionStepOutputEvent","ExecutionStepSkippedEvent","ExecutionStepStartEvent","ExecutionStepSuccessEvent","ExecutionStepUpForRetryEvent","ExecutionStepRestartEvent","HealthChangedEvent","LogMessageEvent","ResourceInitFailureEvent","ResourceInitStartedEvent","ResourceInitSuccessEvent","RunFailureEvent","RunStartEvent","RunEnqueuedEvent","RunDequeuedEvent","RunStartingEvent","RunCancelingEvent","RunCanceledEvent","RunSuccessEvent","StepWorkerStartedEvent","StepWorkerStartingEvent","HandledOutputEvent","LoadedInputEvent","LogsCapturedEvent","ObjectStoreOperationEvent","StepExpectationResultEvent","MaterializationEvent","ObservationEvent","FailedToMaterializeEvent","EngineEvent","HookCompletedEvent","HookSkippedEvent","HookErroredEvent","AlertStartEvent","AlertSuccessEvent","AlertFailureEvent","AssetMaterializationPlannedEvent","AssetCheckEvaluationPlannedEvent","AssetCheckEvaluationEvent"],"PipelineRunLogsSubscriptionPayload":["PipelineRunLogsSubscriptionSuccess","PipelineRunLogsSubscriptionFailure"],"RunOrError":["Run","RunNotFoundError","PythonError"],"PipelineRunStatsSnapshot":["RunStatsSnapshot"],"RunStatsSnapshotOrError":["RunStatsSnapshot","PythonError"],"PipelineSnapshotOrError":["PipelineNotFoundError","PipelineSnapshot","PipelineSnapshotNotFoundError","PythonError"],"RunsFeedEntry":["Run","PartitionBackfill"],"AssetOrError":["Asset","AssetNotFoundError"],"AssetsOrError":["AssetConnection","PythonError"],"DeletePipelineRunResult":["DeletePipelineRunSuccess","UnauthorizedError","PythonError","RunNotFoundError"],"ExecutionPlanOrError":["ExecutionPlan","RunConfigValidationInvalid","PipelineNotFoundError","InvalidSubsetError","PythonError"],"LaunchMultipleRunsResultOrError":["LaunchMultipleRunsResult","PythonError"],"PipelineOrError":["Pipeline","PipelineNotFoundError","InvalidSubsetError","PythonError"],"ReloadRepositoryLocationMutationResult":["WorkspaceLocationEntry","ReloadNotSupported","RepositoryLocationNotFound","UnauthorizedError","PythonError"],"RepositoryLocationOrLoadError":["RepositoryLocation","PythonError"],"ReloadWorkspaceMutationResult":["ReloadWorkspaceSuccess","UnauthorizedError","PythonError"],"ShutdownRepositoryLocationMutationResult":["ShutdownRepositoryLocationSuccess","RepositoryLocationNotFound","UnauthorizedError","PythonError"],"TerminatePipelineExecutionFailure":["TerminateRunFailure"],"TerminatePipelineExecutionSuccess":["TerminateRunSuccess"],"TerminateRunResult":["TerminateRunSuccess","TerminateRunFailure","RunNotFoundError","UnauthorizedError","PythonError"],"ScheduleMutationResult":["PythonError","UnauthorizedError","ScheduleStateResult","ScheduleNotFoundError"],"ScheduleOrError":["Schedule","ScheduleNotFoundError","PythonError"],"SchedulerOrError":["Scheduler","SchedulerNotDefinedError","PythonError"],"SchedulesOrError":["Schedules","RepositoryNotFoundError","PythonError"],"ScheduleTickSpecificData":["ScheduleTickSuccessData","ScheduleTickFailureData"],"LaunchBackfillResult":["LaunchBackfillSuccess","PartitionSetNotFoundError","PartitionKeysNotFoundError","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"ConfigTypeOrError":["EnumConfigType","CompositeConfigType","RegularConfigType","PipelineNotFoundError","ConfigTypeNotFoundError","PythonError"],"ConfigType":["ArrayConfigType","CompositeConfigType","EnumConfigType","NullableConfigType","RegularConfigType","ScalarUnionConfigType","MapConfigType"],"WrappingConfigType":["ArrayConfigType","NullableConfigType"],"DagsterType":["ListDagsterType","NullableDagsterType","RegularDagsterType"],"DagsterTypeOrError":["RegularDagsterType","PipelineNotFoundError","DagsterTypeNotFoundError","PythonError"],"WrappingDagsterType":["ListDagsterType","NullableDagsterType"],"Error":["PartitionSubsetDeserializationError","AssetCheckNotFoundError","AssetCheckNeedsMigrationError","AssetCheckNeedsUserCodeUpgrade","AssetCheckNeedsAgentUpgradeError","PartitionKeysNotFoundError","AssetNotFoundError","ConflictingExecutionParamsError","ConfigTypeNotFoundError","DagsterTypeNotFoundError","InvalidPipelineRunsFilterError","InvalidSubsetError","ModeNotFoundError","NoModeProvidedError","PartitionSetNotFoundError","PipelineNotFoundError","RunConflict","PipelineSnapshotNotFoundError","PresetNotFoundError","PythonError","ErrorChainLink","UnauthorizedError","ReloadNotSupported","RepositoryLocationNotFound","RepositoryNotFoundError","ResourceNotFoundError","RunGroupNotFoundError","RunNotFoundError","ScheduleNotFoundError","SchedulerNotDefinedError","SensorNotFoundError","UnsupportedOperationError","DuplicateDynamicPartitionError","InstigationStateNotFoundError","SolidStepStatusUnavailableError","GraphNotFoundError","BackfillNotFoundError","AutoMaterializeAssetEvaluationNeedsMigrationError"],"PipelineRunConflict":["RunConflict"],"PipelineRunNotFoundError":["RunNotFoundError"],"RepositoriesOrError":["RepositoryConnection","RepositoryNotFoundError","PythonError"],"RepositoryOrError":["PythonError","Repository","RepositoryNotFoundError"],"WorkspaceLocationEntryOrError":["WorkspaceLocationEntry","PythonError"],"InstigationTypeSpecificData":["SensorData","ScheduleData"],"InstigationStateOrError":["InstigationState","InstigationStateNotFoundError","PythonError"],"InstigationStatesOrError":["InstigationStates","PythonError"],"MetadataEntry":["TableColumnLineageMetadataEntry","TableSchemaMetadataEntry","TableMetadataEntry","FloatMetadataEntry","IntMetadataEntry","JsonMetadataEntry","BoolMetadataEntry","MarkdownMetadataEntry","PathMetadataEntry","NotebookMetadataEntry","PythonArtifactMetadataEntry","TextMetadataEntry","UrlMetadataEntry","PipelineRunMetadataEntry","AssetMetadataEntry","JobMetadataEntry","CodeReferencesMetadataEntry","NullMetadataEntry","TimestampMetadataEntry","PoolMetadataEntry"],"SourceLocation":["LocalFileCodeReference","UrlCodeReference"],"PartitionRunConfigOrError":["PartitionRunConfig","PythonError"],"AssetBackfillStatus":["AssetPartitionsStatusCounts","UnpartitionedAssetStatus"],"PartitionSetOrError":["PartitionSet","PartitionSetNotFoundError","PythonError"],"PartitionSetsOrError":["PartitionSets","PipelineNotFoundError","PythonError"],"PartitionsOrError":["Partitions","PythonError"],"PartitionStatusesOrError":["PartitionStatuses","PythonError"],"PartitionTagsOrError":["PartitionTags","PythonError"],"RunConfigSchemaOrError":["RunConfigSchema","PipelineNotFoundError","InvalidSubsetError","ModeNotFoundError","PythonError"],"LaunchRunResult":["LaunchRunSuccess","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"LaunchRunReexecutionResult":["LaunchRunSuccess","InvalidStepError","InvalidOutputError","RunConfigValidationInvalid","PipelineNotFoundError","RunConflict","UnauthorizedError","PythonError","InvalidSubsetError","PresetNotFoundError","ConflictingExecutionParamsError","NoModeProvidedError"],"LaunchPipelineRunSuccess":["LaunchRunSuccess"],"RunsOrError":["Runs","InvalidPipelineRunsFilterError","PythonError"],"PipelineRuns":["Runs"],"RunGroupOrError":["RunGroup","RunGroupNotFoundError","PythonError"],"SensorOrError":["Sensor","SensorNotFoundError","UnauthorizedError","PythonError"],"SensorsOrError":["Sensors","RepositoryNotFoundError","PythonError"],"StopSensorMutationResultOrError":["StopSensorMutationResult","UnauthorizedError","PythonError"],"ISolidDefinition":["CompositeSolidDefinition","SolidDefinition"],"SolidContainer":["Pipeline","PipelineSnapshot","Job","CompositeSolidDefinition","Graph"],"SolidStepStatsOrError":["SolidStepStatsConnection","SolidStepStatusUnavailableError"],"AppManagedComponentsOrError":["AppManagedComponents","PythonError"],"SetAppManagedComponentResult":["SetAppManagedComponentSuccess","UnauthorizedError","PythonError"],"DeleteAppManagedComponentResult":["DeleteAppManagedComponentSuccess","UnauthorizedError","PythonError"],"ComponentTypesOrError":["ComponentTypes","RepositoryLocationNotFound","PythonError"],"WorkspaceOrError":["Workspace","PythonError"],"WorkspaceLocationStatusEntriesOrError":["WorkspaceLocationStatusEntries","PythonError"],"ResourcesOrError":["ResourceConnection","PipelineNotFoundError","InvalidSubsetError","PythonError"],"GraphOrError":["Graph","GraphNotFoundError","PythonError"],"ResourceDetailsOrError":["ResourceDetails","ResourceNotFoundError","PythonError"],"ResourceDetailsListOrError":["ResourceDetailsList","RepositoryNotFoundError","PythonError"],"EnvVarWithConsumersOrError":["EnvVarWithConsumersList","PythonError"],"RunsFeedConnectionOrError":["RunsFeedConnection","PythonError"],"RunsFeedCountOrError":["RunsFeedCount","PythonError"],"RunTagKeysOrError":["PythonError","RunTagKeys"],"RunTagsOrError":["PythonError","RunTags"],"RunIdsOrError":["RunIds","InvalidPipelineRunsFilterError","PythonError"],"AssetRecordsOrError":["AssetRecordConnection","PythonError"],"AssetNodeOrError":["AssetNode","AssetNotFoundError"],"PartitionBackfillOrError":["PartitionBackfill","BackfillNotFoundError","PythonError"],"PartitionBackfillsOrError":["PartitionBackfills","PythonError"],"EventConnectionOrError":["EventConnection","RunNotFoundError","PythonError"],"AutoMaterializeAssetEvaluationRecordsOrError":["AutoMaterializeAssetEvaluationRecords","AutoMaterializeAssetEvaluationNeedsMigrationError"],"AssetConditionEvaluationNode":["UnpartitionedAssetConditionEvaluationNode","PartitionedAssetConditionEvaluationNode","SpecificPartitionAssetConditionEvaluationNode"],"EntityKey":["AssetKey","AssetCheckhandle"],"AssetConditionEvaluationRecordsOrError":["AssetConditionEvaluationRecords","AutoMaterializeAssetEvaluationNeedsMigrationError"],"SensorDryRunResult":["PythonError","SensorNotFoundError","UnauthorizedError","DryRunInstigationTick"],"ScheduleDryRunResult":["DryRunInstigationTick","PythonError","ScheduleNotFoundError","UnauthorizedError"],"TerminateRunsResultOrError":["TerminateRunsResult","PythonError"],"AssetWipeMutationResult":["AssetNotFoundError","UnauthorizedError","PythonError","UnsupportedOperationError","AssetWipeSuccess"],"ReportRunlessAssetEventsResult":["UnauthorizedError","PythonError","ReportRunlessAssetEventsSuccess"],"ReportAssetCheckEvaluationResult":["UnauthorizedError","PythonError","ReportAssetCheckEvaluationsSuccess"],"ResumeBackfillResult":["ResumeBackfillSuccess","UnauthorizedError","PythonError"],"CancelBackfillResult":["CancelBackfillSuccess","UnauthorizedError","PythonError"],"LogTelemetryMutationResult":["LogTelemetrySuccess","PythonError"],"AddDynamicPartitionResult":["AddDynamicPartitionSuccess","UnauthorizedError","PythonError","DuplicateDynamicPartitionError"],"DeleteDynamicPartitionsResult":["DeleteDynamicPartitionsSuccess","UnauthorizedError","PythonError"]} \ No newline at end of file diff --git a/js_modules/ui-core/src/graphql/schema.graphql b/js_modules/ui-core/src/graphql/schema.graphql index 2412128e21762..0f9e32de1d6d4 100644 --- a/js_modules/ui-core/src/graphql/schema.graphql +++ b/js_modules/ui-core/src/graphql/schema.graphql @@ -1909,7 +1909,11 @@ type ReloadWorkspaceMutation { Output: ReloadWorkspaceMutationResult! } -union ReloadWorkspaceMutationResult = Workspace | UnauthorizedError | PythonError +union ReloadWorkspaceMutationResult = ReloadWorkspaceSuccess | UnauthorizedError | PythonError + +type ReloadWorkspaceSuccess { + success: Boolean! +} type Workspace { id: String! diff --git a/js_modules/ui-core/src/nav/types/useRepositoryLocationReload.types.ts b/js_modules/ui-core/src/nav/types/useRepositoryLocationReload.types.ts index 13e0e7d1d26d1..287d91459389a 100644 --- a/js_modules/ui-core/src/nav/types/useRepositoryLocationReload.types.ts +++ b/js_modules/ui-core/src/nav/types/useRepositoryLocationReload.types.ts @@ -65,39 +65,8 @@ export type ReloadWorkspaceMutation = { error: {__typename: 'PythonError'; message: string; stack: Array}; }>; } - | {__typename: 'UnauthorizedError'; message: string} - | { - __typename: 'Workspace'; - id: string; - locationEntries: Array<{ - __typename: 'WorkspaceLocationEntry'; - name: string; - id: string; - loadStatus: Types.RepositoryLocationLoadStatus; - locationOrLoadError: - | { - __typename: 'PythonError'; - message: string; - stack: Array; - errorChain: Array<{ - __typename: 'ErrorChainLink'; - isExplicitLink: boolean; - error: {__typename: 'PythonError'; message: string; stack: Array}; - }>; - } - | { - __typename: 'RepositoryLocation'; - id: string; - repositories: Array<{ - __typename: 'Repository'; - id: string; - name: string; - pipelines: Array<{__typename: 'Pipeline'; id: string; name: string}>; - }>; - } - | null; - }>; - }; + | {__typename: 'ReloadWorkspaceSuccess'; success: boolean} + | {__typename: 'UnauthorizedError'; message: string}; }; export type ReloadRepositoryLocationMutationVariables = Types.Exact<{ @@ -142,6 +111,6 @@ export type ReloadRepositoryLocationMutation = { export const RepositoryLocationStatusQueryVersion = '7129557ca993e0638a147e30c6fe3bdff04a929d4e6775c3e4e5dc9fa3c88d94'; -export const ReloadWorkspaceMutationVersion = '763808cb236e2d60a426cd891a4f60efd6851a755345d4a3ef019549f35e0a5e'; +export const ReloadWorkspaceMutationVersion = '278b658d1b59a3696426e5b5280590d28e8fed553533343ec97b764bc7f91d15'; export const ReloadRepositoryLocationMutationVersion = '19f0c7c1764ac7327424133d498295b6417cb00ef06d88f30a458a7d33926e26'; diff --git a/js_modules/ui-core/src/nav/useRepositoryLocationReload.tsx b/js_modules/ui-core/src/nav/useRepositoryLocationReload.tsx index 84e08f3d3e631..9e6b34c555140 100644 --- a/js_modules/ui-core/src/nav/useRepositoryLocationReload.tsx +++ b/js_modules/ui-core/src/nav/useRepositoryLocationReload.tsx @@ -310,36 +310,40 @@ export const reloadFnForWorkspace = async (client: ApolloClient): Promise({ + query: REPOSITORY_LOCATION_STATUS_QUERY, + fetchPolicy: 'no-cache', + }); + } catch (e) { + return { + type: 'error', + error: {message: e instanceof ApolloError ? e.message : 'An unexpected error occurred'}, + errorLocationId: null, + }; + } + const workspaceOrError = result.data?.workspaceOrError; + if (!workspaceOrError) { + return {type: 'error', error: {message: 'Unable to load definitions'}, errorLocationId: null}; + } + if (workspaceOrError.__typename === 'PythonError') { + return {type: 'error', error: workspaceOrError, errorLocationId: null}; + } return { type: 'finish-mutation-and-start-polling', - locationIds: data.reloadWorkspace.locationEntries.map((l) => l.id), + locationIds: workspaceOrError.locationEntries.map((l) => l.id), }; }; const RELOAD_WORKSPACE_MUTATION = gql` mutation ReloadWorkspaceMutation { reloadWorkspace { - ... on Workspace { - id - locationEntries { - name - id - loadStatus - locationOrLoadError { - ... on RepositoryLocation { - id - repositories { - id - name - pipelines { - id - name - } - } - } - ...PythonErrorFragment - } - } + ... on ReloadWorkspaceSuccess { + success } ...UnauthorizedErrorFragment ...PythonErrorFragment diff --git a/python_modules/dagster-graphql/dagster_graphql/implementation/external.py b/python_modules/dagster-graphql/dagster_graphql/implementation/external.py index fbea3e1fefc28..88dd54b4e8830 100644 --- a/python_modules/dagster-graphql/dagster_graphql/implementation/external.py +++ b/python_modules/dagster-graphql/dagster_graphql/implementation/external.py @@ -165,11 +165,11 @@ def fetch_workspace( ) nodes = [ - GrapheneWorkspaceLocationEntry(entry) + GrapheneWorkspaceLocationEntry(entry, workspace_request_context) for entry in workspace_request_context.get_code_location_entries().values() ] - return GrapheneWorkspace(locationEntries=nodes) + return GrapheneWorkspace(locationEntries=nodes, workspace_context=workspace_request_context) def fetch_location_statuses( diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/external.py b/python_modules/dagster-graphql/dagster_graphql/schema/external.py index f71c576cdd65a..7143bd9bf3346 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/external.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/external.py @@ -16,7 +16,7 @@ LocationStateSubscriber, ) from dagster._core.remote_representation.handle import RepositoryHandle -from dagster._core.workspace.context import WorkspaceProcessContext +from dagster._core.workspace.context import BaseWorkspaceRequestContext, WorkspaceProcessContext from dagster._core.workspace.workspace import ( CodeLocationEntry, CodeLocationLoadStatus, @@ -102,8 +102,14 @@ class GrapheneRepositoryLocation(graphene.ObjectType): class Meta: name = "RepositoryLocation" - def __init__(self, name: str, location: CodeLocation | None = None): + def __init__( + self, + name: str, + location: CodeLocation | None = None, + workspace_context: BaseWorkspaceRequestContext | None = None, + ): self._location = location + self._workspace_context = workspace_context super().__init__( name=name, ) @@ -113,12 +119,13 @@ def resolve_id(self, _) -> str: def get_location(self, graphene_info: ResolveInfo) -> CodeLocation: if self._location is None: - self._location = graphene_info.context.get_code_location(self.name) + context = self._workspace_context or graphene_info.context + self._location = context.get_code_location(self.name) return self._location def resolve_repositories(self, graphene_info: ResolveInfo): return [ - GrapheneRepository(repository.handle) + GrapheneRepository(repository.handle, workspace_context=self._workspace_context) for repository in self.get_location(graphene_info).get_repositories().values() ] @@ -226,8 +233,13 @@ class GrapheneWorkspaceLocationEntry(graphene.ObjectType): class Meta: name = "WorkspaceLocationEntry" - def __init__(self, location_entry: CodeLocationEntry): + def __init__( + self, + location_entry: CodeLocationEntry, + workspace_context: BaseWorkspaceRequestContext | None = None, + ): self._location_entry = check.inst_param(location_entry, "location_entry", CodeLocationEntry) + self._workspace_context = workspace_context super().__init__( name=self._location_entry.origin.location_name, definitionsSource=self._location_entry.definitions_source, @@ -241,6 +253,7 @@ def resolve_locationOrLoadError(self, _: ResolveInfo): return GrapheneRepositoryLocation( self._location_entry.code_location.name, self._location_entry.code_location, + workspace_context=self._workspace_context, ) error = self._location_entry.load_error @@ -276,7 +289,8 @@ def resolve_versionKey(self, _) -> str: return self._location_entry.version_key def resolve_permissions(self, graphene_info): - permissions = graphene_info.context.permissions_for_location(location_name=self.name) + context = self._workspace_context or graphene_info.context + permissions = context.permissions_for_location(location_name=self.name) return [GraphenePermission(permission, value) for permission, value in permissions.items()] def resolve_featureFlags(self, graphene_info): @@ -319,23 +333,29 @@ class Meta: def __init__( self, handle: RepositoryHandle, + workspace_context: BaseWorkspaceRequestContext | None = None, ): # Warning! GrapheneAssetNode contains a GrapheneRepository. Any computation in this # __init__ will be done **once per asset**. Ensure that any expensive work is done # elsewhere or cached. self._handle = handle + self._workspace_context = workspace_context self._batch_loader = None super().__init__(name=handle.repository_name) + def get_context(self, graphene_info: ResolveInfo) -> BaseWorkspaceRequestContext: + return self._workspace_context or graphene_info.context + def get_repository(self, graphene_info: ResolveInfo) -> RemoteRepository: - return graphene_info.context.get_repository(self._handle.to_selector()) + return self.get_context(graphene_info).get_repository(self._handle.to_selector()) def get_batch_loader(self, graphene_info: ResolveInfo): if self._batch_loader is None: + context = self.get_context(graphene_info) self._batch_loader = RepositoryScopedBatchLoader( - graphene_info.context.instance, self.get_repository(graphene_info) + context.instance, self.get_repository(graphene_info) ) return self._batch_loader @@ -347,7 +367,10 @@ def resolve_origin(self, _graphene_info: ResolveInfo): return GrapheneRepositoryOrigin(origin) def resolve_location(self, graphene_info: ResolveInfo): - return GrapheneRepositoryLocation(self._handle.location_name) + return GrapheneRepositoryLocation( + self._handle.location_name, + workspace_context=self._workspace_context, + ) def resolve_schedules(self, graphene_info: ResolveInfo): batch_loader = self.get_batch_loader(graphene_info) @@ -407,7 +430,9 @@ def resolve_usedSolids(self, graphene_info: ResolveInfo): return get_solids(self.get_repository(graphene_info)) def resolve_partitionSets(self, graphene_info: ResolveInfo): - partition_sets = graphene_info.context.get_partition_sets(self._handle.to_selector()) + partition_sets = self.get_context(graphene_info).get_partition_sets( + self._handle.to_selector() + ) return (GraphenePartitionSet(partition_set) for partition_set in partition_sets) def resolve_displayMetadata(self, graphene_info: ResolveInfo): @@ -462,9 +487,9 @@ def resolve_assetNodesConnection( def resolve_assetManifest(self, graphene_info: ResolveInfo) -> list: repository = self.get_repository(graphene_info) - base_deployment_asset_graph = graphene_info.context.get_base_deployment_asset_graph( - self._handle.to_selector() - ) + base_deployment_asset_graph = self.get_context( + graphene_info + ).get_base_deployment_asset_graph(self._handle.to_selector()) asset_graph_differ = ( AssetGraphDiffer( branch_asset_graph=repository.asset_graph, @@ -538,6 +563,13 @@ class GrapheneWorkspace(graphene.ObjectType): class Meta: name = "Workspace" + def __init__( + self, + locationEntries, + workspace_context: BaseWorkspaceRequestContext | None = None, + ): + super().__init__(locationEntries=locationEntries) + def resolve_id(self, _graphene_info: ResolveInfo): return "Workspace" diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py b/python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py index 8dcfabaa34c64..fa96d13992984 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py @@ -35,7 +35,7 @@ launch_pipeline_reexecution, launch_reexecution_from_parent_run, ) -from dagster_graphql.implementation.external import fetch_workspace, get_full_remote_job_or_raise +from dagster_graphql.implementation.external import get_full_remote_job_or_raise from dagster_graphql.implementation.fetch_app_managed_components import ( delete_app_managed_component, set_app_managed_component, @@ -76,7 +76,7 @@ GrapheneUnauthorizedError, GrapheneUnsupportedOperationError, ) -from dagster_graphql.schema.external import GrapheneWorkspace, GrapheneWorkspaceLocationEntry +from dagster_graphql.schema.external import GrapheneWorkspaceLocationEntry from dagster_graphql.schema.inputs import ( GrapheneExecutionParams, GrapheneLaunchBackfillParams, @@ -763,7 +763,8 @@ def mutate( # an updated WorkspaceRequestContext for us to use. new_context = graphene_info.context.reload_code_location(repositoryLocationName) return GrapheneWorkspaceLocationEntry( - check.not_none(new_context.get_location_entry(repositoryLocationName)) + check.not_none(new_context.get_location_entry(repositoryLocationName)), + workspace_context=new_context, ) @@ -800,12 +801,21 @@ def mutate( ) +class GrapheneReloadWorkspaceSuccess(graphene.ObjectType): + """Output indicating that the workspace was reloaded.""" + + success = graphene.NonNull(graphene.Boolean) + + class Meta: + name = "ReloadWorkspaceSuccess" + + class GrapheneReloadWorkspaceMutationResult(graphene.Union): """The output from reloading the workspace.""" class Meta: types = ( - GrapheneWorkspace, + GrapheneReloadWorkspaceSuccess, GrapheneUnauthorizedError, GraphenePythonError, ) @@ -823,8 +833,8 @@ class Meta: @capture_error @check_permission(Permissions.RELOAD_WORKSPACE) def mutate(self, graphene_info: ResolveInfo): - new_context = graphene_info.context.reload_workspace() - return fetch_workspace(new_context) + graphene_info.context.reload_workspace() + return GrapheneReloadWorkspaceSuccess(success=True) class GrapheneAssetWipeSuccess(graphene.ObjectType): diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py index 725ee8818ed5f..12b01679b6782 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py @@ -31,6 +31,9 @@ name repositories { name + pipelines { + name + } displayMetadata { key value @@ -50,6 +53,17 @@ RELOAD_WORKSPACE_QUERY = """ mutation { reloadWorkspace { + __typename + ... on ReloadWorkspaceSuccess { + success + } + } +} +""" + +WORKSPACE_QUERY = """ +query { + workspaceOrError { __typename ... on Workspace { locationEntries { @@ -64,6 +78,9 @@ name repositories { name + pipelines { + name + } } isReloadSupported } @@ -78,6 +95,26 @@ """ +def reload_workspace(graphql_context): + result = execute_dagster_graphql(graphql_context, RELOAD_WORKSPACE_QUERY) + + assert result + assert result.data + assert result.data["reloadWorkspace"] + assert result.data["reloadWorkspace"]["__typename"] == "ReloadWorkspaceSuccess" + assert result.data["reloadWorkspace"]["success"] is True + + result = execute_dagster_graphql( + graphql_context.process_context.create_request_context(), WORKSPACE_QUERY + ) + + assert result + assert result.data + assert result.data["workspaceOrError"] + assert result.data["workspaceOrError"]["__typename"] == "Workspace" + return result.data["workspaceOrError"]["locationEntries"] + + MultiLocationTestSuite: Any = make_graphql_context_test_suite( context_variants=[GraphQLContextVariant.non_launchable_sqlite_instance_multi_location()] ) @@ -108,14 +145,7 @@ def test_reload_workspace_permission_failure(self, graphql_context): class TestReloadWorkspace(MultiLocationTestSuite): def test_reload_workspace(self, graphql_context): - result = execute_dagster_graphql(graphql_context, RELOAD_WORKSPACE_QUERY) - - assert result - assert result.data - assert result.data["reloadWorkspace"] - assert result.data["reloadWorkspace"]["__typename"] == "Workspace" - - nodes = result.data["reloadWorkspace"]["locationEntries"] + nodes = reload_workspace(graphql_context) assert len(nodes) == 2 @@ -134,14 +164,7 @@ def test_reload_workspace(self, graphql_context): # simulate removing an origin, reload origins_mock.return_value = original_origins[0:1] - result = execute_dagster_graphql(graphql_context, RELOAD_WORKSPACE_QUERY) - - assert result - assert result.data - assert result.data["reloadWorkspace"] - assert result.data["reloadWorkspace"]["__typename"] == "Workspace" - - nodes = result.data["reloadWorkspace"]["locationEntries"] + nodes = reload_workspace(graphql_context) assert len(nodes) == 1 @@ -166,14 +189,7 @@ def test_reload_workspace(self, graphql_context): origins_mock.return_value = original_origins - result = execute_dagster_graphql(graphql_context, RELOAD_WORKSPACE_QUERY) - - assert result - assert result.data - assert result.data["reloadWorkspace"] - assert result.data["reloadWorkspace"]["__typename"] == "Workspace" - - nodes = result.data["reloadWorkspace"]["locationEntries"] + nodes = reload_workspace(graphql_context) assert len(nodes) == 3 assert ( @@ -199,9 +215,7 @@ def test_reload_workspace(self, graphql_context): original_origins.append(original_origins[0]._replace(location_name="location_copy")) # ty: ignore[unresolved-attribute] origins_mock.return_value = original_origins - result = execute_dagster_graphql(graphql_context, RELOAD_WORKSPACE_QUERY) - - nodes = result.data["reloadWorkspace"]["locationEntries"] + nodes = reload_workspace(graphql_context) assert len(nodes) == 4 assert ( @@ -226,9 +240,7 @@ def test_reload_workspace(self, graphql_context): original_origins[0] = original_origins[0]._replace(location_name="new_location_name") # ty: ignore[invalid-assignment] - result = execute_dagster_graphql(graphql_context, RELOAD_WORKSPACE_QUERY) - - nodes = result.data["reloadWorkspace"]["locationEntries"] + nodes = reload_workspace(graphql_context) assert len(nodes) == 4 assert (