Skip to content

Cleanup sdk#1085

Merged
antho1404 merged 11 commits intodevfrom
fix/cleanup-sdk
Jun 24, 2019
Merged

Cleanup sdk#1085
antho1404 merged 11 commits intodevfrom
fix/cleanup-sdk

Conversation

@antho1404
Copy link
Copy Markdown
Member

@antho1404 antho1404 commented Jun 23, 2019

Dependency #1083

Copy link
Copy Markdown
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.

}
// 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
Copy Markdown
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
Copy Markdown
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

Comment thread sdk/sdk.go
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
Copy Markdown
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