Skip to content

Commit

Permalink
GH-44934: [Dev] Remove JIRA remnants (#44936)
Browse files Browse the repository at this point in the history
### Rationale for this change

We are not using JIRA anymore in the project

### What changes are included in this PR?

Remove JIRA from:
- documentation
- pr and issue templates
- comment bot
- merge script

### Are these changes tested?

Via CI

### Are there any user-facing changes?

No
* GitHub Issue: #44934

Lead-authored-by: Raúl Cumplido <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
  • Loading branch information
3 people authored Dec 5, 2024
1 parent 8ac434f commit fe32a7d
Show file tree
Hide file tree
Showing 15 changed files with 138 additions and 559 deletions.
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ issues][3] for the Apache Arrow project. Comment on the issue and/or contact
[[email protected]](https://lists.apache.org/[email protected])
with your questions and ideas.

If you’d like to report a bug but don’t have time to fix it, you can still post
it on JIRA, or email the mailing list
If you’d like to report a bug but don’t have time to fix it, you can still create
a GitHub issue, or email the mailing list
[[email protected]](https://lists.apache.org/[email protected])

To contribute a patch:
Expand All @@ -57,8 +57,8 @@ harder to merge in a large change with a lot of disjoint features.
GitHub](https://github.com/apache/arrow/issues).
3. Submit the patch as a GitHub pull request against the main branch. For a
tutorial, see the GitHub guides on [forking a repo](https://help.github.com/en/articles/fork-a-repo)
and [sending a pull request](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork). So that your pull request syncs with the JIRA issue, prefix your pull request
name with the JIRA issue id (ex: [ARROW-767: [C++] Filesystem abstraction](https://github.com/apache/arrow/pull/4225))
and [sending a pull request](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork). Prefix your pull request
name with the GitHub issue id (ex: [GH-767: [C++] Filesystem abstraction](https://github.com/apache/arrow/pull/4225))
4. Make sure that your code passes the unit tests. You can find instructions
how to run the unit tests for each Arrow component in its respective README
file.
Expand Down
4 changes: 0 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ or
MINOR: [${COMPONENT}] ${SUMMARY}
In the case of PARQUET issues on JIRA the title also supports:
PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
-->

### Rationale for this change
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
shell: bash
run: |
gem install test-unit
pip install "cython>=0.29.31" setuptools pytest jira setuptools-scm
pip install "cython>=0.29.31" setuptools pytest requests setuptools-scm
- name: Run Release Test
env:
ARROW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
ref: main
persist-credentials: false

- name: Comment JIRA link
- name: Add Issue link
if: |
(github.event.action == 'opened' ||
github.event.action == 'edited')
Expand Down
31 changes: 2 additions & 29 deletions .github/workflows/dev_pr/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ const https = require('https');
* @returns {Issue} or null if no issue detected.
*
* @typedef {Object} Issue
* @property {string} kind - The kind of issue: minor, jira or github
* @property {string} id - The id of the issue:
* PARQUET-XXXX for jira
* The numeric issue id for github
* @property {string} kind - The kind of issue: minor or github
* @property {string} id - The numeric issue id of the issue
*/
function detectIssue(title) {
if (!title) {
Expand All @@ -36,38 +34,13 @@ function detectIssue(title) {
if (title.startsWith("MINOR: ")) {
return {"kind": "minor"};
}
const matched_jira = /^(WIP:?\s*)?((PARQUET)-\d+)/.exec(title);
if (matched_jira) {
return {"kind": "jira", "id": matched_jira[2]};
}
const matched_gh = /^(WIP:?\s*)?GH-(\d+)/.exec(title);
if (matched_gh) {
return {"kind": "github", "id": matched_gh[2]};
}
return null;
}

/**
* Retrieves information about a JIRA issue.
* @param {String} jiraID
* @returns {Object} the information about a JIRA issue.
*/
async function getJiraInfo(jiraID) {
const jiraURL = `https://issues.apache.org/jira/rest/api/2/issue/${jiraID}`;

return new Promise((resolve) => {
https.get(jiraURL, res => {
let data = '';

res.on('data', chunk => { data += chunk })

res.on('end', () => {
resolve(JSON.parse(data));
})
})
});
}

/**
* Retrieves information about a GitHub issue.
* @param {String} issueID
Expand Down
91 changes: 1 addition & 90 deletions .github/workflows/dev_pr/issue_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,91 +17,6 @@

const helpers = require("./helpers.js");

/**
* Performs checks on the JIRA Issue:
* - The issue is started in JIRA.
* - The issue contains components.
*
* @param {Object} github
* @param {Object} context
* @param {String} pullRequestNumber
* @param {String} jiraID
*/
async function verifyJIRAIssue(github, context, pullRequestNumber, jiraID) {
const ticketInfo = await helpers.getJiraInfo(jiraID);
if(!ticketInfo["fields"]["components"].length) {
await commentMissingComponents(github, context, pullRequestNumber);
}

if(ticketInfo["fields"]["status"]["id"] == 1) {
// "status": {"name":"Open","id":"1"
// "description":"The issue is open and ready for the assignee to start work on it.",
await commentNotStartedTicket(github, context, pullRequestNumber);
}
}

/**
* Adds a comment to add components on the JIRA ticket.
*
* @param {Object} github
* @param {Object} context
* @param {String} pullRequestNumber
*/
async function commentMissingComponents(github, context, pullRequestNumber) {
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber,
per_page: 100
});

var found = false;
for(var i=0; i<comments.length; i++) {
if (comments[i].body.includes("has no components in JIRA")) {
found = true;
}
}
if (!found) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber,
body: ":warning: Ticket **has no components in JIRA**, make sure you assign one."
});
}
}

/**
* Adds a comment to start the ticket in JIRA.
*
* @param {Object} github
* @param {Object} context
* @param {String} pullRequestNumber
*/
async function commentNotStartedTicket(github, context, pullRequestNumber) {
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber,
per_page: 100
});

var found = false;
for(var i=0; i<comments.length; i++) {
if (comments[i].body.includes("has not been started in JIRA")) {
found = true;
}
}
if (!found) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber,
body: ":warning: Ticket **has not been started in JIRA**, please click 'Start Progress'."
});
}
}

