Skip to content

Commit

Permalink
Added some extra logging for missing commit info from github
Browse files Browse the repository at this point in the history
  • Loading branch information
ToreMerkely committed Sep 5, 2024
1 parent c2daa91 commit b2b8c9f
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion bin/never_alone/get_commit_and_pr_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,55 @@ function check_arguments
fi
}

function get_commit_data_using_graphql
{
local -r commit=$1; shift
gh api graphql \
-F commit="${commit}" \
-f query="$(gh repo view --json owner,name --jq '. |
"query($commit: String!) {
repository(owner: \"\(.owner.login)\", name: \"\(.name)\") {
object(expression: $commit) {
... on Commit {
author {
name
email
date
}
committer {
name
email
date
}
message
tree {
oid
}
associatedPullRequests(first: 1) {
nodes {
url
}
}
}
}
}
}"
')"
}


function get_never_alone_data
{
local -r commit=$1; shift
local -r result_file=$1; shift

pr_data=$(gh pr list --search "${commit}" --state merged --json author,reviews,mergeCommit,mergedAt,reviewDecision,url)
commit_data_graphql=$(get_commit_data_using_graphql $commit)
pr_data=$(gh pr list --search "${commit}" --state merged --json author,reviews,mergeCommit,mergedAt,reviewDecision,url)
commit_data=$(gh search commits --hash "${commit}" --json commit)

echo commit_data_graphql=$commit_data_graphql
echo commit_data=$commit_data

jq -n \
--arg sha "$commit" \
--argjson commit "$commit_data" \
Expand Down

0 comments on commit b2b8c9f

Please sign in to comment.