Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microservice Scheduler SDK - source should be a valid optional #3326

Closed
cdhanna opened this issue Apr 22, 2024 · 1 comment · Fixed by #3338
Closed

Microservice Scheduler SDK - source should be a valid optional #3326

cdhanna opened this issue Apr 22, 2024 · 1 comment · Fixed by #3338
Assignees
Milestone

Comments

@cdhanna
Copy link
Collaborator

cdhanna commented Apr 22, 2024

The BeamScheduler class has this segment,

public static Job Convert(JobDefinition job)
			{
				var retry = job.retryPolicy.GetOrThrow(() => new Exception("Job definition has no retry policy"));
				var j = new Job()
				{
					id = job.id.GetOrThrow(() => new Exception("Job definition has no id.")),
					action = job.jobAction.Convert(),
					triggers = job.triggers.Select(t => t.Convert()).ToList(),
					source = job.source.GetOrThrow(() => new Exception("Job definition has no source")),
					name = job.name.GetOrThrow(() => new Exception("Job definition has no name")),
					owner = job.owner.GetOrThrow(() => new Exception("Job definition has no owner")),
					retryPolicy = new RetryPolicy
					{
						maxRetryCount = retry.maxRetryCount.GetOrThrow(() => new Exception("Retry policy has no maxRetryCount")),
						retryDelayMs = retry.retryDelayMs.GetOrThrow(() => new Exception("Retry policy has no retryDelayMs")),
						useExponentialBackoff = retry.useExponentialBackoff.GetOrThrow(() => new Exception("Retry policy has no useExponentialBackoff")),
					}
				};

				return j;
			}

And of note, the job.source.GetOrThrow(() => new Exception("Job definition has no source")), is invalid, because source is actually an optional field, even though it isn't stated as such in the open-api spec.

If the source is NONE, then "null" is the valid value.

@cdhanna cdhanna added this to the Unity 1.19.18 milestone Apr 23, 2024
@cdhanna
Copy link
Collaborator Author

cdhanna commented Apr 23, 2024

related backend fix. https://disruptorbeam.atlassian.net/browse/PLAT-5506

@cdhanna cdhanna self-assigned this Apr 23, 2024
@cdhanna cdhanna linked a pull request Apr 23, 2024 that will close this issue
@cdhanna cdhanna closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant