{"id":20155305,"url":"https://github.com/redhat-cop/ninja-points","last_synced_at":"2025-07-25T13:03:22.530Z","repository":{"id":27376463,"uuid":"113366864","full_name":"redhat-cop/ninja-points","owner":"redhat-cop","description":"Scripts for the ninja program that integrate with external channels, such as github, gitlab \u0026 trello","archived":false,"fork":false,"pushed_at":"2024-03-14T20:34:53.000Z","size":95,"stargazers_count":9,"open_issues_count":10,"forks_count":12,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-09T22:11:22.089Z","etag":null,"topics":["core-cop","giveback"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-cop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-06T21:01:02.000Z","updated_at":"2024-09-08T21:08:34.000Z","dependencies_parsed_at":"2024-03-14T21:48:13.305Z","dependency_job_id":"6bbe36eb-a29e-4c74-a7e5-03dcf45a5b37","html_url":"https://github.com/redhat-cop/ninja-points","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/redhat-cop/ninja-points","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fninja-points","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fninja-points/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fninja-points/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fninja-points/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-cop","download_url":"https://codeload.github.com/redhat-cop/ninja-points/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fninja-points/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267009621,"owners_count":24020636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["core-cop","giveback"],"created_at":"2024-11-13T23:31:28.726Z","updated_at":"2025-07-25T13:03:22.509Z","avatar_url":"https://github.com/redhat-cop.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ninja-points\n\nThis repo helps us calculate point values from contributions from our various communication channels.\n\n## GitHub contributions\n\nFor contributions to GitHub, we use search filters to find people's contributions. You can run these from [github.com/pulls](https://github.com/pulls)\n\n### Bugfix Pull Request\n\nFor example, to find all eligible bugfix pull requests:\n\n```\nis:merged is:pr archived:false user:redhat-cop author:etsauer updated:\u003e=2017-03-01 -label:enhancement\n```\n\n### Enhancement Pull Request\n\n```\nis:merged is:pr archived:false user:redhat-cop label:enhancement author:etsauer updated:\u003e=2017-03-01\n```\n\n### Reviewed pull requests\n\n```\nis:merged is:pr archived:false user:redhat-cop reviewed-by:etsauer updated:\u003e=2017-03-01\n```\n\n### Closed Issues\n\n```\nis:closed is:issue archived:false user:redhat-cop assignee:etsauer updated:\u003e=2017-03-01\n```\n\n### Script\n\nA script called [github-stats.py](github-stats.py) is available to automate the aggregation of statistics from the [redhat-cop GitHub organization](https://github.com/redhat-cop).\n\nTo be able to query the GitHub API, create a new [Personal Access Token](https://github.com/settings/tokens). Configure a key with at least read access.\n\nThen configure the `GITHUB_API_TOKEN` environment variable as follows:\n\n```\nexport GITHUB_API_TOKEN='\u003cAPI_KEY\u003e'\n```\n\nExecute the script:\n\n```\n$ ./github-stats.py\n\n=== Statistics for GitHub Organization 'redhat-cop' ====\n\n== General PR's ==\n\nenhancement:\n  csmith - 1\n    ninja-points - Enhancement to GitHub script\n```\n\nBy default, the script uses a search range from March 1 of a calendar year to the present. To specify an alternate date, use the `--start-date` argument such as `--start-date=2017-09-01`.\n\nTo limit to a specific user, the `--username` parameter can be specified.\n\nTo filter by labels, the `--labels` parameter can be specified followed by a series of comma separated labels. To limit the results containing a label, add a `-` at the end of the label name, such as `bugfix-` Note: Positive and negative logic cannot be combined.\n\n\n## Trello\n\n### Cards Completed By Member worth 2 points\n\n```\nlist:Done member:andrewblock edited:365 name:\"\\(2\\)\"\n```\n\n### Script\n\nA script called [trello-stats.py](trello-stats.py) is available to automate the aggregation of statistics of cards within an organization\n\nFirst, get an API key [here](https://trello.com/app-key)\n\nThen, configure the following variables:\n\n```\nexport TRELLO_API_KEY='\u003cAPI_KEY\u003e'\nexport TRELLO_API_TOKEN='\u003cAPI_TOKEN\u003e'\n```\n\nExecute the script:\n\n```\n$ ./trello-stats.py\n=== Statistics for Trello Team 'Red Hat CoP' ====\n\ncsmith has 2 cards\n   - Board: RHEL Platform | Card: Document SELinux Booleans\n   - Board: OpenShift Container Platform | Card: Add input field to product page\n\njdoe has 1 cards\n   - Board: OpenShift Container Platform | Card: E2E Test Enhancements\n```\n\nBy default, the script uses a search range from March 1 of a calendar year to the present. To specify an alternate date, use the `--start-date` argument such as `--start-date=2017-09-01`.\n\nTo limit to a specific user, the `--username` parameter can be specified.\n\nAdditional queries can be generated by referencing the following:\n\nhttp://help.trello.com/article/808-searching-for-cards-all-boards\n\n## GitLab\n\n### Script\n\nA script called [gitlab-stats.py](gitlab-stats.py) contributions made within within an organization.\n\nTo be able to query the GitLab API, create a new [Personal Access Token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html).\n\nThen configure the `GITLAB_API_TOKEN` environment variable as follows:\n\n```\nexport GITLAB_API_TOKEN='\u003cAPI_KEY\u003e'\n```\n\nExecute the script:\n\n```\n$ ./gitlab-stats.py\n\n=== Statistics for GitLab Group 'redhat-cop' ====\n\n== Merged MR's ==\n\ndhowe - 1\n  ninja-points - Minor change to GitLab script\n```\n\n## RocketChat\n\n### Script\n\nA script called [rocketchat.py](rocketchat.py) is available to automate statistics from [RocketChat](https://rocket.chat/).\n\nConfigure the following variables:\n\n```\nexport ROCKETCHAT_USERNAME='\u003cROCKETCHAT_USERNAME\u003e'\nexport ROCKETCHAT_PASSWORD='\u003cROCKETCHAT_PASSWORD\u003e'\n```\n\nExecute the script:\n\n```\n$ ./rocketchat.py -d 2 -f \"#cop-channel\" \n=== Rocketchat Statistics For 03/27/2018 - 03/29/2018 ===\n\n#emerging-tech\n  2 Users Joined\n  0 Users Removed\n  14 Messages\n    * jdoe - 64.29% - 9 Messages\n    * mmurray - 28.57% - 4 Messages\n    * csmart - 7.14% - 1 Message\n#dev-ops\n  8 Users Joined\n  1 Users Removed\n  10 Messages\n    * jdoe - 40.00% - 4 Messages\n    * mmurray - 30.00% - 3 Messages\n    * csmart - 20.00% - 2 Messages\n    * ashore - 10.00% - 1 Message\n```\n\nThe script queries channels with a particular description as specified by the `-f` parameter and the number of days to search in the past using the `-d` parameter.\n\n## Google Hangouts Chat\n\n### Script\n\nA script called [hangouts-chat.py](hangouts-chat.py) is available to automate statistics from [Google Hangouts Chat](https://chat.google.com).\n\nA service account token file is used to authenticate to the Google. Configure the following variable specifying the location of this file:\n\n```\nexport SERVICE_ACCOUNT_KEY_FILE='\u003cSERVICE_ACCOUNT_KEY_FILE\u003e'\n```\n\nExecute the script:\n\n```\n$ ./hangouts-chat.py\n=== Statistics for Google Hangouts Chat\n\n- containers - 55 Members\n- openshift-development - 311 Members\n```\n\n## Mailman\n\n### Script\n\nA script called [mailman-subscribers.py](mailman-subscribers.py) is available to collect statistics based on mailing list subscriptions.\n\nExecute the script:\n\n```\n$ ./mailman-subscribers [ options ] hostname listname password\n\nashore@redhat.com\ncsmart@redhat.com\nmmurray@redhat.com\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-cop%2Fninja-points","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-cop%2Fninja-points","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-cop%2Fninja-points/lists"}