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

refactor: add subtask register for jira #5725

Closed

Conversation

chenggui53
Copy link
Contributor

Summary

What does this PR do?
like pr #4896 and #5411, add subtask register for jira

Does this close any open issues?

Closes #4413

Screenshots

Include any relevant screenshots here.

@chenggui53 chenggui53 changed the title refactor: add subtask register for jira WIP refactor: add subtask register for jira Jul 22, 2023
@chenggui53 chenggui53 changed the title WIP refactor: add subtask register for jira [WIP] refactor: add subtask register for jira Jul 22, 2023
@chenggui53 chenggui53 changed the title [WIP] refactor: add subtask register for jira refactor: add subtask register for jira Jul 22, 2023
@chenggui53 chenggui53 force-pushed the add-subtask-register-for-jira branch 3 times, most recently from d54f920 to 5df4a3a Compare July 22, 2023 13:25
@keon94 keon94 added this to the v0.19 milestone Jul 25, 2023
@chenggui53 chenggui53 force-pushed the add-subtask-register-for-jira branch 2 times, most recently from 7c71b30 to ab77882 Compare August 4, 2023 01:12
@chenggui53 chenggui53 requested a review from klesh August 4, 2023 01:25
@chenggui53 chenggui53 force-pushed the add-subtask-register-for-jira branch from ab77882 to 6e43334 Compare August 4, 2023 07:27
@klesh klesh modified the milestones: v0.19, v0.20 Aug 7, 2023
@klesh
Copy link
Contributor

klesh commented Aug 7, 2023

Hi, @chenggui53 Thanks for the good work. I may have to postpone this PR since we are now testing the existing code for v0.19.
This PR will be reviewed, merged, and tested in the v0.20 milestone.

@chenggui53
Copy link
Contributor Author

Hi, @chenggui53 Thanks for the good work. I may have to postpone this PR since we are now testing the existing code for v0.19. This PR will be reviewed, merged, and tested in the v0.20 milestone.

@klesh Okay, I'll try to see if the subtaskmeta register part can be further optimized or other things i can do until v0.19 is done.

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

Hi, @chenggui53 We are ready to accept new PRs for v0.20 due to release-v0.19 is checked out.
I reviewed this one up to the epic_extractor part and I think we need to discuss the solution for the existing cyclic-dependency situation before we can proceed.
Sorry for the delay, 🥲

@@ -38,6 +42,10 @@ var CollectAccountsMeta = plugin.SubTaskMeta{
EnabledByDefault: true,
Description: "collect Jira accounts, does not support either timeFilter or diffSync.",
DomainTypes: []string{plugin.DOMAIN_TYPE_CROSS},
DependencyTables: []string{
// models.JiraAccount{}.TableName(), // cursor, config not regard as dependency
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand it correctly, it is commented out because other subtasks would write records into this table (namely _tool_jira_account for account_collector to collect details one by one.
However, the account_extractor would write to the same table which creates a cyclic dependency.

I think the current logic is problematic, it would be better if we do the following:

  1. Define a new table named _tool_jira_pre_accounts
  2. Other subtasks including issue_extractors and issue_changelog_extractor would write to _tool_jira_pre_accounts instead of _tool_jira_accounts
  3. The account_collector would read from _tool_jira_pre_accounts as well

By doing so, we break the cyclic dependency and simplify the flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@klesh Thanks for the comments, I'll fix this type problem ASAP.

var ConvertAccountsMeta = plugin.SubTaskMeta{
Name: "convertAccounts",
EntryPoint: ConvertAccounts,
EnabledByDefault: true,
Description: "convert Jira accounts",
DomainTypes: []string{plugin.DOMAIN_TYPE_CROSS},
DependencyTables: []string{
models.JiraAccount{}.TableName(), // cursor
RAW_USERS_TABLE},
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -44,6 +48,11 @@ var CollectEpicsMeta = plugin.SubTaskMeta{
EnabledByDefault: true,
Description: "collect Jira epics from all boards, does not support either timeFilter or diffSync.",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET, plugin.DOMAIN_TYPE_CROSS},
DependencyTables: []string{
models.JiraIssue{}.TableName(), // cursor
// models.JiraBoardIssue{}.TableName()}, // cursor, board issue not regard as dependency cause epic extractor will produce board issue result
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh... This is tricky... apparently, we have another cyclic dependency here. 🥲.
Maybe we could create new tables _jira_board_epics and _jira_epics to avoid such a thing?

@klesh
Copy link
Contributor

klesh commented Sep 22, 2023

Hi, @chenggui53 We are planning to code freeze next Tue 9-26, I would like to know if it works for you, do you think the PR can be updated in time?

@chenggui53
Copy link
Contributor Author

Hi, @chenggui53 We are planning to code freeze next Tue 9-26, I would like to know if it works for you, do you think the PR can be updated in time?

@klesh Sorry, there have been a lot of chores lately, which has resulted in no updates being submitted. Can you help move it to the next version, I'll be working on an update in the next few days, but there's no guarantee it'll be merged in on 9.26.

@klesh
Copy link
Contributor

klesh commented Sep 22, 2023

@chenggui53 Thanks for the quick response. No problem, take your time.

@d4x1 d4x1 modified the milestones: v0.20, v0.21 Nov 10, 2023
@d4x1
Copy link
Contributor

d4x1 commented Jan 5, 2024

@chenggui53 There is a conflict, maybe you can fix it.
And @klesh will help to merge it. I think.

Copy link

github-actions bot commented May 6, 2024

This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the Stale label May 6, 2024
Copy link

This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request.

@github-actions github-actions bot closed this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants