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

Cleanup sdk #1085

Merged
merged 11 commits into from
Jun 24, 2019
Merged

Cleanup sdk #1085

merged 11 commits into from
Jun 24, 2019

Conversation

antho1404
Copy link
Member

@antho1404 antho1404 commented Jun 23, 2019

Dependency #1083

Copy link
Member

@NicolasMahe NicolasMahe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add some comment but they should definitely done in another PR.

@@ -129,11 +127,11 @@ func (e *Execution) Execute(serviceHash hash.Hash, taskKey string, inputData map
return nil, err
}
// a task should be executed only if task's service is running.
status, err := e.m.Status(s)
instances, err := e.instDB.GetAllByService(s.Hash)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should only access the instanceSDK instead of the DB!

return &Execution{
m: m,
ps: ps,
db: db,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service DB should not be injected as a dependency, but the ServiceSDK should

Instance: instancesdk.New(c, db, instanceDB),
Execution: executionsdk.New(m, ps, db, execDB),
Execution: executionsdk.New(ps, db, execDB, instanceDB),
Event: eventsdk.New(ps, db),
Copy link
Member

@NicolasMahe NicolasMahe Jun 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous comments.
Each SDK should have only access to its specific resource database (eg instance SDK accesses only instance DB, and so on) but can also access to "child" sdk based on the way the data are linked together (eg, instance SDK can access to service SDK because instance contains service hash).

@antho1404 antho1404 force-pushed the fix/cleanup-sdk branch 3 times, most recently from 9284459 to 4abd07a Compare June 24, 2019 07:35
@antho1404 antho1404 marked this pull request as ready for review June 24, 2019 07:41
@antho1404 antho1404 changed the title Fix/cleanup sdk Cleanup sdk Jun 24, 2019
@antho1404 antho1404 mentioned this pull request Jun 24, 2019
7 tasks
@antho1404 antho1404 merged commit 5d1c469 into dev Jun 24, 2019
@antho1404 antho1404 deleted the fix/cleanup-sdk branch June 24, 2019 10:46
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 this pull request may close these issues.

3 participants