-
-
Notifications
You must be signed in to change notification settings - Fork 12
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 run feature for trello provider #592
base: master
Are you sure you want to change the base?
Conversation
if err != nil { | ||
return nil, fmt.Errorf("pull: %w", err) | ||
} | ||
tasks, err = dvstore.LoadTasks(s.h, s.schema, filters, s.opts.Logger) | ||
tasks, err = dvstore.LoadTasks(s.h, s.schema, s.opts.TrelloToken, s.opts.TrelloApiKey, filters, s.opts.Logger) |
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.
Why do you need Token & API KEY for loading from the cayley store ?
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.
Yup, this should not happen.
But maybe it's due to a bad design decision I made earlier?
@AbdelkarimBENGRINE can you tell us more?
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 also surprised me but when I read Trello Api Doc
It is said that you have to provide both an api key and token unlike classic Oauth provider. I will look for implementation alternative if it causes too much problem in Depviz
if err != nil { | ||
return nil, fmt.Errorf("pull: %w", err) | ||
} | ||
} | ||
|
||
var tasks dvmodel.Tasks | ||
tasks, err = dvstore.LoadTasks(s.h, s.schema, filters, s.opts.Logger) | ||
tasks, err = dvstore.LoadTasks(s.h, s.schema, s.opts.TrelloToken, s.opts.TrelloApiKey, filters, s.opts.Logger) |
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.
Same as above
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.
same answer as above :)
paths = append(paths, p) | ||
|
||
case multipmuri.TrelloProvider: | ||
cardsId, err := trello.GetCardsId(target.LocalID()[1:], trelloToken, trelloApiKey) |
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.
Seem's weird to me to use Trello API to get informations for retrieve data on local store.
Is it the only way ?
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.
Yep same, but once again, it may come from a design limitation that I introduced before.
Maybe it makes sense to support lazy fetches at some points.
internal/dvcore/run.go
Outdated
case multipmuri.TrelloProvider: | ||
go func(board multipmuri.Entity) { | ||
defer wg.Done() | ||
trelloprovider.FetchCard(ctx, board, trelloToken, trelloApiKey, target.LocalID()[1:], out) |
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.
you should check target.LocalID()
before calling [1:]
in case it's empty.
I think it deserves a dedicated helper.
internal/dvcore/run.go
Outdated
case multipmuri.TrelloProvider: | ||
go func(board multipmuri.Entity) { | ||
defer wg.Done() | ||
trelloprovider.FetchCard(ctx, board, trelloToken, trelloApiKey, target.LocalID()[1:], out) |
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.
Btw, from pullBatches
, I expect my drivers to fetch not only Trello Card
but also Trello Board
.
The helper here should be named trelloprovider.FetchTarget
or something more flexible I guess.
} | ||
|
||
card := dvmodel.Task{ | ||
ID: quad.IRI(entity.String()), |
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'm not sure that entity.String
is always unique. Maybe we can point to the same trello item with two different URLs.
Can you check in the input
if there is no official URL instead maybe?
clean code Co-authored-by: Isma <[email protected]>
fix : clean code Co-authored-by: Isma <[email protected]>
fix : clean order lines Co-authored-by: Isma <[email protected]>
fix : reorder next provider Co-authored-by: Mikael VALLENET <[email protected]>
fix : comment non-provided fields Co-authored-by: Manfred Touron <[email protected]>
┆Issue is synchronized with this Trello card