/**
* Assigns the GitHub Issue to the PR creator.
*
Expand Down Expand Up @@ -164,10 +79,6 @@ module.exports = async ({github, context}) => {
const title = context.payload.pull_request.title;
const issue = helpers.detectIssue(title)
if (issue){
if (issue.kind == "jira") {
await verifyJIRAIssue(github, context, pullRequestNumber, issue.id);
} else if(issue.kind == "github") {
await verifyGitHubIssue(github, context, pullRequestNumber, issue.id);
}
await verifyGitHubIssue(github, context, pullRequestNumber, issue.id);
}
};
30 changes: 1 addition & 29 deletions .github/workflows/dev_pr/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,6 @@ async function haveComment(github, context, pullRequestNumber, message) {
return false;
}

/**
* Adds a comment on the Pull Request linking the JIRA issue.
*
* @param {Object} github
* @param {Object} context
* @param {String} pullRequestNumber
* @param {String} jiraID
*/
async function commentJIRAURL(github, context, pullRequestNumber, jiraID) {
const issueInfo = await helpers.getJiraInfo(jiraID);
const jiraURL = `https://issues.apache.org/jira/browse/${jiraID}`;
if (await haveComment(github, context, pullRequestNumber, jiraURL)) {
return;
}
if (issueInfo){
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber,
body: jiraURL
});
}
}

/**
* Adds a comment on the Pull Request linking the GitHub issue.
*
Expand Down Expand Up @@ -102,10 +78,6 @@ module.exports = async ({github, context}) => {
const title = context.payload.pull_request.title;
const issue = helpers.detectIssue(title);
if (issue){
if (issue.kind == "jira") {
await commentJIRAURL(github, context, pullRequestNumber, issue.id);
} else if (issue.kind == "github") {
await commentGitHubURL(github, context, pullRequestNumber, issue.id);
}
await commentGitHubURL(github, context, pullRequestNumber, issue.id);
}
};
4 changes: 0 additions & 4 deletions .github/workflows/dev_pr/title_check.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ or

MINOR: [${COMPONENT}] ${SUMMARY}

In the case of PARQUET issues on JIRA the title also supports:

PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

See also:

* [Other pull requests](https://github.com/apache/arrow/pulls/)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ To be assigned to an issue, add a comment "take" to that issue.

Before you create a new bug entry, we recommend you first search among existing
Arrow issues in
[Jira](https://issues.apache.org/jira/issues/?jql=project%20%3D%20ARROW%20AND%20status%20%3D%20Open)
or [GitHub](https://github.com/apache/arrow/issues).
[GitHub](https://github.com/apache/arrow/issues).

We conventionally prefix the issue title with the component
name in brackets, such as "[C++][Python] Ensure no validity bitmap in
Expand Down
9 changes: 1 addition & 8 deletions dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ you'll have to install Python dependencies yourself and then run
The merge script requires tokens for access control. There are two options
for configuring your tokens: environment variables or a configuration file.

> Note: Arrow only requires a GitHub token. Parquet can use GitHub or
JIRA tokens.
> Note: Arrow and Parquet only requires a GitHub token.
#### Pass tokens via Environment Variables

Expand All @@ -61,12 +60,6 @@ The merge script uses the GitHub REST API. You must set a
[Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
You need to add `workflow` scope to the Personal Access Token.

You can specify the
[Personal Access Token](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html)
of your JIRA account in the
`APACHE_JIRA_TOKEN` environment variable.
If the variable is not set, the script will ask you for it.

#### Pass tokens via configuration file

```
Expand Down
4 changes: 0 additions & 4 deletions dev/merge.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
# Configuration for the merge_arrow_pr.py tool
# Install a copy of this file at ~/.config/arrow/merge.conf

[jira]
# issues.apache.org Jira personal access token
token=abc123

[github]
# GitHub's personal access token. "workflow" scope is needed.
api_token=ghp_ABC
Loading

0 comments on commit fe32a7d

Please sign in to comment.