Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Create JIRA issues from unmatched GitHub issues #2

Merged
merged 1 commit into from
Jul 20, 2017
Merged

Create JIRA issues from unmatched GitHub issues #2

merged 1 commit into from
Jul 20, 2017

Conversation

MorganEPatch
Copy link
Contributor

This PR builds on #1, and is thus blocked on it.

This PR adds the createIssue() function, which creates a new JIRA issue using a given GitHub issue's title and description and the project passed in the config. It also sets the custom fields for the GitHub issue ID, the issue Number, the GitHub labels, and the time the tool ran.

The function does not set the Reporter, Assignees, Issue Type, or Priority. These may be set in a future change, but for now, they default to the user under which the tool runs, nobody, Task, and Medium, respectively.

Copy link
Contributor

@squat squat left a comment

Choose a reason for hiding this comment

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

the createIssue function looks fine overall once #1 lands. One this I would like to see is this huge file broken up. These functions do not all need to be in the cmd package. cmd should only be concerned with parsing flags and setting configuration needed to run library code. The business logic should all be placed in a separate package. That way, the code can be re-used by other methods that need to create jira issues etc.

cmd/root.go Outdated
return nil
}

func createIssue(issue github.Issue, client jira.Client) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only change here that's different from the last PR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct.

@MorganEPatch
Copy link
Contributor Author

@squat I understand what you mean about moving it all into a separate file. Now that you point it out, I agree; this is doing far too much in one file. That may need to wait for a later PR, though, since all of the PRs work on these functions in this file.

@squat
Copy link
Contributor

squat commented Jul 19, 2017

It's not just too much for one file but simply that this code does not belong in this package at all.

@MorganEPatch
Copy link
Contributor Author

I completely agree.

Add the createIssue() function, which creates a new JIRA issue from
a given GitHub issue's title, body, ID, number, status, reporter,
and labels.
@MorganEPatch MorganEPatch merged commit 18c0fca into coreos:master Jul 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants