-
Notifications
You must be signed in to change notification settings - Fork 0
DT-157: Task manager — types & pure logic (WorkItem, Ticket, key/status/person functions) - #168
Conversation
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.
TNT-879-do-something would fail
/^([A-Z]+)[^0-9]?([0-9]+)/ would normalize all
[_, prefix, id] = 'TNT545-hey'.split(/^([A-Z]+)[^0-9]?([0-9]+)/) if (!id) return undefined `${prefix}${id}`
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 think here we could have a more generic "if this title has the project prefix clean it up" and not even care about the specific source
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.
`extractKey(item) || `${item.source}:${item.externalId}`
we don't want to accept falsy values as valid keys
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.
export const resolvePerson = (ref: PersonRef, person: Person) => (ref.login != null && person.githubLogin === ref.login) || (ref.email != null && person.emails.includes(ref.email)) || (ref.discordId != null && person.discordId === ref.discordId) || (ref.jiraAccountId != null && person.jiraAccountId === ref.jiraAccountId) ) function resolvePersonMethod(person: Person) { return resolvePerson(person, this) } directory.find(resolvePersonMethod, ref)
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.
const persons = new Set<Person>() for (const ref of refs) { const match = directory.find(resolvePerson, ref) match && persons.add(match) } return [...persons]
// if match ref is not stable: const persons = new Map<string, Person>() for (const ref of refs) { const match = directory.find(resolvePerson, ref) match && persons.set(match.id, match) } return [...persons.values()]
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.
resolveUnique(directory, groupItems, 'reviewerRefs') // later const persons = new Set<Person>() for (const item of items) { if (!item[personKey]) continue for (const ref of item[personKey]) { const match = directory.find(resolvePerson, ref) match && persons.add(match) } } return [...persons]
Implement pure logic and types for task manager ticket aggregation