Skip to content
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

Add TriagerX workflows #19745

Merged
merged 103 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
4dab053
Create TriageClosedIssue.yml
GioChkhaidze Jun 20, 2024
7a7165c
Create TriageOpenIssue.yml
GioChkhaidze Jun 20, 2024
99b309a
Change issue number
GioChkhaidze Jun 20, 2024
bb1aff4
Change issue number
GioChkhaidze Jun 20, 2024
a1f9bb8
Broke the URL
diyorbekibragimov Jun 24, 2024
fceb112
Fixed the URL
diyorbekibragimov Jun 24, 2024
340cf86
Merge branch 'eclipse-openj9:master' into master
diyorbekibragimov Jun 24, 2024
d2fb403
Updated the actual Sandbox Issue Number
Belami02 Jun 24, 2024
89a480d
Updated the Sandbox issue number (to the actual one)
Belami02 Jun 24, 2024
db0c746
Removed trailing whitespaces
diyorbekibragimov Jun 24, 2024
c367c09
fixed whitespaces and name and run-name
coolujain Jun 24, 2024
7309b46
made code clearer
ftm-2005 Jun 24, 2024
60e93d4
Set the github token under specific action
Belami02 Jun 27, 2024
0e1ee59
Set the github token under specific action
Belami02 Jun 27, 2024
c88a67c
Merge branch 'eclipse-openj9:master' into master
diyorbekibragimov Jun 28, 2024
bbf5e13
added the workflow for the triagerx model to also run when the commen…
diyorbekibragimov Jun 28, 2024
952359d
added the workflow for the triagerx model to also run when the commen…
diyorbekibragimov Jun 28, 2024
872ad2c
removed checkout repository step
diyorbekibragimov Jun 28, 2024
f525b8a
fixed a spelling issue
diyorbekibragimov Jun 28, 2024
ab8e791
broke the url for graceful failure test
diyorbekibragimov Jun 28, 2024
49363ec
fixed an error with the issueNumber
diyorbekibragimov Jun 28, 2024
a894bd9
fixed an error with the issueNumber
diyorbekibragimov Jun 28, 2024
7e70f58
Merge branch 'master' of https://github.com/Tigers-X/openj9
diyorbekibragimov Jun 28, 2024
f4ef216
fixed an error with the issueNumber
diyorbekibragimov Jun 28, 2024
ea99439
added a feature to collect a list of PR authors
diyorbekibragimov Jun 28, 2024
d37fea5
Debugging the feature added (PR)
Belami02 Jun 28, 2024
0aed6fc
Changed the sandbox number and the rest.issues (script@v7)
Belami02 Jun 28, 2024
d120048
Fixed the wrong name
Belami02 Jun 28, 2024
1e33ecd
Fixed newlines
Belami02 Jun 28, 2024
b5a6cbc
deleted code that we used for debugging purposes
coolujain Jun 28, 2024
b914ad3
delete console.log
diyorbekibragimov Jun 28, 2024
87b5c8e
delete console.log
diyorbekibragimov Jun 28, 2024
e7f68a7
Merge pull request #4 from Tigers-X/test
coolujain Jun 28, 2024
9c1ff0e
fixed syntax error
coolujain Jun 28, 2024
dc8929f
removed repititions
coolujain Jun 28, 2024
f426560
Update TriageClosedIssue.yml
coolujain Jun 28, 2024
487e5b4
added none when there's no components
coolujain Jun 28, 2024
026349e
Changed sandbox number
coolujain Jun 28, 2024
12731f0
changed the sandbox number to the actual one
diyorbekibragimov Jun 28, 2024
512d1bd
Removed trailing whitespaces (for PR)
diyorbekibragimov Jun 28, 2024
b93b841
Update TriageClosedIssue.yml
coolujain Jul 5, 2024
3c602ef
Update TriageClosedIssue.yml
coolujain Jul 5, 2024
a46e1b1
trying something
coolujain Jul 5, 2024
06d14ac
Update TriageOpenIssue.yml
coolujain Jul 5, 2024
05927e9
fixed error message
coolujain Jul 5, 2024
ad66083
fixed sandbox number
coolujain Jul 5, 2024
366eb24
fixed sandbox number
coolujain Jul 5, 2024
7ec1d97
fixed styling issues
diyorbekibragimov Jul 6, 2024
cd469c5
testing slack
diyorbekibragimov Jul 6, 2024
8011539
changed the sandox number
diyorbekibragimov Jul 6, 2024
511a3ad
Merge pull request #10 from Tigers-X/slackIntegration
diyorbekibragimov Jul 6, 2024
6f0c4e4
Create recommendation.js
ftm-2005 Jul 7, 2024
94794c3
delete duplicate code from recommendation.js
ftm-2005 Jul 7, 2024
462239a
deleted duplicate code from recommendation.js
ftm-2005 Jul 7, 2024
39095b0
added command to run recommendation.js
ftm-2005 Jul 7, 2024
291cbd7
Delete .github/workflows/recommendation.js
ftm-2005 Jul 7, 2024
bf02353
Create recommendation.js
ftm-2005 Jul 7, 2024
1e576ae
changes recommendation.js path
ftm-2005 Jul 7, 2024
fe7e288
Updated run command
ftm-2005 Jul 7, 2024
2af65e3
Debugging
GioChkhaidze Jul 7, 2024
3e4cc9c
Update triggerTriagerx.yml
GioChkhaidze Jul 7, 2024
46774ee
Updated code to run recommendation.js
ftm-2005 Jul 7, 2024
87a3248
Update triggerTriagerx.yml
GioChkhaidze Jul 7, 2024
afba06b
Update triggerTriagerx.yml
GioChkhaidze Jul 7, 2024
18cf944
Delete second recommendation
GioChkhaidze Jul 7, 2024
aa72217
Update recommendation.js
GioChkhaidze Jul 7, 2024
8478254
Updated the file with async function
Belami02 Jul 7, 2024
d966d2f
Added the actions-github
Belami02 Jul 7, 2024
e503289
Added installation of required modules
Belami02 Jul 7, 2024
6a103c1
Updated the code to use process environment
Belami02 Jul 7, 2024
1a32b5d
Delete core
GioChkhaidze Jul 7, 2024
5df610f
Delete core, axios and github actions from script
GioChkhaidze Jul 7, 2024
3f1a42c
Add core to recommendation.js
GioChkhaidze Jul 7, 2024
00424f2
Added checking node version we are using
Belami02 Jul 7, 2024
d616da9
Specified the axios version to use
Belami02 Jul 7, 2024
528f761
Added an upgrade of node version
Belami02 Jul 7, 2024
e3e8076
Fixed the issues that came with new version of node.js
Belami02 Jul 7, 2024
a922914
Initialized core and github again
Belami02 Jul 7, 2024
be25e2f
FIxed the problem with extracting issue details
Belami02 Jul 7, 2024
a17ca0b
Removed the github context
Belami02 Jul 7, 2024
11731a4
Update triggerTriagerx.yml
diyorbekibragimov Jul 7, 2024
312f90c
Removed .rest property
diyorbekibragimov Jul 7, 2024
816b136
added the issue number to the environment
diyorbekibragimov Jul 7, 2024
7cdd4ef
Added the issue number
diyorbekibragimov Jul 7, 2024
cab4c89
Update recommendation.js
diyorbekibragimov Jul 7, 2024
6d490df
Update triggerTriagerx.yml
diyorbekibragimov Jul 7, 2024
d3db4b9
Update triggerTriagerx.yml
diyorbekibragimov Jul 7, 2024
af4ec9b
added octokit for GITHUB API
diyorbekibragimov Jul 7, 2024
2f85c6c
added Github token to the environment
diyorbekibragimov Jul 7, 2024
9aa7db5
Fixed the code for external .js integration
diyorbekibragimov Jul 7, 2024
e0fb33a
Removed payload for issue number
diyorbekibragimov Jul 7, 2024
a3220f8
Update TriageOpenIssue.yml
diyorbekibragimov Jul 7, 2024
a119032
transformed issue number to string issue number
diyorbekibragimov Jul 7, 2024
98b6c0a
Delete .github/workflows/callSlack.yml
ftm-2005 Jul 7, 2024
8ff69f7
deleted trailing white spaces
ftm-2005 Jul 7, 2024
c9ca3f9
deleted trailing white spaces
ftm-2005 Jul 7, 2024
a528ffe
Update recommendation.js
diyorbekibragimov Jul 7, 2024
00c5710
Update TriageOpenIssue.yml
diyorbekibragimov Jul 7, 2024
ef0261d
Update TriageOpenIssue.yml
diyorbekibragimov Jul 7, 2024
8bb41b6
Update recommendation.js
diyorbekibragimov Jul 7, 2024
19ecce6
Added id to the step
diyorbekibragimov Jul 7, 2024
d38e817
Removed console.logs
diyorbekibragimov Jul 7, 2024
29bba29
Resolve the issue of trailing whitespaces and corrected the sandbox info
Belami02 Jul 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/TriageClosedIssue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Triager on Closed issues
run-name: TriagerX closed Issue

