-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_openlifu_edgeless_graph.sh
More file actions
executable file
·53 lines (45 loc) · 1.68 KB
/
create_openlifu_edgeless_graph.sh
File metadata and controls
executable file
·53 lines (45 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#
# create_openlifu_edgeless_graph.sh
#
# This master script orchestrates the extraction pipeline for all repositories.
# It calls sub-scripts to extract commits, commit-linked issues, and softreq issues.
#
set -e
REPOS=(
"github.com/OpenwaterHealth/SlicerOpenLIFU"
"github.com/OpenwaterHealth/OpenLIFU-python"
"github.com/OpenwaterHealth/OpenLIFU-app"
)
for REPO in "${REPOS[@]}"; do
REPO_NAME=$(basename "$REPO")
bash scripts/extract_commits.sh "$REPO"
bash scripts/extract_commit_linked_issues.sh "$REPO_NAME" 1
bash scripts/extract_softreq_issues.sh "$REPO_NAME"
done
# Create headers for issues.tsv and softreqs.tsv
HEADER="repo issue_number title body labels assignees state created_at updated_at comments type primary_key"
printf "%s\n" "$HEADER" > issues.tsv
printf "%s\n" "$HEADER" > softreqs.tsv
# Process commit-linked-issues
for FILE in commit-linked-issues/*/*.tsv; do
[ -e "$FILE" ] || continue # skip if no files
tail -n +2 "$FILE" | while IFS= read -r LINE; do
REPO=$(printf "%s" "$LINE" | cut -f1)
ISSUE_NUMBER=$(printf "%s" "$LINE" | cut -f2)
TYPE="issue"
PRIMARY_KEY="${REPO}${ISSUE_NUMBER}"
printf "%s\t%s\t%s\n" "$LINE" "$TYPE" "$PRIMARY_KEY" >> issues.tsv
done
done
# Process softreq-issues
for FILE in softreq-issues/*/*.tsv; do
[ -e "$FILE" ] || continue # skip if no files
tail -n +2 "$FILE" | while IFS= read -r LINE; do
REPO=$(printf "%s" "$LINE" | cut -f1)
ISSUE_NUMBER=$(printf "%s" "$LINE" | cut -f2)
TYPE="softreq"
PRIMARY_KEY="${REPO}${ISSUE_NUMBER}"
printf "%s\t%s\t%s\n" "$LINE" "$TYPE" "$PRIMARY_KEY" >> softreqs.tsv
done
done