Skip to content

Commit

Permalink
Fix some Deprecated go docs (temporalio#1542)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns committed Jul 11, 2024
1 parent 6267857 commit cd5ddeb
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
15 changes: 15 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (

// TaskReachability specifies which category of tasks may reach a worker on a versioned task queue.
// Used both in a reachability query and its response.
//
// Deprecated: Use [BuildIDTaskReachability]
type TaskReachability = internal.TaskReachability

Expand Down Expand Up @@ -276,50 +277,61 @@ type (
GetWorkflowUpdateHandleOptions = internal.GetWorkflowUpdateHandleOptions

// UpdateWorkerBuildIdCompatibilityOptions is the input to Client.UpdateWorkerBuildIdCompatibility.
//
// Deprecated: Use [UpdateWorkerVersioningRulesOptions] with the new worker versioning api.
UpdateWorkerBuildIdCompatibilityOptions = internal.UpdateWorkerBuildIdCompatibilityOptions

// GetWorkerBuildIdCompatibilityOptions is the input to Client.GetWorkerBuildIdCompatibility.
//
// Deprecated: Use [GetWorkerVersioningOptions] with the new worker versioning api.
GetWorkerBuildIdCompatibilityOptions = internal.GetWorkerBuildIdCompatibilityOptions

// WorkerBuildIDVersionSets is the response for Client.GetWorkerBuildIdCompatibility.
//
// Deprecated: Replaced by the new worker versioning api.
WorkerBuildIDVersionSets = internal.WorkerBuildIDVersionSets

// BuildIDOpAddNewIDInNewDefaultSet is an operation for UpdateWorkerBuildIdCompatibilityOptions
// to add a new BuildID in a new default set.
//
// Deprecated: Replaced by the new worker versioning api.
BuildIDOpAddNewIDInNewDefaultSet = internal.BuildIDOpAddNewIDInNewDefaultSet

// BuildIDOpAddNewCompatibleVersion is an operation for UpdateWorkerBuildIdCompatibilityOptions
// to add a new BuildID to an existing compatible set.
//
// Deprecated: Replaced by the new worker versioning api.
BuildIDOpAddNewCompatibleVersion = internal.BuildIDOpAddNewCompatibleVersion

// BuildIDOpPromoteSet is an operation for UpdateWorkerBuildIdCompatibilityOptions to promote a
// set to be the default set by targeting an existing BuildID.
//
// Deprecated: Replaced by the new worker versioning api.
BuildIDOpPromoteSet = internal.BuildIDOpPromoteSet

// BuildIDOpPromoteIDWithinSet is an operation for UpdateWorkerBuildIdCompatibilityOptions to
// promote a BuildID within a set to be the default.
//
// Deprecated: Replaced by the new worker versioning api.
BuildIDOpPromoteIDWithinSet = internal.BuildIDOpPromoteIDWithinSet

// GetWorkerTaskReachabilityOptions is the input to Client.GetWorkerTaskReachability.
//
// Deprecated: Use [DescribeTaskQueueEnhancedOptions] with the new worker versioning api.
GetWorkerTaskReachabilityOptions = internal.GetWorkerTaskReachabilityOptions

// WorkerTaskReachability is the response for Client.GetWorkerTaskReachability.
//
// Deprecated: Replaced by the new worker versioning api.
WorkerTaskReachability = internal.WorkerTaskReachability

// BuildIDReachability describes the reachability of a buildID
//
// Deprecated: Replaced by the new worker versioning api.
BuildIDReachability = internal.BuildIDReachability

// TaskQueueReachability Describes how the Build ID may be reachable from the task queue.
//
// Deprecated: Replaced by the new worker versioning api.
TaskQueueReachability = internal.TaskQueueReachability

Expand Down Expand Up @@ -766,16 +778,19 @@ type (
// UpdateWorkerBuildIdCompatibility
// Allows you to update the worker-build-id based version sets for a particular task queue. This is used in
// conjunction with workers who specify their build id and thus opt into the feature.
//
// Deprecated: Use [UpdateWorkerVersioningRules] with the versioning api.
UpdateWorkerBuildIdCompatibility(ctx context.Context, options *UpdateWorkerBuildIdCompatibilityOptions) error

// GetWorkerBuildIdCompatibility
// Returns the worker-build-id based version sets for a particular task queue.
//
// Deprecated: Use [GetWorkerVersioningRules] with the versioning api.
GetWorkerBuildIdCompatibility(ctx context.Context, options *GetWorkerBuildIdCompatibilityOptions) (*WorkerBuildIDVersionSets, error)

// GetWorkerTaskReachability
// Returns which versions are is still in use by open or closed workflows
//
// Deprecated: Use [DescribeTaskQueueEnhanced] with the versioning api.
GetWorkerTaskReachability(ctx context.Context, options *GetWorkerTaskReachabilityOptions) (*WorkerTaskReachability, error)

Expand Down
2 changes: 2 additions & 0 deletions internal/worker_version_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ const (
// VersioningIntentCompatible indicates that the command should run on a worker with compatible
// version if possible. It may not be possible if the target task queue does not also have
// knowledge of the current worker's build ID.
//
// Deprecated: This has the same effect as [VersioningIntentInheritBuildID], use that instead.
VersioningIntentCompatible
// VersioningIntentDefault indicates that the command should run on the target task queue's
// current overall-default build ID.
//
// Deprecated: This has the same effect as [VersioningIntentUseAssignmentRules], use that instead.
VersioningIntentDefault
// VersioningIntentInheritBuildID indicates the command should inherit the current Build ID of the
Expand Down
2 changes: 2 additions & 0 deletions internal/workflow_testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ func (e *TestWorkflowEnvironment) OnGetVersion(changeID string, minSupported, ma
// OnUpsertSearchAttributes setup a mock for workflow.UpsertSearchAttributes call.
// If mock is not setup, the UpsertSearchAttributes call will only validate input attributes.
// If mock is setup, all UpsertSearchAttributes calls in workflow have to be mocked.
//
// Deprecated: use OnUpsertTypedSearchAttributes instead.
func (e *TestWorkflowEnvironment) OnUpsertSearchAttributes(attributes interface{}) *MockCallWrapper {
call := e.workflowMock.On(mockMethodForUpsertSearchAttributes, attributes)
Expand Down Expand Up @@ -954,6 +955,7 @@ func (e *TestWorkflowEnvironment) SetMemoOnStart(memo map[string]interface{}) er
}

// SetSearchAttributesOnStart sets the search attributes when start workflow.
//
// Deprecated: Use SetTypedSearchAttributes instead.
func (e *TestWorkflowEnvironment) SetSearchAttributesOnStart(searchAttributes map[string]interface{}) error {
attr, err := serializeUntypedSearchAttributes(searchAttributes)
Expand Down
20 changes: 17 additions & 3 deletions mocks/Client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions temporal/build_id_versioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ const (
// VersioningIntentCompatible indicates that the command should run on a worker with compatible
// version if possible. It may not be possible if the target task queue does not also have
// knowledge of the current worker's build ID.
//
// Deprecated: This has the same effect as [VersioningIntentInheritBuildID], use that instead.
//lint:ignore SA1019 ignore for SDK
VersioningIntentCompatible = internal.VersioningIntentCompatible
// VersioningIntentDefault indicates that the command should run on the target task queue's
// current overall-default build ID.
//
// Deprecated: This has the same effect as [VersioningIntentUseAssignmentRules], use that instead.
//lint:ignore SA1019 ignore for SDK
VersioningIntentDefault = internal.VersioningIntentDefault
// VersioningIntentInheritBuildID indicates the command should inherit the current Build ID of the
// Workflow triggering it, and not use Assignment Rules. (Redirect Rules are still applicable)
Expand Down

0 comments on commit cd5ddeb

Please sign in to comment.