You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2022/05/02 14:06:44 UTC

[lucene] branch main updated: Allow to link to github PR from changes (#854)

This is an automated email from the ASF dual-hosted git repository.

tomoko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 5f484698375 Allow to link to github PR from changes (#854)
5f484698375 is described below

commit 5f484698375e45bc0f93a7000cb6f59484b5d47e
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Mon May 2 23:06:39 2022 +0900

    Allow to link to github PR from changes (#854)
---
 .github/PULL_REQUEST_TEMPLATE.md                     |  1 -
 CONTRIBUTING.md                                      | 12 +++++++-----
 gradle/documentation/changes-to-html/changes2html.pl |  4 ++--
 lucene/CHANGES.txt                                   |  2 ++
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 509964e1f82..24eaa348a25 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -33,7 +33,6 @@ Please describe the tests you've developed or run to confirm this patch implemen
 Please review the following and check all that apply:
 
 - [ ] I have reviewed the guidelines for [How to Contribute](https://github.com/apache/lucene/blob/main/CONTRIBUTING.md) and my code conforms to the standards described there to the best of my ability.
-- [ ] I have created a Jira issue and added the issue ID to my pull request title.
 - [ ] I have given Lucene maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
 - [ ] I have developed this patch against the `main` branch.
 - [ ] I have run `./gradlew check`.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a1f062a15b2..79e778e9e7f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -72,13 +72,11 @@ You have two options to contribute your work: you can either create a patch and
 
 Please be patient. Committers are busy people too. If no one responds to your patch after a few days, please make friendly reminders. Please incorporate others' suggestions into into your patch if you think they're reasonable. Finally, remember that even a patch that is not committed is useful to the community.
 
-### Opening a Jira issue
-
-You may want to open a Jira issue before opening a pull request or creating a patch. This is especially required when adding a [CHANGES](./lucene/CHANGES.txt) entry. If your contribution is a small one (such as fixing typo in documentation) this can be optional.
-
 ### Opening a pull request
 
-Please refer to [GitHub's documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests) for an explanation of how to create a pull request. The pull request title should start with the Jira issue number that your work is related to, this way your pull request will get automatically linked from the Jira issue.
+Please refer to [GitHub's documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests) for an explanation of how to create a pull request.
+
+You can open a pull request with or without Jira issue. If there is an associated Jira issue, the pull request title should start with the Jira issue number that your work is related to, this way your pull request will get automatically linked from the Jira issue.
 
 ### Creating a patch
 
@@ -100,6 +98,10 @@ Patches should be attached to an issue in Jira.
 
 To enable automatic validation of Jira patches, switch the issue's status to "Patch Available" by clicking on the "Enable Patch Review" button near the top of the page. This will enqueue an ASF Jenkins job PreCommit-LUCENE-Build to run various quality checks on the patch and post a validation report as a comment (by "Lucene/Solr QA") on the issue. Expect a delay of 12 hours or so before the patch validation job actually runs. Note that in order for a patch file to trigger validation, its [...]
 
+### Add a CHANGES entry
+
+You may want to add a CHANGES entry to [CHANGES.txt](./lucene/CHANGES.txt). A CHANGES entry should start with the Jira issue key `LUCENE-XXXXX` or pull request number `GITHUB#XXX` that is followed by the description of the change and contributors' name. Please see the existing entries for reference.
+
 ## Stay involved
 
 Contributors should join the [Lucene mailing lists](https://lucene.apache.org/core/discussion.html). In particular, the commit list (to see changes as they are made), the dev list (to join discussions of changes) and the user list (to help others).
diff --git a/gradle/documentation/changes-to-html/changes2html.pl b/gradle/documentation/changes-to-html/changes2html.pl
index 0d55437721c..67a76ff5e94 100644
--- a/gradle/documentation/changes-to-html/changes2html.pl
+++ b/gradle/documentation/changes-to-html/changes2html.pl
@@ -25,7 +25,7 @@ use strict;
 use warnings;
 
 my $jira_url_prefix = 'http://issues.apache.org/jira/browse/';
-my $github_pull_request_prefix = 'https://github.com/apache/lucene-solr/pull/';
+my $github_pull_request_prefix = 'https://github.com/apache/lucene/pull/';
 my $month_regex = &setup_month_regex;
 my %month_nums = &setup_month_nums;
 my %lucene_bugzilla_jira_map = &setup_lucene_bugzilla_jira_map;
@@ -572,7 +572,7 @@ for my $rel (@releases) {
       $item =~ s{((LUCENE|SOLR|INFRA)\s+(\d{3,}))}
                 {<a href="${jira_url_prefix}\U$2\E-$3">$1</a>}gi;
       # Link "[ github | gh ] pull request [ # ] X+" to Github pull request
-      $item =~ s{((?:(?:(?:github|gh)\s+)?pull\s+request\s*(?:\#?\s*)?|gh-)(\d+))}
+      $item =~ s{((?:(?:(?:github|gh)\s+)?pull\s+request\s*(?:\#?\s*)?|gh-|github#)(\d+))}
                 {<a href="${github_pull_request_prefix}$2">$1</a>}gi;
       # Link "LUCENE_CHANGES.txt" to Lucene's same-release Changes.html
       if ($product eq 'SOLR') {
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index a9b8c4b0e29..91a13b44580 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -177,6 +177,8 @@ Other
 * LUCENE-10541: Test-framework: limit the default length of MockTokenizer tokens to 255.
   (Robert Muir, Uwe Schindler, Tomoko Uchida, Dawid Weiss)
 
+* GITHUB#854: Allow to link to GitHub pull request from CHANGES. (Tomoko Uchida, Jan Høydahl)
+
 ======================= Lucene 9.1.0 =======================
 
 API Changes