Uh oh!
There was an error while loading. Please reload this page.
Comment everything - #11
Conversation
squat
left a comment
There was a problem hiding this comment.
Looks good. One minor comment: please make all comments full sentences with periods at the end. Once that is fixed, we can merge this.
| ghStatusFieldID string // The customfield ID of the GitHub Status field in JIRA | ||
| ghReporterFieldID string // The customfield ID of the GitHub Reporter field in JIRA | ||
| isLastUpdateFieldID string // The customfield ID of the Last Issue-Sync Update field in JIRA | ||
| // since is the earliest GitHub issue updates we want to retrieve |
There was a problem hiding this comment.
these comments should all be full sentences with periods at the end.
@squat Is it better now? |
| return nil | ||
| } | ||
| // init sets the configuration variables of the command, then runs viper to |
There was a problem hiding this comment.
this is a special function in Go. Do not document it
| // just their GitHub ID for matching. | ||
| var jCommentIDRegex = regexp.MustCompile("^Comment \\(ID (\\d+)\\)") | ||
| // createCommments takes a GitHub issue, and retrieves all of its comments. It then |
| return nil | ||
| } | ||
| // createIssue generates a JIRA issue from the various fields on the given GitHub issue, then |
| // compareIssues gets the list of GitHub issues updated since the `since` date, | ||
| // gets the list of JIRA issues which have GitHub ID custom fields in that list, | ||
| // then matches each one. If a JIRA issue already exists for a given GitHub issue, | ||
| // it calls updateIssue; if no JIRA issue already exists, it calls createIssue. |
There was a problem hiding this comment.
The comment should not details the implementation and functions used but rather the business logic, e.g. "If the issue already exists, it is updated; if no issue exists, a new one is created." Otherwise, everytime implementation changes slightly, this needs to be kept in sync.
| } | ||
| // getFieldIDs requests the metadata of every issue field in the JIRA | ||
| // project, and saves the IDs of the custom fields used by issue-sync. |
| func GetJIRAClient(username, password, baseURL string) (*jira.Client, error) { | ||
| // getJIRAClient initializes a JIRA API client, then sets the Basic Auth credentials | ||
| // passed to it. (OAuth token support is planned.) It then requests the project using | ||
| // the key provided on the command line, to have it accessible by future functions and |
| func GetGitHubClient(token string) (*github.Client, error) { | ||
| // getGitHubClient initializes a GitHub API client with an OAuth client for authentication, | ||
| // then makes an API request to confirm that the service is running and the auth token | ||
| // is valid |
| // commentDateFormat is the format used in the headers of JIRA comments | ||
| const commentDateFormat = "15:04 PM, January 2 2006" | ||
| // Execute provides a single function to run the root command and handle errors |
| // dateFormat is the format used for the `Last Issue-Sync Update` field. | ||
| const dateFormat = "2006-01-02T15:04:05-0700" | ||
| // commentDateFormat is the format used in the headers of JIRA comments |
| project jira.Project | ||
| // dryRun configures whether the application calls the create/update endpoints of the JIRA | ||
| // API, or just prints out the actions it would take. |
This commit adds documentation comments on all of the methods and variables in the file.
MorganEPatch
commented
Aug 7, 2017
@squat Those should be fixed. |
Depends on #10.
This PR introduces documentation comments to the entire command. This probably should have been done sooner.