You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by jo...@apache.org on 2021/04/18 19:08:43 UTC
[arrow-rs] 01/01: Removed bot comment about title and JIRA.
This is an automated email from the ASF dual-hosted git repository.
jorgecarleitao pushed a commit to branch fix-pr
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
commit a48f27c6da95659e343f78bc4342cd718e3692fd
Author: Jorge C. Leitao <jo...@gmail.com>
AuthorDate: Sun Apr 18 19:07:47 2021 +0000
Removed bot comment about title and JIRA.
---
.github/workflows/dev_pr.yml | 24 ------------
.github/workflows/dev_pr/link.js | 69 ---------------------------------
.github/workflows/dev_pr/title_check.js | 56 --------------------------
.github/workflows/dev_pr/title_check.md | 37 ------------------
4 files changed, 186 deletions(-)
diff --git a/.github/workflows/dev_pr.yml b/.github/workflows/dev_pr.yml
index 7b92b89..89bc776 100644
--- a/.github/workflows/dev_pr.yml
+++ b/.github/workflows/dev_pr.yml
@@ -35,30 +35,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Comment JIRA link
- if: |
- github.event_name == 'pull_request_target' &&
- (github.event.action == 'opened' ||
- github.event.action == 'edited')
- uses: actions/github-script@v3
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const script = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/dev_pr/link.js`);
- script({github, context});
-
- - name: Check title
- if: |
- github.event_name == 'pull_request_target' &&
- (github.event.action == 'opened' ||
- github.event.action == 'edited')
- uses: actions/github-script@v3
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const script = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/dev_pr/title_check.js`);
- script({github, context});
-
- name: Assign GitHub labels
if: |
github.event_name == 'pull_request_target' &&
diff --git a/.github/workflows/dev_pr/link.js b/.github/workflows/dev_pr/link.js
deleted file mode 100644
index 550a9cd..0000000
--- a/.github/workflows/dev_pr/link.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-function detectJIRAID(title) {
- if (!title) {
- return null;
- }
- const matched = /^(WIP:?\s*)?((ARROW|PARQUET)-\d+)/.exec(title);
- if (!matched) {
- return null;
- }
- return matched[2];
-}
-
-async function haveComment(github, context, pullRequestNumber, body) {
- const options = {
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pullRequestNumber,
- page: 1
- };
- while (true) {
- const response = await github.issues.listComments(options);
- if (response.data.some(comment => comment.body === body)) {
- return true;
- }
- if (!/;\s*rel="next"/.test(response.headers.link || "")) {
- break;
- }
- options.page++;
- }
- return false;
-}
-
-async function commentJIRAURL(github, context, pullRequestNumber, jiraID) {
- const jiraURL = `https://issues.apache.org/jira/browse/${jiraID}`;
- if (await haveComment(github, context, pullRequestNumber, jiraURL)) {
- return;
- }
- await github.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pullRequestNumber,
- body: jiraURL
- });
-}
-
-module.exports = async ({github, context}) => {
- const pullRequestNumber = context.payload.number;
- const title = context.payload.pull_request.title;
- const jiraID = detectJIRAID(title);
- if (jiraID) {
- await commentJIRAURL(github, context, pullRequestNumber, jiraID);
- }
-};
diff --git a/.github/workflows/dev_pr/title_check.js b/.github/workflows/dev_pr/title_check.js
deleted file mode 100644
index c1ebd9d..0000000
--- a/.github/workflows/dev_pr/title_check.js
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-const fs = require("fs");
-
-function haveJIRAID(title) {
- if (!title) {
- return false;
- }
- if (title.startsWith("MINOR: ")) {
- return true;
- }
- return /^(WIP:?\s*)?(ARROW|PARQUET)-\d+/.test(title);
-}
-
-async function commentOpenJIRAIssue(github, context, pullRequestNumber) {
- const {data: comments} = await github.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pullRequestNumber,
- per_page: 1
- });
- if (comments.length > 0) {
- return;
- }
- const commentPath = ".github/workflows/dev_pr/title_check.md";
- const comment = fs.readFileSync(commentPath).toString();
- await github.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pullRequestNumber,
- body: comment
- });
-}
-
-module.exports = async ({github, context}) => {
- const pullRequestNumber = context.payload.number;
- const title = context.payload.pull_request.title;
- if (!haveJIRAID(title)) {
- await commentOpenJIRAIssue(github, context, pullRequestNumber);
- }
-};
diff --git a/.github/workflows/dev_pr/title_check.md b/.github/workflows/dev_pr/title_check.md
deleted file mode 100644
index 1db9fcf..0000000
--- a/.github/workflows/dev_pr/title_check.md
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-Thanks for opening a pull request!
-
-If this is not a [minor PR](https://github.com/apache/arrow/blob/master/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on JIRA? https://issues.apache.org/jira/browse/ARROW
-
-Opening JIRAs ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
-
-Then could you also rename pull request title in the following format?
-
- ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}
-
-or
-
- MINOR: [${COMPONENT}] ${SUMMARY}
-
-See also:
-
- * [Other pull requests](https://github.com/apache/arrow/pulls/)
- * [Contribution Guidelines - How to contribute patches](https://arrow.apache.org/docs/developers/contributing.html#how-to-contribute-patches)