{"id":17133799,"url":"https://github.com/jeremyf/github_reporter","last_synced_at":"2026-07-01T17:31:46.388Z","repository":{"id":66373311,"uuid":"454164072","full_name":"jeremyf/github_reporter","owner":"jeremyf","description":"Query and report on a set of Github repositories over a period of time.","archived":false,"fork":false,"pushed_at":"2022-03-29T22:54:08.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T05:45:52.914Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeremyf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-01-31T20:44:56.000Z","updated_at":"2023-11-07T12:59:09.000Z","dependencies_parsed_at":"2023-02-21T04:31:10.894Z","dependency_job_id":null,"html_url":"https://github.com/jeremyf/github_reporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeremyf/github_reporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyf%2Fgithub_reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyf%2Fgithub_reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyf%2Fgithub_reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyf%2Fgithub_reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremyf","download_url":"https://codeload.github.com/jeremyf/github_reporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyf%2Fgithub_reporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35017089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"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":["ruby"],"created_at":"2024-10-14T19:43:04.286Z","updated_at":"2026-07-01T17:31:46.370Z","avatar_url":"https://github.com/jeremyf.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GithubReporter\n\nThis gem is responsible for querying and reporting on a set of repositories over a period of time.  It's been quickly fleshed out as a proof of concept.\n\nThe idea is to connect issues and pull requests, but also to identify pull requests that might not have tracked to issues.\n\n## Installation\n\nTBD.\n\n## Usage\n\nAt present there's not a tidy interface, but below is an example I used to build out the initial implementation.\n\nBefore you even get started you'll need a Github OAuth key.  Once you have that:\n\n```sh\nexport GITHUB_OAUTH_TOKEN=\"\u003cyour-oauth-token\u003e\"\n```\n\nFirst we want to establishing the reporting scope:\n\n```ruby\nscope = GithubReporter::Scope.new(\n  repository_names: [\"forem/rfcs\", \"forem/forem\"],\n  report_since_date: Time.parse(\"2022-01-01T00:00:00Z\"),\n  report_until_date: Time.parse(\"2022-02-01T00:00:00Z\")\n)\n```\n\nThen we fetch the remote information:\n\n```ruby\nfetcher = GithubReporter::Fetcher.new(scope: scope)\ndata_store = fetcher.call\n```\n\nSince fetching the remote information can be expensive, I cached the fetched results locally:\n\n```ruby\nFile.open(\"data_store_dump.txt\", \"w+\") do |f|\n  f.puts Marshal.dump(data_store)\nend\n```\n\nI could then load the local cached values to run the report:\n\n```ruby\ndata_store = Marshal.load(File.read(\"data_store_dump.txt\"))\n\nGithubReporter::Reporter.render(data_store: data_store, scope: scope, format: :csv)\n```\n\nAlternatively, if you don't want to use caching, you can use the `GithubReporter.run` method:\n\n```ruby\nGithubReporter.run(\n  since_date: \"2022-01-01\",\n  until_date: \"2022-02-01\",\n  repos: [\"forem/forem\", \"forem/rfcs\"],\n  format: :csv,\n  auth_token: ENV.fetch[\"GITHUB_OAUTH_TOKEN\"],\n  buffer: $stdout\n)\n```\n\nThe above will live query Github and render output to given buffer.\n\nOr if you'd prefer to write to a file:\n\n```ruby\nFile.open(\"report-2022-03.csv\", \"w+\") do |fbuffer|\n  GithubReporter.run(\n    format: :csv,\n    since_date: \"2022-03-01\",\n    until_date: \"2022-04-01\",\n    repos: [\"forem/forem\", \"forem/rfcs\"],\n    auth_token: ENV.fetch(\"GITHUB_OAUTH_TOKEN\"),\n    # This doesn't yet work\n    data_store: \"data_store.dump\",\n    buffer: fbuffer,\n    labels_to_report: [\"changelog: rollup\", \"changelog: spotlight\", \"changelog: advance\", \"changelog: none\"]\n  )\nend\n```\n\nAnd because I've run this a few times, I added a script (which I need to update the dates).\n\n```shell\n$ GITHUB_OAUTH_TOKEN=\u003cYOUR_TOKEN_HERE\u003e bundle exec ruby ./to_run.rb\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/jeremyf/github_reporter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyf%2Fgithub_reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremyf%2Fgithub_reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyf%2Fgithub_reporter/lists"}