-
Notifications
You must be signed in to change notification settings - Fork 4.8k
pkg/oc/cli/admin/release: Issues from commit-body trailers #22186
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
Conversation
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. Ordinarily I'd use github.com/pkg/errors for the New() and Errorf() calls, but for some reason that's forbidden [1]: 2019/02/28 02:21:57 Inspecting imports under github.com/openshift/origin/pkg/oc... 2019/02/28 02:21:59 -- validating imports for 129 packages in the tree 2019/02/28 02:21:59 -- found forbidden imports for github.com/openshift/origin/pkg/oc/cli/admin/release: 2019/02/28 02:21:59 vendor/github.com/pkg/errors [1]: https://storage.googleapis.com/origin-ci-test/pr-logs/pull/22185/pull-ci-openshift-origin-master-verify/3302/build-log.txt
This allows devs to link to issues in GitHub or Bugzilla without cluttering up their commit subjects. `interpret-trailers` is from 2.2.0 [1]. [1]: https://github.com/git/git/blob/v2.2.0/Documentation/RelNotes/2.2.0.txt#L89-L90
Until our CI suite gets Git 2.2.0 or later and the interpret-trailers
command, so we don't get [1]:
<testcase name="TestCommitProcess/no_trailers" time="0.01">
<failure message="=== RUN TestCommitProcess/no_trailers
 --- FA ...">=== RUN TestCommitProcess/no_trailers
 --- FA ...</failure>
<system-out>=== RUN TestCommitProcess/no_trailers
 --- FAIL: TestCommitProcess/no_trailers (0.01s)
 	git_test.go:98: exit status 1
</system-out>
</testcase>
once we get a more recent Git (2.2.0 is 2014-11-26!), we can revert
this commit to get Git's more robust handling.
[1]: https://storage.googleapis.com/origin-ci-test/pr-logs/pull/22186/pull-ci-openshift-origin-master-unit/3767/artifacts/unit/unit_report_6x2xq.xml
ce74acb to
ab318eb
Compare
|
The unit failures: <testcase name="TestCommitProcess/no_trailers" time="0.01">
<failure message="=== RUN TestCommitProcess/no_trailers
 --- FA ...">=== RUN TestCommitProcess/no_trailers
 --- FA ...</failure>
<system-out>=== RUN TestCommitProcess/no_trailers
 --- FAIL: TestCommitProcess/no_trailers (0.01s)
 	git_test.go:98: exit status 1
</system-out>
</testcase>are probably because the test container's |
|
We'll need to properly document this pattern for commit messages, possibly with a handy git template to be copied 😉 |
soltysh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overall lgtm, let's get a closure on #22185 and we can get this one in.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soltysh, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@wking: PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
|
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
|
@openshift-bot: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Builds on #22185; review that first.
This allows devs to link to issues in GitHub or Bugzilla without cluttering up their commit subjects.
interpret-trailersis from 2.2.0. We could re-implement it in Go (maybe someone else already has?), but there are a number of upstream quirks around trailers (preceeding blank lines. Something about unfolding? Maybe more?), so I'd rather lean on existing code if possible.