on:
issues:
types: [closed]
jobs:
issue_closed:
name: Issue Closed
runs-on: ubuntu-latest
steps:
- name: Commenting on the issue
uses: actions/github-script@v4
with:
script: |
Belami02 marked this conversation as resolved.
Show resolved Hide resolved
const { data: issueData } = await github.issues.get({
issue_number: context.payload.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});

console.log(issueData);

const commentsUrl = issueData.comments_url;
const { data: commentsData } = await github.request(commentsUrl);

const sandboxIssueNumber = 19673;
const sandboxOwner = context.repo.owner;
const sandboxRepo = context.repo.repo;

let assigned = false;
const actualLabels = issueData.labels.map(label => label['name']);

resultString = `Issue number: ${context.issue.number}\n`;
resultString += 'Status: Closed\n';
resultString += `Actual Components: ${actualLabels.join(', ')}\n`;

// Filtering the Comments Data to find "FYI"
for (const comment of commentsData) {
const lowercaseCommentBody = comment.body.toLowerCase();
if (lowercaseCommentBody.includes("fyi")) {
const restCommentBody = lowercaseCommentBody.replace("fyi", "");
let profiles = restCommentBody.replace(/[^\w\s]/g, '');
profiles = profiles.trim().replace(/\s+/g, ', ');
resultString += `Actual Assignees: ${profiles}\n`;
assigned = true;
}
}

