-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add naming per instance and delete by name #90
base: main
Are you sure you want to change the base?
Conversation
…port for individual instance names
WebhookURL string `json:"webhook_url"` // Webhook URL of the job | ||
Provider string `json:"provider"` // Provider of the compute service | ||
Instances []DeleteInstance `json:"instances"` // Instances to delete | ||
InstanceName string `json:"instance_name"` // Base name for instances |
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.
revisit how job names are being used
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.
should include job name as well
if r.InstanceName == "" { | ||
return fmt.Errorf("instance_name is required") |
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.
I don't think this is required. revert to job name?
@@ -99,18 +102,18 @@ func (s *InstanceService) DeleteInstance( | |||
Model: gorm.Model{ | |||
ID: jobID, | |||
}, | |||
Name: name, |
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.
this should be job name.
ProjectName: projectName, | ||
Status: models.JobStatusPending, | ||
} | ||
|
||
// Create infrastructure request | ||
infraReq := &infrastructure.JobRequest{ | ||
Name: name, |
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.
this should be additive and be job name as well
Name: instance.Name, | ||
ProjectName: infraReq.ProjectName, | ||
Provider: infraReq.Provider, | ||
InstanceName: instance.Name, |
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.
should have job name too
Overview
Closes #76
Confirm the following:
Needs Followup
Job vs Instance naming
It appears that job names and instance names are being used interchangeably. This is going to cause confusion and lead to errors due to complexity building around the re-use.
These two fields need to be split out and kept separate.
Unit Testing
Some of the large functions should really be split out to allow for better unit testing that avoids unnecessary DB and API mocks.
Delete All
Seems like low hanging fruit to allow for delete all if no instances are provided. Should just enable that.
This would eliminate the need to be tracking deletions and creations to submit the exact number of delete requests needed.