redhat-cop / ninja-points

Scripts for the ninja program that integrate with external channels, such as github, gitlab & trello
Apache License 2.0
9 stars 12 forks source link

getgroupprojectdata throws an error when collecting gitlab stats #63

Closed pdelashe closed 3 weeks ago

pdelashe commented 3 weeks ago

Hi!!

Can any of you review this script? as it has been throwing errors since the end of October..

2024-11-04T23:01 | Script Execution FAILED | /home/jboss/target/scripts/Gitlab/v1.16/gitlab-stats.py -s 2024-10-23 -o redhat-cop ERROR (stderr): Traceback (most recent call last): File "/home/jboss/target/scripts/Gitlab/v1.16/gitlab-stats.py", line 181, in groupmergerequests = getgroupprojectdata('mergerequests', session, gitlabserver, group, startdate, repomatcher) File "/home/jboss/target/scripts/Gitlab/v1.16/gitlab-stats.py", line 109, in getgroupprojectdata baseurl = "{0}/api/v4/groups/{1}/{2}".format(server, group["id"], datatype) KeyError: 'id' |  

2024-11-04T23:01 | Script Execution FAILED | /home/jboss/target/scripts/Gitlab.ServicesSupport/v1.16/gitlab-stats.py -s 2024-10-23 -o customer-success -m ^(.consulting-delivery-guides|.consulting-engagement-reports/cer-template)$ ERROR (stderr): Traceback (most recent call last): File "/home/jboss/target/scripts/Gitlab.ServicesSupport/v1.16/gitlab-stats.py", line 181, in groupmergerequests = getgroupprojectdata('mergerequests', session, gitlabserver, group, startdate, repomatcher) File "/home/jboss/target/scripts/Gitlab.ServicesSupport/v1.16/gitlab-stats.py", line 109, in getgroupprojectdata baseurl = "{0}/api/v4/groups/{1}/{2}".format(server, group["id"], datatype) KeyError: 'id'

Thank you!

branic commented 3 weeks ago

The problem is the Access Token for GitLab. I've verified locally that with a good access token the script works. A recent GitLab upgrade forced all tokens to have an expiration date and ones that did not had the expiration date set to Oct. 24th.

I think @sabre1041 or @matallen will need to fix the token as I don't have access (or know how) to do that.

sabre1041 commented 3 weeks ago

The problem is the Access Token for GitLab. I've verified locally that with a good access token the script works. A recent GitLab upgrade forced all tokens to have an expiration date and ones that did not had the expiration date set to Oct. 24th.

I think @sabre1041 or @matallen will need to fix the token as I don't have access (or know how) to do that.

I should be able to handle that one

pdelashe commented 3 weeks ago

Thank you sooo much!!!!!!!!!!!!

garethahealy commented 3 weeks ago

based on mails, looks like its been fixed