-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/oc/cli/admin/release: Issues from non-fist-parent commits
Sometimes a single pull request will address multiple issues, and listing them all in a PR subject is not feasible. With this commit, I iterate over all commits in the given range (merge or not), but only return a slice for the first-parent chain (which in most cases will be a series of merges to master). For commits that are part of the retrieved graph but which lie outside the first-parent chain, I find the nearest first-parent ancestor and attach any referenced issues to that ancestor. The new 'issue' structure sets the stage for future work to also support references to GitHub and other issue stores, although I haven't added extractors for those yet.
- Loading branch information
Showing
3 changed files
with
170 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package release | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
type issue struct { | ||
// Store for the issue, e.g. "rhbz" for https://bugzilla.redhat.com, or "origin" for https://github.com/openshift/origin/issues. | ||
Store string | ||
|
||
// ID for the issue, e.g. 123. | ||
ID int | ||
|
||
// URI for the issue, e.g. https://bugzilla.redhat.com/show_bug.cgi?id=123. | ||
URI string | ||
} | ||
|
||
func (i *issue) Markdown() string { | ||
return fmt.Sprintf("[%s#%d](%s)", i.Store, i.ID, i.URI) // TODO: proper escaping | ||
} |