Skip to content

[feat-1681][jira]: Collect the epic issue in an issue's epic link#2401

Merged
klesh merged 7 commits into
apache:mainfrom
merico-ai:issues/1681
Jul 28, 2022
Merged

[feat-1681][jira]: Collect the epic issue in an issue's epic link#2401
klesh merged 7 commits into
apache:mainfrom
merico-ai:issues/1681

Conversation

@keon94
Copy link
Copy Markdown
Contributor

@keon94 keon94 commented Jun 30, 2022

⚠️   Pre Checklist

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation & PR Template
  • This PR is using a label (bug, feature etc.)
  • My code is has necessary documentation (if appropriate)
  • I have added any relevant tests
  • This section (⚠️   Pre Checklist) will be removed when submitting PR

Summary

Does this close any open issues?

Closes #1681

Screenshots

Include any relevant screenshots here.

Other Information

Any other information that is important to this PR.

@keon94 keon94 force-pushed the issues/1681 branch 2 times, most recently from eee58cd to c8bea0c Compare July 2, 2022 03:28
@keon94 keon94 changed the title feat(jira) Collect the epic issue in an issue's epic link (#1681) [feat-1681][jira] Collect the epic issue in an issue's epic link Jul 5, 2022
@keon94 keon94 changed the title [feat-1681][jira] Collect the epic issue in an issue's epic link [feat-1681][jira]: Collect the epic issue in an issue's epic link Jul 5, 2022
@keon94 keon94 force-pushed the issues/1681 branch 2 times, most recently from 273a457 to 004f65b Compare July 7, 2022 16:19
@keon94 keon94 marked this pull request as ready for review July 8, 2022 00:03
@keon94 keon94 marked this pull request as draft July 8, 2022 00:06
@keon94 keon94 force-pushed the issues/1681 branch 3 times, most recently from e7388bc to 2f4f16d Compare July 20, 2022 03:36
@keon94 keon94 force-pushed the issues/1681 branch 4 times, most recently from 150262c to bcb7b10 Compare July 22, 2022 00:54
@keon94 keon94 marked this pull request as ready for review July 22, 2022 00:55
Comment thread plugins/jira/tasks/external_epic_collector.go Outdated
Comment thread plugins/jira/tasks/external_epic_extractor.go Outdated
Copy link
Copy Markdown
Contributor

@mindlesscloud mindlesscloud left a comment

Choose a reason for hiding this comment

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

it looks like the two new subtasks were not registered into Jira.SubTaskMetas .

Comment thread plugins/jira/e2e/external_epic_test.go
Comment thread plugins/jira/tasks/external_epic_collector.go
Comment thread api/docs/docs.go Outdated
Comment thread plugins/jira/tasks/external_epic_collector.go Outdated
}
issue.Type = mappings.typeIdMappings[issue.Type]
issue.StdStoryPoint = int64(issue.StoryPoint)
issue.StdType = mappings.stdTypeMappings[issue.Type]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it should be hardcoded as "EPIC"

Comment thread plugins/jira/tasks/external_epic_extractor.go Outdated
Comment thread plugins/jira/tasks/external_epic_collector.go Outdated
@keon94 keon94 force-pushed the issues/1681 branch 8 times, most recently from 3d1db13 to 0d14927 Compare July 27, 2022 05:47
Comment thread plugins/jira/e2e/epic_test.go
Comment thread plugins/jira/tasks/epic_collector.go Outdated
Comment thread plugins/jira/tasks/epic_collector.go Outdated
func CollectEpics(taskCtx core.SubTaskContext) error {
db := taskCtx.GetDal()
data := taskCtx.GetData().(*JiraTaskData)
externalEpicKeys, err := GetEpicKeys(db, data)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Loading all epic_keys is fine in most cases, but it could be a problem when the total number of epics grows too big. say 1000? Not sure if Jira API would take that many keys.
Besides, it is pointless to send all the keys every time, since the max records we can get is 100.
I suggest that we create an Iterator as the Input that returns 100 keys max each time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are you saying have a Dal iterator that returns up to 100 rows at a time? I'll have to make a batched iterator version of it, because the existing one gives just 1 row at a time. Also, how will the urlTemplate look like? The jql is a query param, so I dont know what the template syntax is going to become like. I couldnt find existing examples of us doing something like this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, here is what I think it should be

  1. The Iterator.Fetch is returning a value of type interface{}, so, we may return []int or string that contains up to 100 epic-keys at a time.
  2. Within ApiCollector.Query callback, we can access those epic-keys via reqData.Input, and concatenate them to the jql parameter

Comment thread plugins/helper/queue.go
@@ -23,8 +23,9 @@ import (
)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was using queue iterators before realizing the Dal iterator was what I needed. I did find some issues and incompleteness with the QueueNode code though that I've tried to improve (e.g. being able to access a node's data). @klesh let me know what you think or if you want it reverted.

Copy link
Copy Markdown
Contributor

@klesh klesh left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Jira plugin: collect the epic issue in an issue's epic link

3 participants