Skip to content

Commit d134698

Browse files
authored
Merge pull request #2788 from Rajalakshmi-Girish/edit-sync-bug-triage-board
Remove Type field details addition in sync-bug-triage-github-project-beta.sh
2 parents b381a48 + 10aad40 commit d134698

File tree

1 file changed

+3
-46
lines changed

1 file changed

+3
-46
lines changed

release-team/hack/sync-bug-triage-github-project-beta.sh

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,8 @@ milestone_pr_ids=()
4848

4949
## Function definitions
5050

51-
function get_field_ids_from_github_beta_project() {
52-
if [ "$1" == "project-id" ]
53-
then
54-
query='.data.organization.projectV2.id'
55-
elif [ "$1" == "type-id" ]
56-
then
57-
query='.data.organization.projectV2.fields.nodes[] | select(.name== "Type") | .id'
58-
elif [ "$1" == "issue-id" ]
59-
then
60-
query='.data.organization.projectV2.fields.nodes[] | select(.name== "Type") | .options[] | select(.name== "Issue") | .id'
61-
# for "pr-id"
62-
else
63-
query='.data.organization.projectV2.fields.nodes[] | select(.name== "Type") | .options[] | select(.name== "PR") | .id'
64-
fi
51+
function get_project_id_from_github_beta_project() {
52+
query='.data.organization.projectV2.id'
6553

6654
ID="$( gh api graphql -f query='
6755
query($org: String!, $number: Int!) {
@@ -91,30 +79,6 @@ function get_field_ids_from_github_beta_project() {
9179
}
9280

9381

94-
function add_items_to_github_beta_project {
95-
gh api graphql -f query='
96-
mutation (
97-
$project: ID!
98-
$item: ID!
99-
$type_field: ID!
100-
$option_id: String!
101-
) {
102-
set_issue_type: updateProjectV2ItemFieldValue(input: {
103-
projectId: $project
104-
itemId: $item
105-
fieldId: $type_field
106-
value: {
107-
singleSelectOptionId: $option_id
108-
}
109-
}) {
110-
projectV2Item {
111-
id
112-
}
113-
}
114-
}' -f project="${PROJECT_ID}" -f item="${1}" -f type_field="${TYPE_FIELD_ID}" -f option_id="${2}" --silent
115-
}
116-
117-
11882
echo 'Starting sync...'
11983
echo -e "[INFO] Fetching the list of open issues and PRs from k/k under the current release milestone, ${MILESTONE}"
12084

@@ -191,10 +155,7 @@ done
191155
## Fetch Project metadata
192156
echo -e "[INFO] Getting metadata for the Bug Triage GitHub Beta Project with ID: ${PROJECT_NUMBER}"
193157

194-
PROJECT_ID=$( get_field_ids_from_github_beta_project "project-id")
195-
TYPE_FIELD_ID=$( get_field_ids_from_github_beta_project "type-id")
196-
ISSUE_OPTION_ID=$( get_field_ids_from_github_beta_project "issue-id")
197-
PR_OPTION_ID=$( get_field_ids_from_github_beta_project "pr-id")
158+
PROJECT_ID=$( get_project_id_from_github_beta_project)
198159

199160

200161
## Add data to the Project Board
@@ -212,8 +173,6 @@ do
212173
}
213174
}
214175
}' -f project="${PROJECT_ID}" -f issue="${issue_id}" --jq '.data.addProjectV2ItemById.item.id')"
215-
216-
add_items_to_github_beta_project "${item_id}" "${ISSUE_OPTION_ID}"
217176
fi
218177
done
219178

@@ -231,8 +190,6 @@ do
231190
}
232191
}
233192
}' -f project="${PROJECT_ID}" -f pr="${pr_id}" --jq '.data.addProjectV2ItemById.item.id')"
234-
235-
add_items_to_github_beta_project "${item_id}" "${PR_OPTION_ID}"
236193
fi
237194
done
238195

0 commit comments

Comments
 (0)