if (!assigned) {
if (issueData.assignees.length != 0) {
const assignees = issueData.assignees.map(assignee => assignee.login).join(', ');
resultString += `Actual Assignees: ${assignees}`;
} else {
resultString += "Actual Assignees: No one :(";
}
}
Belami02 marked this conversation as resolved.
Show resolved Hide resolved

await github.issues.createComment({
issue_number: sandboxIssueNumber,
owner: sandboxOwner,
repo: sandboxRepo,
body: resultString
});
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/TriageOpenIssue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Triager on Opened issues
run-name: TriagerX for opened issues

on:
issues:
types: [opened]

jobs:
issue_opened:
name: Issue Opened
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install axios

- name: commenting on issues
uses: actions/github-script@v4
with:
Belami02 marked this conversation as resolved.
Show resolved Hide resolved
script: |
const axios = require('axios');
const input = {
"issue_title": context.payload.issue.title,
"issue_description": context.payload.issue.body,
}

console.log('input: ', input)

const apiUrl = "http://140.211.168.122/recommendation";
const sandboxIssueNumber = 19673;
const sandboxOwner = context.repo.owner;
const sandboxRepo = context.repo.repo;

try {
const response = await axios.post(apiUrl, JSON.stringify(input), {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
});

const issueComment = response.data;
predictedAssignees = issueComment.recommended_developers;
predictedLabels = issueComment.recommended_components;

resultString = `Issue Number: ${context.issue.number}\n`;
resultString += 'Status: Open\n';
resultString += `Recommended Components: ${predictedLabels.join(', ')}\n`;
resultString += `Recommended Assignees: ${predictedAssignees.join(', ')}\n`;
await github.issues.createComment({
issue_number: sandboxIssueNumber,
owner: sandboxOwner,
repo: sandboxRepo,
body: resultString
});
} catch (error) {
await github.issues.createComment({
issue_number: sandboxIssueNumber,
owner: sandboxOwner,
repo: sandboxRepo,
body: `Error: ${error.message}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the comment is in a sandbox issue, we need to know which issue prediction failed, so the error message need to contain the issue numbers too.

});
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}