-
Notifications
You must be signed in to change notification settings - Fork 3
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
Al/new redis graph modeling #125
base: main
Are you sure you want to change the base?
Conversation
…middleware into AL/NewRedisGraphModeling
|
||
public override Dto.Dto ToDto() | ||
{ | ||
var domain = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running action has to store its placement
src/Models/Dto/ActionRunningDto.cs
Outdated
[RedisIdField] | ||
public override string Id { get; set; } = default!; | ||
[Indexed] | ||
public string ActionParentId { get; init; } = default!; // This is the ID in which the actionRunning us based from the normal Action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment typo
src/Models/Dto/ActionRunningDto.cs
Outdated
return new ActionRunningModel() | ||
{ | ||
Id = Guid.Parse(dto.Id.Replace(Prefix, "")), | ||
ActionParentId = Guid.Parse(dto.ActionParentId.Replace(Prefix, "")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have to replace prefixes in these fields
//Add the actionRunning to redis | ||
foreach (ActionModel action in task.ActionSequence) | ||
{ | ||
ActionRunningModel actionRunningTemp = new ActionRunningModel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be extracted into a separate method
@@ -292,6 +351,79 @@ public V1Service CreateService(string serviceImageName, K8SServiceKindEnum kind, | |||
/// <inheritdoc/> | |||
public async Task<bool> DeletePlanAsync(ActionPlanModel actionPlan) | |||
{ | |||
// Delete OWNS relationship between robot and actionPlan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract to the separate methods
@@ -236,6 +236,56 @@ public async Task<bool> ActionPlanDeleteAsync(Guid id, CancellationToken token) | |||
return await ContainerImageGetForInstanceAsync(id, CancellationToken.None); | |||
} | |||
|
|||
public async Task<bool> ActionRunningAddAsync(ActionRunningModel actionRunning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions have to be implemented
@@ -77,7 +77,7 @@ public class PlanController : ControllerBase | |||
if (dryRun) | |||
return Ok(resourcePlan); | |||
|
|||
await _redisInterfaceClient.AddRelationAsync(robot2, resourcePlan, "OWNS"); | |||
await _redisInterfaceClient.AddRelationAsync(robot2, resourcePlan, "WANTS_TO_RUN"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't a robot still OWN
an action plan?
No description provided.