Skip to content

Commit eaaa1dc

Browse files
Merge pull request #4824 from linuxfoundation/unicron-4820
Updates for #4820
2 parents 5296a0e + c32c305 commit eaaa1dc

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

cla-backend/cla/models/github_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def update_merge_group_status(
707707

708708
# Create the commit status on the merge commit
709709
if self.client is None:
710-
self.client = self._get_github_client(installation_id)
710+
self.client = get_github_integration_client(installation_id)
711711

712712
# Get repository
713713
cla.log.debug(f"{fn} - Getting repository by ID: {repository_id}")

set-easycla-github-token.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
export GITHUB_OAUTH_TOKEN="$(cat ./easycla-github-oauth-token.secret)"

utils/copy_prod_case_7.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
repo_id=$(STAGE=prod ./utils/scan.sh repositories repository_name 'fluxnova-modeler' | jq -r '.[0].repository_id.S')
3+
./utils/copy_prod_to_dev.sh repositories repository_id "${repo_id}"
4+
STAGE=dev ./utils/scan.sh repositories repository_name 'fluxnova-modeler'

utils/github_pat_check.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
# Quick test for GitHub PAT GraphQL permissions
3+
# ./utils/github_pat_check.sh "$(cat ./easycla-github-oauth-token.secret)" finos fluxnova-modeler 85
4+
# ./utils/github_pat_check.sh "$(cat /etc/github/oauth)" cncf devstats 114
5+
6+
if ( [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] )
7+
then
8+
echo "Usage: $0 YOUR_GITHUB_TOKEN org repo pr-number"
9+
echo "Example: $0 ghp_xxxxxxxxxxxxxxxxxxxx cncf devstats 114"
10+
exit 1
11+
fi
12+
13+
TOKEN="$1"
14+
ORG="$2"
15+
REPO="$3"
16+
PR="$4"
17+
echo "Testing GitHub PAT GraphQL with token: ${TOKEN:0:4} for $ORG/$REPO PR:$PR..."
18+
19+
echo -e "\n1. Testing Simple GraphQL Query:"
20+
echo "--------------------------------"
21+
curl -s -H "Authorization: Bearer $TOKEN" \
22+
-H "Content-Type: application/json" \
23+
-d '{"query":"query { viewer { login } }"}' \
24+
https://api.github.com/graphql
25+
26+
echo -e "\n\n2. Checking Token Scopes:"
27+
echo "------------------------"
28+
curl -s -I -H "Authorization: Bearer $TOKEN" \
29+
https://api.github.com/user | grep -i "x-oauth-scopes" || echo "No scopes header found"
30+
31+
echo -e "\n\n3. Testing Repository Access:"
32+
echo "----------------------------"
33+
curl -s -H "Authorization: Bearer $TOKEN" \
34+
-H "Content-Type: application/json" \
35+
-d '{"query":"query { repository(owner:\"'"$ORG"'\", name:\"'"$REPO"'\") { name } }"}' \
36+
https://api.github.com/graphql
37+
38+
echo -e "\n\n4. Testing PR Commits (the failing query):"
39+
echo "------------------------------------------"
40+
curl -s -H "Authorization: Bearer $TOKEN" \
41+
-H "Content-Type: application/json" \
42+
-d '{"query":"query { repository(owner:\"'"$ORG"'\", name:\"'"$REPO"'\") { pullRequest(number:'$PR') { commits(first:1) { nodes { commit { oid } } } } } }"}' \
43+
https://api.github.com/graphql
44+
45+
echo -e "\n"

0 commit comments

Comments
 (0)