From 325a0d5e03ca943190a59f5be99f4dbf229a497d Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Sat, 11 Jan 2025 23:57:28 -0500 Subject: [PATCH 01/18] wip: model additions --- receiver/githubreceiver/model.go | 109 +++++ .../githubreceiver/testdata/inprogress.json | 259 +++++++++++ .../githubreceiver/testdata/referenced.json | 410 ++++++++++++++++++ .../testdata/workflow-job-completed.json | 190 ++++++++ .../testdata/workflow-run-completed.json | 401 +++++++++++++++++ receiver/githubreceiver/trace_receiver.go | 235 ++++++++++ ...eceiver_test.go => trace_receiver_test.go} | 0 receiver/githubreceiver/traces_receiver.go | 133 ------ 8 files changed, 1604 insertions(+), 133 deletions(-) create mode 100644 receiver/githubreceiver/model.go create mode 100644 receiver/githubreceiver/testdata/inprogress.json create mode 100644 receiver/githubreceiver/testdata/referenced.json create mode 100644 receiver/githubreceiver/testdata/workflow-job-completed.json create mode 100644 receiver/githubreceiver/testdata/workflow-run-completed.json create mode 100644 receiver/githubreceiver/trace_receiver.go rename receiver/githubreceiver/{traces_receiver_test.go => trace_receiver_test.go} (100%) delete mode 100644 receiver/githubreceiver/traces_receiver.go diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go new file mode 100644 index 000000000000..5e91d68051a3 --- /dev/null +++ b/receiver/githubreceiver/model.go @@ -0,0 +1,109 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" + +// import ( +// conventions "go.opentelemetry.io/collector/semconv/v1.27.0" +// ) + +// model.go contains specific attributes from the 1.28 and 1.29 releases of +// SemConv. They are manually added due to issue +// https://github.com/open-telemetry/weaver/issues/227 which will migrate code +// gen to weaver. Once that is done, these attributes will be migrated to the +// semantic conventions package. + +const ( + // vcs.change.state with enum values of open, closed, or merged. + AttributeVCSChangeState = "vcs.change.state" + AttributeVCSChangeStateOpen = "open" + AttributeVCSChangeStateClosed = "closed" + AttributeVCSChangeStateMerged = "merged" + + // vcs.change.title + AttributeVCSChangeTitle = "vcs.change.title" + + // vcs.change.id + AttributeVCSChangeID = "vcs.change.id" + + // vcs.revision_delta.direction with enum values of behind or ahead. + AttributeVCSRevisionDeltaDirection = "vcs.revision_delta.direction" + AttributeVCSRevisionDeltaDirectionBehind = "behind" + AttributeVCSRevisionDeltaDirectionAhead = "ahead" + + // vcs.line_change.type with enum values of added or removed. + AttributeVCSLineChangeType = "vcs.line_change.type" + AttributeVCSLineChangeTypeAdded = "added" + AttributeVCSLineChangeTypeRemoved = "removed" + + // vcs.ref.type with enum values of branch or tag. + AttributeVCSRefType = "vcs.ref.type" + AttributeVCSRefTypeBranch = "branch" + AttributeVCSRefTypeTag = "tag" + + // vcs.repository.name + AttributeVCSRepositoryName = "vcs.repository.name" + + // vcs.ref.base.name + AttributeVCSRefBase = "vcs.ref.base" + + // vcs.ref.base.revision + AttributeVCSRefBaseRevision = "vcs.ref.base.revision" + + //vcs.ref.base.type with enum values of branch or tag. + AttributeVCSRefBaseType = "vcs.ref.base.type" + AttributeVCSRefBaseTypeBranch = "branch" + AttributeVCSRefBaseTypeTag = "tag" + + // vcs.ref.head.name + AttributeVCSRefHead = "vcs.ref.head" + + // vcs.ref.head.revision + AttributeVCSRefHeadRevision = "vcs.ref.head.revision" + + // vcs.ref.head.type with enum values of branch or tag. + AttributeVCSRefHeadType = "vcs.ref.head.type" + AttributeVCSRefHeadTypeBranch = "branch" + AttributeVCSRefHeadTypeTag = "tag" + + // The following prototype attributes that do not exist yet in semconv. + // They are highly experimental and subject to change. + + AttributeCICDPipelineRunURLFull = "cicd.pipeline.run.url.full" // equivalent to GitHub's `html_url` + + // These are being added in https://github.com/open-telemetry/semantic-conventions/pull/1681 + AttributeCICDPipelineRunStatus = "cicd.pipeline.run.status" // equivalent to GitHub's `conclusion` + AttributeCICDPipelineRunStatusSuccess = "success" + AttributeCICDPipelineRunStatusFailure = "failure" + AttributeCICDPipelineRunStatusCancellation = "cancellation" + AttributeCICDPipelineRunStatusError = "error" + AttributeCICDPipelineRunStatusSkip = "skip" + + AttributeCICDPipelineTaskRunStatus = "cicd.pipeline.run.task.status" // equivalent to GitHub's `conclusion` + AttributeCICDPipelineTaskRunStatusSuccess = "success" + AttributeCICDPipelineTaskRunStatusFailure = "failure" + AttributeCICDPipelineTaskRunStatusCancellation = "cancellation" + AttributeCICDPipelineTaskRunStatusError = "error" + AttributeCICDPipelineTaskRunStatusSkip = "skip" + + // TODO: Evaluate these + AttributeCICDPipelineRunSenderLogin = "cicd.pipeline.run.sender.login" // GitHub's Run Sender Login + AttributeCICDPipelineTaskRunSenderLogin = "cicd.pipeline.task.run.sender.login" // GitHub's Task Sender Login + AttributeVCSVendorName = "vcs.vendor.name" // GitHub + AttributeVCSRepositoryOwner = "vcs.repository.owner" // GitHub's Owner Login + + AttributeCICDPipelineFilePath = "cicd.pipeline.file.path" // GitHub's Path in workflow_run + // path + // previous attempt + // referenced workflows + // author email name & committer, message + // pr url + // status vs conclusion + // associated changes (prs) + // run attempt + // installation (for the github app) + + + + +) diff --git a/receiver/githubreceiver/testdata/inprogress.json b/receiver/githubreceiver/testdata/inprogress.json new file mode 100644 index 000000000000..5c55931f06a8 --- /dev/null +++ b/receiver/githubreceiver/testdata/inprogress.json @@ -0,0 +1,259 @@ +{ + "action": "completed", + "workflow_job": { + "id": 35483677182, + "run_id": 12730579163, + "workflow_name": "Build and Test", + "head_branch": "main", + "run_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163", + "run_attempt": 1, + "node_id": "CR_kwDONmpY-M8AAAAIQv3x_g", + "head_sha": "eaf8da32bca9be5ba3943cb6273ee473819f4b9a", + "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/jobs/35483677182", + "html_url": "https://github.com/liatrio/golang-demo-app/actions/runs/12730579163/job/35483677182", + "status": "completed", + "conclusion": "success", + "created_at": "2025-01-12T04:51:42Z", + "started_at": "2025-01-12T04:51:48Z", + "completed_at": "2025-01-12T04:52:53Z", + "name": "call-workflow-passing-data / test (1.23)", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2025-01-12T04:51:47Z", + "completed_at": "2025-01-12T04:51:48Z" + }, + { + "name": "Run actions/checkout@v4", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2025-01-12T04:51:48Z", + "completed_at": "2025-01-12T04:51:49Z" + }, + { + "name": "Set up Go", + "status": "completed", + "conclusion": "success", + "number": 3, + "started_at": "2025-01-12T04:51:49Z", + "completed_at": "2025-01-12T04:51:51Z" + }, + { + "name": "Make test", + "status": "completed", + "conclusion": "success", + "number": 4, + "started_at": "2025-01-12T04:51:51Z", + "completed_at": "2025-01-12T04:52:47Z" + }, + { + "name": "Upload coverage to Codecov", + "status": "completed", + "conclusion": "success", + "number": 5, + "started_at": "2025-01-12T04:52:48Z", + "completed_at": "2025-01-12T04:52:51Z" + }, + { + "name": "Post Set up Go", + "status": "completed", + "conclusion": "success", + "number": 9, + "started_at": "2025-01-12T04:52:51Z", + "completed_at": "2025-01-12T04:52:51Z" + }, + { + "name": "Post Run actions/checkout@v4", + "status": "completed", + "conclusion": "success", + "number": 10, + "started_at": "2025-01-12T04:52:53Z", + "completed_at": "2025-01-12T04:52:53Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 11, + "started_at": "2025-01-12T04:52:52Z", + "completed_at": "2025-01-12T04:52:52Z" + } + ], + "check_run_url": "https://api.github.com/repos/liatrio/golang-demo-app/check-runs/35483677182", + "labels": [ + "ubuntu-latest" + ], + "runner_id": 238, + "runner_name": "GitHub Actions 212", + "runner_group_id": 2, + "runner_group_name": "GitHub Actions" + }, + "repository": { + "id": 912939256, + "node_id": "R_kgDONmpY-A", + "name": "golang-demo-app", + "full_name": "liatrio/golang-demo-app", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/golang-demo-app", + "description": "Golang demo app", + "fork": false, + "url": "https://api.github.com/repos/liatrio/golang-demo-app", + "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", + "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", + "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", + "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", + "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", + "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", + "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", + "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments", + "created_at": "2025-01-06T17:47:15Z", + "updated_at": "2025-01-12T04:51:41Z", + "pushed_at": "2025-01-12T04:51:39Z", + "git_url": "git://github.com/liatrio/golang-demo-app.git", + "ssh_url": "git@github.com:liatrio/golang-demo-app.git", + "clone_url": "https://github.com/liatrio/golang-demo-app.git", + "svn_url": "https://github.com/liatrio/golang-demo-app", + "homepage": null, + "size": 106, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Go", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 10, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "go" + ], + "visibility": "internal", + "forks": 0, + "open_issues": 10, + "watchers": 0, + "default_branch": "main", + "custom_properties": { + "service_name": "golang-demo-app", + "team_name": "tag-o11y" + } + }, + "organization": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "url": "https://api.github.com/orgs/liatrio", + "repos_url": "https://api.github.com/orgs/liatrio/repos", + "events_url": "https://api.github.com/orgs/liatrio/events", + "hooks_url": "https://api.github.com/orgs/liatrio/hooks", + "issues_url": "https://api.github.com/orgs/liatrio/issues", + "members_url": "https://api.github.com/orgs/liatrio/members{/member}", + "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" + }, + "enterprise": { + "id": 9988, + "slug": "liatrio-partnerdemo", + "name": "Liatrio", + "node_id": "E_kgDNJwQ", + "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", + "description": "", + "website_url": "", + "html_url": "https://github.com/enterprises/liatrio-partnerdemo", + "created_at": "2021-11-02T23:03:56Z", + "updated_at": "2023-09-19T00:04:56Z" + }, + "sender": { + "login": "adrielp", + "id": 25961386, + "node_id": "MDQ6VXNlcjI1OTYxMzg2", + "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/adrielp", + "html_url": "https://github.com/adrielp", + "followers_url": "https://api.github.com/users/adrielp/followers", + "following_url": "https://api.github.com/users/adrielp/following{/other_user}", + "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", + "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", + "organizations_url": "https://api.github.com/users/adrielp/orgs", + "repos_url": "https://api.github.com/users/adrielp/repos", + "events_url": "https://api.github.com/users/adrielp/events{/privacy}", + "received_events_url": "https://api.github.com/users/adrielp/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "installation": { + "id": 52902335, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" + } +} diff --git a/receiver/githubreceiver/testdata/referenced.json b/receiver/githubreceiver/testdata/referenced.json new file mode 100644 index 000000000000..57d4c67a3e30 --- /dev/null +++ b/receiver/githubreceiver/testdata/referenced.json @@ -0,0 +1,410 @@ +{ + "action": "completed", + "workflow_run": { + "id": 12730579163, + "name": "Build and Test", + "node_id": "WFR_kwLONmpY-M8AAAAC9s042w", + "head_branch": "main", + "head_sha": "eaf8da32bca9be5ba3943cb6273ee473819f4b9a", + "path": ".github/workflows/build.yml", + "display_title": "build(deps): bump golang.org/x/crypto in /internal/tools (#2)", + "run_number": 66, + "event": "push", + "status": "completed", + "conclusion": "success", + "workflow_id": 136621389, + "check_suite_id": 32953541673, + "check_suite_node_id": "CS_kwDONmpY-M8AAAAHrC8kKQ", + "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163", + "html_url": "https://github.com/liatrio/golang-demo-app/actions/runs/12730579163", + "pull_requests": [ + + ], + "created_at": "2025-01-12T04:51:41Z", + "updated_at": "2025-01-12T04:55:27Z", + "actor": { + "login": "adrielp", + "id": 25961386, + "node_id": "MDQ6VXNlcjI1OTYxMzg2", + "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/adrielp", + "html_url": "https://github.com/adrielp", + "followers_url": "https://api.github.com/users/adrielp/followers", + "following_url": "https://api.github.com/users/adrielp/following{/other_user}", + "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", + "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", + "organizations_url": "https://api.github.com/users/adrielp/orgs", + "repos_url": "https://api.github.com/users/adrielp/repos", + "events_url": "https://api.github.com/users/adrielp/events{/privacy}", + "received_events_url": "https://api.github.com/users/adrielp/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "run_attempt": 1, + "referenced_workflows": [ + { + "path": "liatrio/tag-o11y-github-actions/.github/workflows/build.yml@d8def4264d3756a6b94615bfd3cbdb2ddd4cd3cc", + "sha": "d8def4264d3756a6b94615bfd3cbdb2ddd4cd3cc" + } + ], + "run_started_at": "2025-01-12T04:51:41Z", + "triggering_actor": { + "login": "adrielp", + "id": 25961386, + "node_id": "MDQ6VXNlcjI1OTYxMzg2", + "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/adrielp", + "html_url": "https://github.com/adrielp", + "followers_url": "https://api.github.com/users/adrielp/followers", + "following_url": "https://api.github.com/users/adrielp/following{/other_user}", + "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", + "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", + "organizations_url": "https://api.github.com/users/adrielp/orgs", + "repos_url": "https://api.github.com/users/adrielp/repos", + "events_url": "https://api.github.com/users/adrielp/events{/privacy}", + "received_events_url": "https://api.github.com/users/adrielp/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/jobs", + "logs_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/logs", + "check_suite_url": "https://api.github.com/repos/liatrio/golang-demo-app/check-suites/32953541673", + "artifacts_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/artifacts", + "cancel_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/cancel", + "rerun_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/rerun", + "previous_attempt_url": null, + "workflow_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/workflows/136621389", + "head_commit": { + "id": "eaf8da32bca9be5ba3943cb6273ee473819f4b9a", + "tree_id": "bfbe708f1c900ee902b17c98368933d51887dd6c", + "message": "build(deps): bump golang.org/x/crypto in /internal/tools (#2)\n\nBumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.29.0 to 0.31.0.\n- [Commits](https://github.com/golang/crypto/compare/v0.29.0...v0.31.0)\n\n---\nupdated-dependencies:\n- dependency-name: golang.org/x/crypto\n dependency-type: indirect\n...\n\nSigned-off-by: dependabot[bot] \nCo-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>", + "timestamp": "2025-01-12T04:51:38Z", + "author": { + "name": "dependabot[bot]", + "email": "49699333+dependabot[bot]@users.noreply.github.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 912939256, + "node_id": "R_kgDONmpY-A", + "name": "golang-demo-app", + "full_name": "liatrio/golang-demo-app", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/golang-demo-app", + "description": "Golang demo app", + "fork": false, + "url": "https://api.github.com/repos/liatrio/golang-demo-app", + "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", + "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", + "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", + "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", + "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", + "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", + "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", + "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments" + }, + "head_repository": { + "id": 912939256, + "node_id": "R_kgDONmpY-A", + "name": "golang-demo-app", + "full_name": "liatrio/golang-demo-app", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/golang-demo-app", + "description": "Golang demo app", + "fork": false, + "url": "https://api.github.com/repos/liatrio/golang-demo-app", + "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", + "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", + "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", + "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", + "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", + "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", + "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", + "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments" + } + }, + "workflow": { + "id": 136621389, + "node_id": "W_kwDONmpY-M4IJK1N", + "name": "Build and Test", + "path": ".github/workflows/build.yml", + "state": "active", + "created_at": "2025-01-06T17:47:19.000Z", + "updated_at": "2025-01-06T20:53:09.000Z", + "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/workflows/136621389", + "html_url": "https://github.com/liatrio/golang-demo-app/blob/main/.github/workflows/build.yml", + "badge_url": "https://github.com/liatrio/golang-demo-app/workflows/Build%20and%20Test/badge.svg" + }, + "repository": { + "id": 912939256, + "node_id": "R_kgDONmpY-A", + "name": "golang-demo-app", + "full_name": "liatrio/golang-demo-app", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/golang-demo-app", + "description": "Golang demo app", + "fork": false, + "url": "https://api.github.com/repos/liatrio/golang-demo-app", + "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", + "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", + "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", + "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", + "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", + "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", + "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", + "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments", + "created_at": "2025-01-06T17:47:15Z", + "updated_at": "2025-01-12T04:51:41Z", + "pushed_at": "2025-01-12T04:51:39Z", + "git_url": "git://github.com/liatrio/golang-demo-app.git", + "ssh_url": "git@github.com:liatrio/golang-demo-app.git", + "clone_url": "https://github.com/liatrio/golang-demo-app.git", + "svn_url": "https://github.com/liatrio/golang-demo-app", + "homepage": null, + "size": 106, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Go", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 10, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "go" + ], + "visibility": "internal", + "forks": 0, + "open_issues": 10, + "watchers": 0, + "default_branch": "main", + "custom_properties": { + "service_name": "golang-demo-app", + "team_name": "tag-o11y" + } + }, + "organization": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "url": "https://api.github.com/orgs/liatrio", + "repos_url": "https://api.github.com/orgs/liatrio/repos", + "events_url": "https://api.github.com/orgs/liatrio/events", + "hooks_url": "https://api.github.com/orgs/liatrio/hooks", + "issues_url": "https://api.github.com/orgs/liatrio/issues", + "members_url": "https://api.github.com/orgs/liatrio/members{/member}", + "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" + }, + "enterprise": { + "id": 9988, + "slug": "liatrio-partnerdemo", + "name": "Liatrio", + "node_id": "E_kgDNJwQ", + "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", + "description": "", + "website_url": "", + "html_url": "https://github.com/enterprises/liatrio-partnerdemo", + "created_at": "2021-11-02T23:03:56Z", + "updated_at": "2023-09-19T00:04:56Z" + }, + "sender": { + "login": "adrielp", + "id": 25961386, + "node_id": "MDQ6VXNlcjI1OTYxMzg2", + "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/adrielp", + "html_url": "https://github.com/adrielp", + "followers_url": "https://api.github.com/users/adrielp/followers", + "following_url": "https://api.github.com/users/adrielp/following{/other_user}", + "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", + "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", + "organizations_url": "https://api.github.com/users/adrielp/orgs", + "repos_url": "https://api.github.com/users/adrielp/repos", + "events_url": "https://api.github.com/users/adrielp/events{/privacy}", + "received_events_url": "https://api.github.com/users/adrielp/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "installation": { + "id": 52902335, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" + } +} diff --git a/receiver/githubreceiver/testdata/workflow-job-completed.json b/receiver/githubreceiver/testdata/workflow-job-completed.json new file mode 100644 index 000000000000..f64e8d0e9c35 --- /dev/null +++ b/receiver/githubreceiver/testdata/workflow-job-completed.json @@ -0,0 +1,190 @@ +{ + "action": "completed", + "workflow_job": { + "id": 35483121697, + "run_id": 12719320830, + "workflow_name": "Release", + "head_branch": "main", + "run_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12719320830", + "run_attempt": 1, + "node_id": "CR_kwDOLaz6mc8AAAAIQvV4IQ", + "head_sha": "3dd4d0f1d80f389d5849adb029f7398d8d0f8bc1", + "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/jobs/35483121697", + "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo/runs/35483121697", + "status": "completed", + "conclusion": "success", + "created_at": "2025-01-12T04:07:01Z", + "started_at": "2025-01-12T04:07:01Z", + "completed_at": "2025-01-12T04:07:02Z", + "name": "Test Report", + "steps": [ + + ], + "check_run_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/check-runs/35483121697", + "labels": [ + + ], + "runner_id": null, + "runner_name": null, + "runner_group_id": null, + "runner_group_name": null + }, + "repository": { + "id": 766311065, + "node_id": "R_kgDOLaz6mQ", + "name": "k8s-platform-v3-monorepo", + "full_name": "liatrio/k8s-platform-v3-monorepo", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", + "description": "Liatrio Multi-Tenant Kubernetes Platform", + "fork": false, + "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo", + "forks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/forks", + "keys_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/teams", + "hooks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/events", + "assignees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/tags", + "blobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscription", + "commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/merges", + "archive_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/downloads", + "issues_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/deployments", + "created_at": "2024-03-02T22:47:40Z", + "updated_at": "2025-01-11T00:24:04Z", + "pushed_at": "2025-01-11T08:31:59Z", + "git_url": "git://github.com/liatrio/k8s-platform-v3-monorepo.git", + "ssh_url": "git@github.com:liatrio/k8s-platform-v3-monorepo.git", + "clone_url": "https://github.com/liatrio/k8s-platform-v3-monorepo.git", + "svn_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", + "homepage": "https://kpv3.liatr.io/", + "size": 52025, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Go", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "has_discussions": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 166, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "k8s-platform-v3" + ], + "visibility": "internal", + "forks": 2, + "open_issues": 166, + "watchers": 0, + "default_branch": "main", + "custom_properties": { + "service_name": "kpv3-core-platform", + "team_name": "tag-k8s" + } + }, + "organization": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "url": "https://api.github.com/orgs/liatrio", + "repos_url": "https://api.github.com/orgs/liatrio/repos", + "events_url": "https://api.github.com/orgs/liatrio/events", + "hooks_url": "https://api.github.com/orgs/liatrio/hooks", + "issues_url": "https://api.github.com/orgs/liatrio/issues", + "members_url": "https://api.github.com/orgs/liatrio/members{/member}", + "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" + }, + "enterprise": { + "id": 9988, + "slug": "liatrio-partnerdemo", + "name": "Liatrio", + "node_id": "E_kgDNJwQ", + "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", + "description": "", + "website_url": "", + "html_url": "https://github.com/enterprises/liatrio-partnerdemo", + "created_at": "2021-11-02T23:03:56Z", + "updated_at": "2023-09-19T00:04:56Z" + }, + "sender": { + "login": "gdsmith1", + "id": 123333011, + "node_id": "U_kgDOB1npkw", + "avatar_url": "https://avatars.githubusercontent.com/u/123333011?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gdsmith1", + "html_url": "https://github.com/gdsmith1", + "followers_url": "https://api.github.com/users/gdsmith1/followers", + "following_url": "https://api.github.com/users/gdsmith1/following{/other_user}", + "gists_url": "https://api.github.com/users/gdsmith1/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gdsmith1/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gdsmith1/subscriptions", + "organizations_url": "https://api.github.com/users/gdsmith1/orgs", + "repos_url": "https://api.github.com/users/gdsmith1/repos", + "events_url": "https://api.github.com/users/gdsmith1/events{/privacy}", + "received_events_url": "https://api.github.com/users/gdsmith1/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "installation": { + "id": 52902335, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" + } +} diff --git a/receiver/githubreceiver/testdata/workflow-run-completed.json b/receiver/githubreceiver/testdata/workflow-run-completed.json new file mode 100644 index 000000000000..d9f060d0dca7 --- /dev/null +++ b/receiver/githubreceiver/testdata/workflow-run-completed.json @@ -0,0 +1,401 @@ +{ + "action": "completed", + "workflow_run": { + "id": 12730301372, + "name": "Test", + "node_id": "WFR_kwLOLaz6mc8AAAAC9sj7vA", + "head_branch": "main", + "head_sha": "3dd4d0f1d80f389d5849adb029f7398d8d0f8bc1", + "path": ".github/workflows/test.yml", + "display_title": "Test", + "run_number": 10692, + "event": "schedule", + "status": "completed", + "conclusion": "success", + "workflow_id": 88543479, + "check_suite_id": 32953030627, + "check_suite_node_id": "CS_kwDOLaz6mc8AAAAHrCdX4w", + "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372", + "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372", + "pull_requests": [ + + ], + "created_at": "2025-01-12T04:05:35Z", + "updated_at": "2025-01-12T04:07:10Z", + "actor": { + "login": "blairdrummond", + "id": 10801138, + "node_id": "MDQ6VXNlcjEwODAxMTM4", + "avatar_url": "https://avatars.githubusercontent.com/u/10801138?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/blairdrummond", + "html_url": "https://github.com/blairdrummond", + "followers_url": "https://api.github.com/users/blairdrummond/followers", + "following_url": "https://api.github.com/users/blairdrummond/following{/other_user}", + "gists_url": "https://api.github.com/users/blairdrummond/gists{/gist_id}", + "starred_url": "https://api.github.com/users/blairdrummond/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/blairdrummond/subscriptions", + "organizations_url": "https://api.github.com/users/blairdrummond/orgs", + "repos_url": "https://api.github.com/users/blairdrummond/repos", + "events_url": "https://api.github.com/users/blairdrummond/events{/privacy}", + "received_events_url": "https://api.github.com/users/blairdrummond/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "run_attempt": 1, + "referenced_workflows": [ + + ], + "run_started_at": "2025-01-12T04:05:35Z", + "triggering_actor": { + "login": "blairdrummond", + "id": 10801138, + "node_id": "MDQ6VXNlcjEwODAxMTM4", + "avatar_url": "https://avatars.githubusercontent.com/u/10801138?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/blairdrummond", + "html_url": "https://github.com/blairdrummond", + "followers_url": "https://api.github.com/users/blairdrummond/followers", + "following_url": "https://api.github.com/users/blairdrummond/following{/other_user}", + "gists_url": "https://api.github.com/users/blairdrummond/gists{/gist_id}", + "starred_url": "https://api.github.com/users/blairdrummond/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/blairdrummond/subscriptions", + "organizations_url": "https://api.github.com/users/blairdrummond/orgs", + "repos_url": "https://api.github.com/users/blairdrummond/repos", + "events_url": "https://api.github.com/users/blairdrummond/events{/privacy}", + "received_events_url": "https://api.github.com/users/blairdrummond/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/jobs", + "logs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/logs", + "check_suite_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/check-suites/32953030627", + "artifacts_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/artifacts", + "cancel_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/cancel", + "rerun_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/rerun", + "previous_attempt_url": null, + "workflow_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/workflows/88543479", + "head_commit": { + "id": "3dd4d0f1d80f389d5849adb029f7398d8d0f8bc1", + "tree_id": "f51302143d266a49520d53487e000e8bf338d121", + "message": "fix: unhack argo (#3219)", + "timestamp": "2025-01-11T00:24:00Z", + "author": { + "name": "Gibson Smith", + "email": "123333011+gdsmith1@users.noreply.github.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 766311065, + "node_id": "R_kgDOLaz6mQ", + "name": "k8s-platform-v3-monorepo", + "full_name": "liatrio/k8s-platform-v3-monorepo", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", + "description": "Liatrio Multi-Tenant Kubernetes Platform", + "fork": false, + "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo", + "forks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/forks", + "keys_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/teams", + "hooks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/events", + "assignees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/tags", + "blobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscription", + "commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/merges", + "archive_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/downloads", + "issues_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/deployments" + }, + "head_repository": { + "id": 766311065, + "node_id": "R_kgDOLaz6mQ", + "name": "k8s-platform-v3-monorepo", + "full_name": "liatrio/k8s-platform-v3-monorepo", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", + "description": "Liatrio Multi-Tenant Kubernetes Platform", + "fork": false, + "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo", + "forks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/forks", + "keys_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/teams", + "hooks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/events", + "assignees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/tags", + "blobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscription", + "commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/merges", + "archive_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/downloads", + "issues_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/deployments" + } + }, + "workflow": { + "id": 88543479, + "node_id": "W_kwDOLaz6mc4FRxD3", + "name": "Test", + "path": ".github/workflows/test.yml", + "state": "active", + "created_at": "2024-03-06T00:16:51.000Z", + "updated_at": "2024-03-06T00:43:24.000Z", + "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/workflows/88543479", + "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo/blob/main/.github/workflows/test.yml", + "badge_url": "https://github.com/liatrio/k8s-platform-v3-monorepo/workflows/Test/badge.svg" + }, + "repository": { + "id": 766311065, + "node_id": "R_kgDOLaz6mQ", + "name": "k8s-platform-v3-monorepo", + "full_name": "liatrio/k8s-platform-v3-monorepo", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", + "description": "Liatrio Multi-Tenant Kubernetes Platform", + "fork": false, + "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo", + "forks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/forks", + "keys_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/teams", + "hooks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/events", + "assignees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/tags", + "blobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscription", + "commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/merges", + "archive_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/downloads", + "issues_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/deployments", + "created_at": "2024-03-02T22:47:40Z", + "updated_at": "2025-01-11T00:24:04Z", + "pushed_at": "2025-01-11T08:31:59Z", + "git_url": "git://github.com/liatrio/k8s-platform-v3-monorepo.git", + "ssh_url": "git@github.com:liatrio/k8s-platform-v3-monorepo.git", + "clone_url": "https://github.com/liatrio/k8s-platform-v3-monorepo.git", + "svn_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", + "homepage": "https://kpv3.liatr.io/", + "size": 52025, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Go", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "has_discussions": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 166, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "k8s-platform-v3" + ], + "visibility": "internal", + "forks": 2, + "open_issues": 166, + "watchers": 0, + "default_branch": "main", + "custom_properties": { + "service_name": "kpv3-core-platform", + "team_name": "tag-k8s" + } + }, + "organization": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "url": "https://api.github.com/orgs/liatrio", + "repos_url": "https://api.github.com/orgs/liatrio/repos", + "events_url": "https://api.github.com/orgs/liatrio/events", + "hooks_url": "https://api.github.com/orgs/liatrio/hooks", + "issues_url": "https://api.github.com/orgs/liatrio/issues", + "members_url": "https://api.github.com/orgs/liatrio/members{/member}", + "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" + }, + "enterprise": { + "id": 9988, + "slug": "liatrio-partnerdemo", + "name": "Liatrio", + "node_id": "E_kgDNJwQ", + "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", + "description": "", + "website_url": "", + "html_url": "https://github.com/enterprises/liatrio-partnerdemo", + "created_at": "2021-11-02T23:03:56Z", + "updated_at": "2023-09-19T00:04:56Z" + }, + "sender": { + "login": "blairdrummond", + "id": 10801138, + "node_id": "MDQ6VXNlcjEwODAxMTM4", + "avatar_url": "https://avatars.githubusercontent.com/u/10801138?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/blairdrummond", + "html_url": "https://github.com/blairdrummond", + "followers_url": "https://api.github.com/users/blairdrummond/followers", + "following_url": "https://api.github.com/users/blairdrummond/following{/other_user}", + "gists_url": "https://api.github.com/users/blairdrummond/gists{/gist_id}", + "starred_url": "https://api.github.com/users/blairdrummond/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/blairdrummond/subscriptions", + "organizations_url": "https://api.github.com/users/blairdrummond/orgs", + "repos_url": "https://api.github.com/users/blairdrummond/repos", + "events_url": "https://api.github.com/users/blairdrummond/events{/privacy}", + "received_events_url": "https://api.github.com/users/blairdrummond/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "installation": { + "id": 52902335, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" + } +} diff --git a/receiver/githubreceiver/trace_receiver.go b/receiver/githubreceiver/trace_receiver.go new file mode 100644 index 000000000000..129ce1fc46ac --- /dev/null +++ b/receiver/githubreceiver/trace_receiver.go @@ -0,0 +1,235 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" + +import ( + "context" + "errors" + "fmt" + "net/http" + "sync" + + "github.com/google/go-github/v68/github" + "github.com/gorilla/mux" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componentstatus" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receiverhelper" + // "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/ptrace" + "go.uber.org/zap" +) + +var errMissingEndpoint = errors.New("missing a receiver endpoint") + +const healthyResponse = `{"text": "GitHub receiver webhook is healthy"}` + +type githubTracesReceiver struct { + traceConsumer consumer.Traces + cfg *Config + server *http.Server + shutdownWG sync.WaitGroup + settings receiver.Settings + logger *zap.Logger + obsrecv *receiverhelper.ObsReport + ghClient *github.Client +} + +func newTracesReceiver( + params receiver.Settings, + config *Config, + traceConsumer consumer.Traces, +) (*githubTracesReceiver, error) { + if config.WebHook.Endpoint == "" { + return nil, errMissingEndpoint + } + + transport := "http" + if config.WebHook.TLSSetting != nil { + transport = "https" + } + + obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ + ReceiverID: params.ID, + Transport: transport, + ReceiverCreateSettings: params, + }) + if err != nil { + return nil, err + } + + client := github.NewClient(nil) + + gtr := &githubTracesReceiver{ + traceConsumer: traceConsumer, + cfg: config, + settings: params, + logger: params.Logger, + obsrecv: obsrecv, + ghClient: client, + } + + return gtr, nil +} + +func (gtr *githubTracesReceiver) Start(ctx context.Context, host component.Host) error { + endpoint := fmt.Sprintf("%s%s", gtr.cfg.WebHook.Endpoint, gtr.cfg.WebHook.Path) + gtr.logger.Info("Starting GitHub WebHook receiving server", zap.String("endpoint", endpoint)) + + // noop if not nil. if start has not been called before these values should be nil. + if gtr.server != nil && gtr.server.Handler != nil { + return nil + } + + // create listener from config + ln, err := gtr.cfg.WebHook.ServerConfig.ToListener(ctx) + if err != nil { + return err + } + + // use gorilla mux to set up a router + router := mux.NewRouter() + + // setup health route + router.HandleFunc(gtr.cfg.WebHook.HealthPath, gtr.handleHealthCheck) + + // setup webhook route for traces + router.HandleFunc(gtr.cfg.WebHook.Path, gtr.handleReq) + + // webhook server standup and configuration + gtr.server, err = gtr.cfg.WebHook.ServerConfig.ToServer(ctx, host, gtr.settings.TelemetrySettings, router) + if err != nil { + return err + } + + gtr.logger.Info("Health check now listening at", zap.String("health_path", gtr.cfg.WebHook.HealthPath)) + + gtr.shutdownWG.Add(1) + go func() { + defer gtr.shutdownWG.Done() + + if errHTTP := gtr.server.Serve(ln); !errors.Is(errHTTP, http.ErrServerClosed) && errHTTP != nil { + componentstatus.ReportStatus(host, componentstatus.NewFatalErrorEvent(errHTTP)) + } + }() + + return nil +} + +func (gtr *githubTracesReceiver) Shutdown(_ context.Context) error { + // server must exist to be closed. + if gtr.server == nil { + return nil + } + + err := gtr.server.Close() + gtr.shutdownWG.Wait() + return err +} + +// handleReq handles incoming request sent to the webhook endoint. On success +// returns a 200 response code. +func (gtr *githubTracesReceiver) handleReq(w http.ResponseWriter, req *http.Request) { + // ctx := gtr.obsrecv.StartTracesOp(req.Context()) + + p, err := github.ValidatePayload(req, []byte(gtr.cfg.WebHook.Secret)) + if err != nil { + gtr.logger.Sugar().Debugf("unable to validate payload", zap.Error(err)) + http.Error(w, "invalid payload", http.StatusBadRequest) + return + } + + eventType := github.WebHookType(req) + event, err := github.ParseWebHook(eventType, p) + if err != nil { + gtr.logger.Sugar().Debugf("failed to parse event", zap.Error(err)) + http.Error(w, "failed to parse event", http.StatusBadRequest) + return + } + + switch e := event.(type) { + case *github.WorkflowRunEvent: + if e.GetWorkflowRun().GetStatus() != "completed" { + gtr.logger.Debug("skipping non-completed WorkflowRunEvent", zap.String("status", e.GetWorkflowRun().GetStatus())) + w.WriteHeader(http.StatusNoContent) + return + } + return + case *github.WorkflowJobEvent: + if e.GetWorkflowJob().GetStatus() != "completed" { + gtr.logger.Debug("skipping non-completed WorkflowJobEvent", zap.String("status", e.GetWorkflowJob().GetStatus())) + w.WriteHeader(http.StatusNoContent) + return + } + return + default: + gtr.logger.Sugar().Debugf("event type not supported", zap.String("event_type", eventType)) + http.Error(w, "event type not supported", http.StatusBadRequest) + return + } + + // TODO: Figure this out + // gtr.obsrecv.EndTracesOp(ctx, "protobuf", td.SpanCount(), err) +} + +// Simple healthcheck endpoint. +func (gtr *githubTracesReceiver) handleHealthCheck(w http.ResponseWriter, _ *http.Request) { + w.Header().Add("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + + _, _ = w.Write([]byte(healthyResponse)) +} + +func (gtr *githubTracesReceiver) genSvcName(e interface{}) (string, error) { + // uses e.(type) + if e.(type) == *github.WorkflowRunEvent || e.(type) == *github.WorkflowJobEvent { + } + return nil, nil +} + +// maybe accept event.type here directly. +// func (gtr *githubTracesReceiver) eventToSpan(e interface{}) (ptrace.Traces, error) { +// t := ptrace.NewTraces() +// r := t.ResourceSpans().AppendEmpty() +// s := r.ScopeSpans().AppendEmpty() +// +// switch e := e.(type) { +// case *github.WorkflowJobEvent: +// jobResource := resourceSpans.Resource() +// createResourceAttributes(jobResource, e, config, logger) +// +// traceID, err := generateTraceID(e.GetWorkflowJob().GetRunID(), int(e.GetWorkflowJob().GetRunAttempt())) +// if err != nil { +// logger.Error("Failed to generate trace ID", zap.Error(err)) +// return ptrace.Traces{}, fmt.Errorf("failed to generate trace ID: %w", err) +// } +// +// parentSpanID := createParentSpan(scopeSpans, e.GetWorkflowJob().Steps, e.GetWorkflowJob(), traceID, logger) +// processSteps(scopeSpans, e.GetWorkflowJob().Steps, e.GetWorkflowJob(), traceID, parentSpanID, logger) +// +// case *github.WorkflowRunEvent: +// runResource := resourceSpans.Resource() +// +// traceID, err := generateTraceID(e.GetWorkflowRun().GetID(), e.GetWorkflowRun().GetRunAttempt()) +// if err != nil { +// logger.Error("Failed to generate trace ID", zap.Error(err)) +// return ptrace.Traces{}, fmt.Errorf("failed to generate trace ID: %w", err) +// } +// +// createResourceAttributes(runResource, e, config, logger) +// _, err = createRootSpan(resourceSpans, e, traceID, logger) +// if err != nil { +// logger.Error("Failed to create root span", zap.Error(err)) +// return ptrace.Traces{}, fmt.Errorf("failed to create root span: %w", err) +// } +// +// default: +// logger.Error("unknown event type, dropping payload") +// return ptrace.Traces{}, fmt.Errorf("unknown event type") +// } +// +// +// return nil, nil +// } diff --git a/receiver/githubreceiver/traces_receiver_test.go b/receiver/githubreceiver/trace_receiver_test.go similarity index 100% rename from receiver/githubreceiver/traces_receiver_test.go rename to receiver/githubreceiver/trace_receiver_test.go diff --git a/receiver/githubreceiver/traces_receiver.go b/receiver/githubreceiver/traces_receiver.go deleted file mode 100644 index 13486b70ab1d..000000000000 --- a/receiver/githubreceiver/traces_receiver.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" - -import ( - "context" - "errors" - "fmt" - "net/http" - "sync" - - "github.com/google/go-github/v68/github" - "github.com/gorilla/mux" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentstatus" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/receiver" - "go.opentelemetry.io/collector/receiver/receiverhelper" - "go.uber.org/zap" -) - -var errMissingEndpoint = errors.New("missing a receiver endpoint") - -const healthyResponse = `{"text": "GitHub receiver webhook is healthy"}` - -type githubTracesReceiver struct { - traceConsumer consumer.Traces - cfg *Config - server *http.Server - shutdownWG sync.WaitGroup - settings receiver.Settings - logger *zap.Logger - obsrecv *receiverhelper.ObsReport - ghClient *github.Client -} - -func newTracesReceiver( - params receiver.Settings, - config *Config, - traceConsumer consumer.Traces, -) (*githubTracesReceiver, error) { - if config.WebHook.Endpoint == "" { - return nil, errMissingEndpoint - } - - transport := "http" - if config.WebHook.TLSSetting != nil { - transport = "https" - } - - obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ - ReceiverID: params.ID, - Transport: transport, - ReceiverCreateSettings: params, - }) - if err != nil { - return nil, err - } - - client := github.NewClient(nil) - - gtr := &githubTracesReceiver{ - traceConsumer: traceConsumer, - cfg: config, - settings: params, - logger: params.Logger, - obsrecv: obsrecv, - ghClient: client, - } - - return gtr, nil -} - -func (gtr *githubTracesReceiver) Start(ctx context.Context, host component.Host) error { - endpoint := fmt.Sprintf("%s%s", gtr.cfg.WebHook.Endpoint, gtr.cfg.WebHook.Path) - gtr.logger.Info("Starting GitHub WebHook receiving server", zap.String("endpoint", endpoint)) - - // noop if not nil. if start has not been called before these values should be nil. - if gtr.server != nil && gtr.server.Handler != nil { - return nil - } - - // create listener from config - ln, err := gtr.cfg.WebHook.ServerConfig.ToListener(ctx) - if err != nil { - return err - } - - // use gorilla mux to set up a router - router := mux.NewRouter() - - // setup health route - router.HandleFunc(gtr.cfg.WebHook.HealthPath, gtr.handleHealthCheck) - - // webhook server standup and configuration - gtr.server, err = gtr.cfg.WebHook.ServerConfig.ToServer(ctx, host, gtr.settings.TelemetrySettings, router) - if err != nil { - return err - } - - gtr.logger.Info("Health check now listening at", zap.String("health_path", gtr.cfg.WebHook.HealthPath)) - - gtr.shutdownWG.Add(1) - go func() { - defer gtr.shutdownWG.Done() - - if errHTTP := gtr.server.Serve(ln); !errors.Is(errHTTP, http.ErrServerClosed) && errHTTP != nil { - componentstatus.ReportStatus(host, componentstatus.NewFatalErrorEvent(errHTTP)) - } - }() - - return nil -} - -func (gtr *githubTracesReceiver) Shutdown(_ context.Context) error { - // server must exist to be closed. - if gtr.server == nil { - return nil - } - - err := gtr.server.Close() - gtr.shutdownWG.Wait() - return err -} - -// Simple healthcheck endpoint. -func (gtr *githubTracesReceiver) handleHealthCheck(w http.ResponseWriter, _ *http.Request) { - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - _, _ = w.Write([]byte(healthyResponse)) -} From 4cacce05d06170ac3788c86e29452c22a307fa8c Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Sun, 12 Jan 2025 11:03:19 -0500 Subject: [PATCH 02/18] wip: add referenced version and additional non-working changes --- receiver/githubreceiver/model.go | 56 +-- .../testdata/referenced-version.json | 411 ++++++++++++++++++ receiver/githubreceiver/trace_receiver.go | 17 +- 3 files changed, 454 insertions(+), 30 deletions(-) create mode 100644 receiver/githubreceiver/testdata/referenced-version.json diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go index 5e91d68051a3..75d7c94f6a9c 100644 --- a/receiver/githubreceiver/model.go +++ b/receiver/githubreceiver/model.go @@ -3,9 +3,9 @@ package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" -// import ( -// conventions "go.opentelemetry.io/collector/semconv/v1.27.0" -// ) +import ( + semconv "go.opentelemetry.io/collector/semconv/v1.27.0" +) // model.go contains specific attributes from the 1.28 and 1.29 releases of // SemConv. They are manually added due to issue @@ -20,6 +20,7 @@ const ( AttributeVCSChangeStateClosed = "closed" AttributeVCSChangeStateMerged = "merged" + // TODO: Eveluate whether or not this should be a head title attribute // vcs.change.title AttributeVCSChangeTitle = "vcs.change.title" @@ -69,41 +70,46 @@ const ( // The following prototype attributes that do not exist yet in semconv. // They are highly experimental and subject to change. - AttributeCICDPipelineRunURLFull = "cicd.pipeline.run.url.full" // equivalent to GitHub's `html_url` + AttributeCICDPipelineRunURLFull = "cicd.pipeline.run.url.full" // equivalent to GitHub's `html_url` - // These are being added in https://github.com/open-telemetry/semantic-conventions/pull/1681 - AttributeCICDPipelineRunStatus = "cicd.pipeline.run.status" // equivalent to GitHub's `conclusion` + // These are being added in https://github.com/open-telemetry/semantic-conventions/pull/1681 + AttributeCICDPipelineRunStatus = "cicd.pipeline.run.status" // equivalent to GitHub's `conclusion` AttributeCICDPipelineRunStatusSuccess = "success" AttributeCICDPipelineRunStatusFailure = "failure" AttributeCICDPipelineRunStatusCancellation = "cancellation" AttributeCICDPipelineRunStatusError = "error" AttributeCICDPipelineRunStatusSkip = "skip" - AttributeCICDPipelineTaskRunStatus = "cicd.pipeline.run.task.status" // equivalent to GitHub's `conclusion` + AttributeCICDPipelineTaskRunStatus = "cicd.pipeline.run.task.status" // equivalent to GitHub's `conclusion` AttributeCICDPipelineTaskRunStatusSuccess = "success" AttributeCICDPipelineTaskRunStatusFailure = "failure" AttributeCICDPipelineTaskRunStatusCancellation = "cancellation" AttributeCICDPipelineTaskRunStatusError = "error" AttributeCICDPipelineTaskRunStatusSkip = "skip" - // TODO: Evaluate these - AttributeCICDPipelineRunSenderLogin = "cicd.pipeline.run.sender.login" // GitHub's Run Sender Login - AttributeCICDPipelineTaskRunSenderLogin = "cicd.pipeline.task.run.sender.login" // GitHub's Task Sender Login - AttributeVCSVendorName = "vcs.vendor.name" // GitHub - AttributeVCSRepositoryOwner = "vcs.repository.owner" // GitHub's Owner Login - - AttributeCICDPipelineFilePath = "cicd.pipeline.file.path" // GitHub's Path in workflow_run - // path - // previous attempt - // referenced workflows - // author email name & committer, message - // pr url - // status vs conclusion - // associated changes (prs) - // run attempt - // installation (for the github app) - - + // TODO: Evaluate these + AttributeCICDPipelineRunSenderLogin = "cicd.pipeline.run.sender.login" // GitHub's Run Sender Login + AttributeCICDPipelineTaskRunSenderLogin = "cicd.pipeline.task.run.sender.login" // GitHub's Task Sender Login + AttributeVCSVendorName = "vcs.vendor.name" // GitHub + AttributeVCSRepositoryOwner = "vcs.repository.owner" // GitHub's Owner Login + + AttributeCICDPipelineFilePath = "cicd.pipeline.file.path" // GitHub's Path in workflow_run + AttributeGitHubAppInstallationID = "github.app.installation.id" // GitHub's Installation ID + AttributeGitHubWorkflowRunAttempt = "github.workflow.run.attempt" // GitHub's Run Attempt + + // TODO: Evaluate whether or not these should be added. Always iffy on adding specific usernames and emails. + AttributeVCSRefHeadRevisionAuthorName = "vcs.ref.head.revision.author.name" // GitHub's Head Revision Author Name + AttributeVCSRefHeadRevisionAuthorEmail = "vcs.ref.head.revision.author.email" // GitHub's Head Revision Author Email + AttributeGitHubWorkflowTriggerActorUsername = "github.workflow.trigger.actor.username" // GitHub's Triggering Actor Username ) + +func (gtr *githubTracesReceiver) genServiceName() (string, error) { + // if config.CustomServiceName != "" { + // return config.CustomServiceName + // } + // formattedName := strings.ToLower(strings.ReplaceAll(strings.ReplaceAll(fullName, "/", "-"), "_", "-")) + // return fmt.Sprintf("%s%s%s", config.ServiceNamePrefix, formattedName, config.ServiceNameSuffix) + return "", nil +} diff --git a/receiver/githubreceiver/testdata/referenced-version.json b/receiver/githubreceiver/testdata/referenced-version.json new file mode 100644 index 000000000000..d9dd2e66c6f1 --- /dev/null +++ b/receiver/githubreceiver/testdata/referenced-version.json @@ -0,0 +1,411 @@ +{ + "action": "completed", + "workflow_run": { + "id": 12734274353, + "name": "Build and Test", + "node_id": "WFR_kwLONmpY-M8AAAAC9wWbMQ", + "head_branch": "main", + "head_sha": "15ecdce788097c7d6889a2890098e3a6a5f81a08", + "path": ".github/workflows/build.yml", + "display_title": "chore: see if referenced workflow with version propagates", + "run_number": 67, + "event": "push", + "status": "completed", + "conclusion": "success", + "workflow_id": 136621389, + "check_suite_id": 32960671609, + "check_suite_node_id": "CS_kwDONmpY-M8AAAAHrJvveQ", + "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353", + "html_url": "https://github.com/liatrio/golang-demo-app/actions/runs/12734274353", + "pull_requests": [ + + ], + "created_at": "2025-01-12T14:13:53Z", + "updated_at": "2025-01-12T14:17:43Z", + "actor": { + "login": "adrielp", + "id": 25961386, + "node_id": "MDQ6VXNlcjI1OTYxMzg2", + "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/adrielp", + "html_url": "https://github.com/adrielp", + "followers_url": "https://api.github.com/users/adrielp/followers", + "following_url": "https://api.github.com/users/adrielp/following{/other_user}", + "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", + "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", + "organizations_url": "https://api.github.com/users/adrielp/orgs", + "repos_url": "https://api.github.com/users/adrielp/repos", + "events_url": "https://api.github.com/users/adrielp/events{/privacy}", + "received_events_url": "https://api.github.com/users/adrielp/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "run_attempt": 1, + "referenced_workflows": [ + { + "path": "liatrio/tag-o11y-github-actions/.github/workflows/build.yml@v0.1.7", + "sha": "d8def4264d3756a6b94615bfd3cbdb2ddd4cd3cc", + "ref": "refs/tags/v0.1.7" + } + ], + "run_started_at": "2025-01-12T14:13:53Z", + "triggering_actor": { + "login": "adrielp", + "id": 25961386, + "node_id": "MDQ6VXNlcjI1OTYxMzg2", + "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/adrielp", + "html_url": "https://github.com/adrielp", + "followers_url": "https://api.github.com/users/adrielp/followers", + "following_url": "https://api.github.com/users/adrielp/following{/other_user}", + "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", + "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", + "organizations_url": "https://api.github.com/users/adrielp/orgs", + "repos_url": "https://api.github.com/users/adrielp/repos", + "events_url": "https://api.github.com/users/adrielp/events{/privacy}", + "received_events_url": "https://api.github.com/users/adrielp/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/jobs", + "logs_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/logs", + "check_suite_url": "https://api.github.com/repos/liatrio/golang-demo-app/check-suites/32960671609", + "artifacts_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/artifacts", + "cancel_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/cancel", + "rerun_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/rerun", + "previous_attempt_url": null, + "workflow_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/workflows/136621389", + "head_commit": { + "id": "15ecdce788097c7d6889a2890098e3a6a5f81a08", + "tree_id": "0c969850a4b97d1971ed7c1c1e6e06c13b28ead9", + "message": "chore: see if referenced workflow with version propagates", + "timestamp": "2025-01-12T14:13:50Z", + "author": { + "name": "Adriel Perkins", + "email": "adrielp@liatrio.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 912939256, + "node_id": "R_kgDONmpY-A", + "name": "golang-demo-app", + "full_name": "liatrio/golang-demo-app", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/golang-demo-app", + "description": "Golang demo app", + "fork": false, + "url": "https://api.github.com/repos/liatrio/golang-demo-app", + "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", + "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", + "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", + "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", + "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", + "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", + "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", + "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments" + }, + "head_repository": { + "id": 912939256, + "node_id": "R_kgDONmpY-A", + "name": "golang-demo-app", + "full_name": "liatrio/golang-demo-app", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/golang-demo-app", + "description": "Golang demo app", + "fork": false, + "url": "https://api.github.com/repos/liatrio/golang-demo-app", + "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", + "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", + "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", + "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", + "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", + "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", + "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", + "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments" + } + }, + "workflow": { + "id": 136621389, + "node_id": "W_kwDONmpY-M4IJK1N", + "name": "Build and Test", + "path": ".github/workflows/build.yml", + "state": "active", + "created_at": "2025-01-06T17:47:19.000Z", + "updated_at": "2025-01-06T20:53:09.000Z", + "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/workflows/136621389", + "html_url": "https://github.com/liatrio/golang-demo-app/blob/main/.github/workflows/build.yml", + "badge_url": "https://github.com/liatrio/golang-demo-app/workflows/Build%20and%20Test/badge.svg" + }, + "repository": { + "id": 912939256, + "node_id": "R_kgDONmpY-A", + "name": "golang-demo-app", + "full_name": "liatrio/golang-demo-app", + "private": true, + "owner": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liatrio", + "html_url": "https://github.com/liatrio", + "followers_url": "https://api.github.com/users/liatrio/followers", + "following_url": "https://api.github.com/users/liatrio/following{/other_user}", + "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", + "organizations_url": "https://api.github.com/users/liatrio/orgs", + "repos_url": "https://api.github.com/users/liatrio/repos", + "events_url": "https://api.github.com/users/liatrio/events{/privacy}", + "received_events_url": "https://api.github.com/users/liatrio/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liatrio/golang-demo-app", + "description": "Golang demo app", + "fork": false, + "url": "https://api.github.com/repos/liatrio/golang-demo-app", + "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", + "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", + "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", + "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", + "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", + "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", + "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", + "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", + "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", + "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", + "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", + "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", + "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", + "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", + "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", + "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", + "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", + "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", + "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", + "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments", + "created_at": "2025-01-06T17:47:15Z", + "updated_at": "2025-01-12T14:13:54Z", + "pushed_at": "2025-01-12T14:13:51Z", + "git_url": "git://github.com/liatrio/golang-demo-app.git", + "ssh_url": "git@github.com:liatrio/golang-demo-app.git", + "clone_url": "https://github.com/liatrio/golang-demo-app.git", + "svn_url": "https://github.com/liatrio/golang-demo-app", + "homepage": null, + "size": 107, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Go", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 10, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "go" + ], + "visibility": "internal", + "forks": 0, + "open_issues": 10, + "watchers": 0, + "default_branch": "main", + "custom_properties": { + "service_name": "golang-demo-app", + "team_name": "tag-o11y" + } + }, + "organization": { + "login": "liatrio", + "id": 5726618, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", + "url": "https://api.github.com/orgs/liatrio", + "repos_url": "https://api.github.com/orgs/liatrio/repos", + "events_url": "https://api.github.com/orgs/liatrio/events", + "hooks_url": "https://api.github.com/orgs/liatrio/hooks", + "issues_url": "https://api.github.com/orgs/liatrio/issues", + "members_url": "https://api.github.com/orgs/liatrio/members{/member}", + "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" + }, + "enterprise": { + "id": 9988, + "slug": "liatrio-partnerdemo", + "name": "Liatrio", + "node_id": "E_kgDNJwQ", + "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", + "description": "", + "website_url": "", + "html_url": "https://github.com/enterprises/liatrio-partnerdemo", + "created_at": "2021-11-02T23:03:56Z", + "updated_at": "2023-09-19T00:04:56Z" + }, + "sender": { + "login": "adrielp", + "id": 25961386, + "node_id": "MDQ6VXNlcjI1OTYxMzg2", + "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/adrielp", + "html_url": "https://github.com/adrielp", + "followers_url": "https://api.github.com/users/adrielp/followers", + "following_url": "https://api.github.com/users/adrielp/following{/other_user}", + "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", + "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", + "organizations_url": "https://api.github.com/users/adrielp/orgs", + "repos_url": "https://api.github.com/users/adrielp/repos", + "events_url": "https://api.github.com/users/adrielp/events{/privacy}", + "received_events_url": "https://api.github.com/users/adrielp/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "installation": { + "id": 52902335, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" + } +} diff --git a/receiver/githubreceiver/trace_receiver.go b/receiver/githubreceiver/trace_receiver.go index 129ce1fc46ac..90c96a556d46 100644 --- a/receiver/githubreceiver/trace_receiver.go +++ b/receiver/githubreceiver/trace_receiver.go @@ -149,13 +149,20 @@ func (gtr *githubTracesReceiver) handleReq(w http.ResponseWriter, req *http.Requ return } + // payload, err := github.Parse + switch e := event.(type) { case *github.WorkflowRunEvent: - if e.GetWorkflowRun().GetStatus() != "completed" { - gtr.logger.Debug("skipping non-completed WorkflowRunEvent", zap.String("status", e.GetWorkflowRun().GetStatus())) - w.WriteHeader(http.StatusNoContent) - return - } + if e.GetWorkflowRun().GetStatus() == "completed" { + var rawEvent []interface{} + event := append(rawEvent, e.GetWorkflowRun(), e.GetInstallation(), e.GetSender(), e.GetOrg(), e.GetRepo(), e.GetWorkflow()) + gtr.logger.Debug("event", zap.Any("event", event)) + } + // if e.GetWorkflowRun().GetStatus() != "completed" { + // gtr.logger.Debug("skipping non-completed WorkflowRunEvent", zap.String("status", e.GetWorkflowRun().GetStatus())) + // w.WriteHeader(http.StatusNoContent) + // return + // } return case *github.WorkflowJobEvent: if e.GetWorkflowJob().GetStatus() != "completed" { From 7302643a40b4be464c26a22f2284d17e7f8ca551 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Mon, 20 Jan 2025 10:33:51 -0500 Subject: [PATCH 03/18] chore: small addition and changes to model, in prep for switch logic --- receiver/githubreceiver/model.go | 26 +++++++++++++++++------ receiver/githubreceiver/trace_receiver.go | 20 ++++++++--------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go index 75d7c94f6a9c..8223ae90824c 100644 --- a/receiver/githubreceiver/model.go +++ b/receiver/githubreceiver/model.go @@ -105,11 +105,23 @@ const ( AttributeGitHubWorkflowTriggerActorUsername = "github.workflow.trigger.actor.username" // GitHub's Triggering Actor Username ) -func (gtr *githubTracesReceiver) genServiceName() (string, error) { - // if config.CustomServiceName != "" { - // return config.CustomServiceName - // } - // formattedName := strings.ToLower(strings.ReplaceAll(strings.ReplaceAll(fullName, "/", "-"), "_", "-")) - // return fmt.Sprintf("%s%s%s", config.ServiceNamePrefix, formattedName, config.ServiceNameSuffix) - return "", nil +// func (gtr *githubTracesReceiver) genServiceName(event interface{}) (string, error) { +// switch { +// case gtr.config.CustomServiceName != "": +// return gtr.config.CustomServiceName, nil +// case e.(type) == *github.WebhookEvent: +// } +// // if config.CustomServiceName != "" { +// // return config.CustomServiceName +// // } +// // formattedName := strings.ToLower(strings.ReplaceAll(strings.ReplaceAll(fullName, "/", "-"), "_", "-")) +// // return fmt.Sprintf("%s%s%s", config.ServiceNamePrefix, formattedName, config.ServiceNameSuffix) +// return "", nil +// } + +func (gtr *githubTracesReceiver) getServiceName(e interface{}) (string, error) { + // uses e.(type) + if e.(type) == *github.WorkflowRunEvent || e.(type) == *github.WorkflowJobEvent { + } + return nil, nil } diff --git a/receiver/githubreceiver/trace_receiver.go b/receiver/githubreceiver/trace_receiver.go index 90c96a556d46..bcf984d898c1 100644 --- a/receiver/githubreceiver/trace_receiver.go +++ b/receiver/githubreceiver/trace_receiver.go @@ -5,6 +5,7 @@ package githubreceiver // import "github.com/open-telemetry/opentelemetry-collec import ( "context" + "encoding/json" "errors" "fmt" "net/http" @@ -17,8 +18,9 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" + // "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/ptrace" + // "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/zap" ) @@ -149,13 +151,18 @@ func (gtr *githubTracesReceiver) handleReq(w http.ResponseWriter, req *http.Requ return } + var rawEvent interface{} + + if err := json.Unmarshal(p, &rawEvent); err != nil { + gtr.logger.Sugar().Errorf("failed to unmarshal event", zap.Error(err)) + } // payload, err := github.Parse switch e := event.(type) { case *github.WorkflowRunEvent: if e.GetWorkflowRun().GetStatus() == "completed" { - var rawEvent []interface{} - event := append(rawEvent, e.GetWorkflowRun(), e.GetInstallation(), e.GetSender(), e.GetOrg(), e.GetRepo(), e.GetWorkflow()) + // var rawEvent []interface{} + // event := append(rawEvent, e.GetWorkflowRun(), e.GetInstallation(), e.GetSender(), e.GetOrg(), e.GetRepo(), e.GetWorkflow()) gtr.logger.Debug("event", zap.Any("event", event)) } // if e.GetWorkflowRun().GetStatus() != "completed" { @@ -189,13 +196,6 @@ func (gtr *githubTracesReceiver) handleHealthCheck(w http.ResponseWriter, _ *htt _, _ = w.Write([]byte(healthyResponse)) } -func (gtr *githubTracesReceiver) genSvcName(e interface{}) (string, error) { - // uses e.(type) - if e.(type) == *github.WorkflowRunEvent || e.(type) == *github.WorkflowJobEvent { - } - return nil, nil -} - // maybe accept event.type here directly. // func (gtr *githubTracesReceiver) eventToSpan(e interface{}) (ptrace.Traces, error) { // t := ptrace.NewTraces() From d164f09231b1f2ef09bfbade3088afe08bfe855e Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Mon, 20 Jan 2025 11:09:19 -0500 Subject: [PATCH 04/18] chore: commit start of switch --- receiver/githubreceiver/model.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go index 8223ae90824c..31536257fafb 100644 --- a/receiver/githubreceiver/model.go +++ b/receiver/githubreceiver/model.go @@ -120,6 +120,11 @@ const ( // } func (gtr *githubTracesReceiver) getServiceName(e interface{}) (string, error) { + switch { + case gr.config.CustomServiceName != "": + return gr.config.CustomServiceName, nil + case e.(type) == *github.WebhookEvent: + } // uses e.(type) if e.(type) == *github.WorkflowRunEvent || e.(type) == *github.WorkflowJobEvent { } From c1849cfda870dd7902b210e5c9b854f3003b777e Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Wed, 29 Jan 2025 11:35:41 -0500 Subject: [PATCH 05/18] [chore] more work --- receiver/githubreceiver/config.go | 1 + receiver/githubreceiver/model.go | 136 ++++++++++++--- receiver/githubreceiver/model_test.go | 46 +++++ .../githubreceiver/trace_event_handling.go | 138 +++++++++++++++ .../trace_event_handling_test.go | 43 +++++ receiver/githubreceiver/trace_receiver.go | 162 +++++++----------- 6 files changed, 401 insertions(+), 125 deletions(-) create mode 100644 receiver/githubreceiver/model_test.go create mode 100644 receiver/githubreceiver/trace_event_handling.go create mode 100644 receiver/githubreceiver/trace_event_handling_test.go diff --git a/receiver/githubreceiver/config.go b/receiver/githubreceiver/config.go index 4745c73fb0fe..e6215d3d78e6 100755 --- a/receiver/githubreceiver/config.go +++ b/receiver/githubreceiver/config.go @@ -36,6 +36,7 @@ type WebHook struct { HealthPath string `mapstructure:"health_path"` // path for health check api. Default is /health_check RequiredHeader RequiredHeader `mapstructure:"required_header"` // optional setting to set a required header for all requests to have Secret string `mapstructure:"secret"` // secret for webhook + ServiceName string `mapstructure:"service_name"` } type RequiredHeader struct { diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go index 31536257fafb..3ac64b8e3d97 100644 --- a/receiver/githubreceiver/model.go +++ b/receiver/githubreceiver/model.go @@ -4,6 +4,11 @@ package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" import ( + "errors" + "strings" + + "github.com/google/go-github/v68/github" + "go.opentelemetry.io/collector/pdata/pcommon" semconv "go.opentelemetry.io/collector/semconv/v1.27.0" ) @@ -12,7 +17,6 @@ import ( // https://github.com/open-telemetry/weaver/issues/227 which will migrate code // gen to weaver. Once that is done, these attributes will be migrated to the // semantic conventions package. - const ( // vcs.change.state with enum values of open, closed, or merged. AttributeVCSChangeState = "vcs.change.state" @@ -51,7 +55,7 @@ const ( // vcs.ref.base.revision AttributeVCSRefBaseRevision = "vcs.ref.base.revision" - //vcs.ref.base.type with enum values of branch or tag. + // vcs.ref.base.type with enum values of branch or tag. AttributeVCSRefBaseType = "vcs.ref.base.type" AttributeVCSRefBaseTypeBranch = "branch" AttributeVCSRefBaseTypeTag = "tag" @@ -105,28 +109,108 @@ const ( AttributeGitHubWorkflowTriggerActorUsername = "github.workflow.trigger.actor.username" // GitHub's Triggering Actor Username ) -// func (gtr *githubTracesReceiver) genServiceName(event interface{}) (string, error) { -// switch { -// case gtr.config.CustomServiceName != "": -// return gtr.config.CustomServiceName, nil -// case e.(type) == *github.WebhookEvent: -// } -// // if config.CustomServiceName != "" { -// // return config.CustomServiceName -// // } -// // formattedName := strings.ToLower(strings.ReplaceAll(strings.ReplaceAll(fullName, "/", "-"), "_", "-")) -// // return fmt.Sprintf("%s%s%s", config.ServiceNamePrefix, formattedName, config.ServiceNameSuffix) -// return "", nil -// } - -func (gtr *githubTracesReceiver) getServiceName(e interface{}) (string, error) { - switch { - case gr.config.CustomServiceName != "": - return gr.config.CustomServiceName, nil - case e.(type) == *github.WebhookEvent: - } - // uses e.(type) - if e.(type) == *github.WorkflowRunEvent || e.(type) == *github.WorkflowJobEvent { - } - return nil, nil +// getWorkflowAttrs returns a pcommon.Map of attributes for the Workflow Run +// GitHub event type and an error if one occurs. The attributes are associated +// with the originally provided resource. +func (gtr *githubTracesReceiver) getWorkflowAttrs(resource pcommon.Resource, e *github.WorkflowRunEvent) error { + attrs := resource.Attributes() + var err error + + svc, err := gtr.getServiceName(e.GetRepo().CustomProperties["service_name"], e.GetRepo().GetName()) + if err != nil { + err = errors.New("failed to get service.name") + } + + attrs.PutStr(semconv.AttributeServiceName, svc) + + // VCS Attributes + attrs.PutStr(AttributeVCSRepositoryName, e.GetRepo().GetName()) + attrs.PutStr(AttributeVCSVendorName, "github") + attrs.PutStr(AttributeVCSRefHead, e.GetWorkflowRun().GetHeadBranch()) + attrs.PutStr(AttributeVCSRefHeadType, AttributeVCSRefHeadTypeBranch) + attrs.PutStr(AttributeVCSRefHeadRevision, e.GetWorkflowRun().GetHeadSHA()) + attrs.PutStr(AttributeVCSRefHeadRevisionAuthorName, e.GetWorkflowRun().GetHeadCommit().GetCommitter().GetName()) + attrs.PutStr(AttributeVCSRefHeadRevisionAuthorEmail, e.GetWorkflowRun().GetHeadCommit().GetCommitter().GetEmail()) + + // CICD Attributes + attrs.PutStr(semconv.AttributeCicdPipelineName, e.GetWorkflowRun().GetName()) + attrs.PutStr(AttributeCICDPipelineRunSenderLogin, e.GetSender().GetLogin()) + attrs.PutStr(AttributeCICDPipelineRunURLFull, e.GetWorkflowRun().GetHTMLURL()) + attrs.PutInt(semconv.AttributeCicdPipelineRunID, e.GetWorkflowRun().GetID()) // TODO: GitHub events have runIDs, but not available in the SDK?? + switch status := e.GetWorkflowRun().GetConclusion(); status { + case "success": + attrs.PutStr(AttributeCICDPipelineRunStatus, AttributeCICDPipelineRunStatusSuccess) + case "failure": + attrs.PutStr(AttributeCICDPipelineRunStatus, AttributeCICDPipelineRunStatusFailure) + case "skipped": + attrs.PutStr(AttributeCICDPipelineRunStatus, AttributeCICDPipelineRunStatusSkip) + case "cancelled": + attrs.PutStr(AttributeCICDPipelineRunStatus, AttributeCICDPipelineRunStatusCancellation) + // Default sets to whatever is provided by the event. GitHub provides the following additional values: + // neutral, timed_out, action_required, stale, startup_failure, and null. + default: + attrs.PutStr(AttributeCICDPipelineRunStatus, status) + } + + // TODO: Add function and put previous run_attempt_url + // if e.GetWorkflowRun().GetPreviousAttemptURL() != "" { + // htmlURL := transformGitHubAPIURL(e.GetWorkflowRun().GetPreviousAttemptURL()) + // attrs.PutStr("cicd.pipeline.run.previous_attempt_url", htmlURL) + // } + + // TODO: This attribute is important for determining what shared workflows + // exist, and what versions (or shas). Previously, it would all get + // appended. But this should be a slice of values instead. + // if len(e.GetWorkflowRun().ReferencedWorkflows) > 0 { + // var referencedWorkflows []string + // for _, workflow := range e.GetWorkflowRun().ReferencedWorkflows { + // referencedWorkflows = append(referencedWorkflows, workflow.GetPath()) + // } + // attrs.PutStr("cicd.pipeline.run.referenced_workflows", strings.Join(referencedWorkflows, ";")) + // } + + // TODO: Convert this to the VCS Change Request. + // if len(e.GetWorkflowRun().PullRequests) > 0 { + // var prUrls []string + // for _, pr := range e.GetWorkflowRun().PullRequests { + // prUrls = append(prUrls, convertPRURL(pr.GetURL())) + // } + // attrs.PutStr("vcs.change.url", strings.Join(prUrls, ";")) + // } + + return err +} + +// getServiceName returns a generated service.name resource attribute derived +// from 1) the service_name defined in the webhook configuration 2) a +// service.name value set in the custom_properties section of a GitHub event, or +// 3) the repository name. The value returned in those cases will always be a +// formatted string; where the string will be lowercase and underscores will be +// replaced by hyphens. If none of these are set, it returns "unknown_service" +// and an error. +// func (gtr *githubTracesReceiver) getServiceName(customProps map[string]interface{}, repoName string) (string, error) { +func (gtr *githubTracesReceiver) getServiceName(customProps interface{}, repoName string) (string, error) { + switch { + case gtr.cfg.WebHook.ServiceName != "": + formatted := formatString(gtr.cfg.WebHook.ServiceName) + return formatted, nil + // customProps would be an index map[string]interface{} passed in but should + // only be non-nil if the index of `service_name` exists + case customProps != nil: + formatted := formatString(customProps.(string)) + return formatted, nil + case repoName != "": + formatted := formatString(repoName) + return formatted, nil + default: + // This should never happen, but in the event it does, unknown_service + // and a error will be returned to abide by semantic conventions. + return "unkown_service", errors.New("unable to generate service.name resource attribute") + } +} + +// formatString formats a string to lowercase and replaces underscores with +// hyphens. +func formatString(input string) string { + return strings.ToLower(strings.ReplaceAll(input, "_", "-")) } diff --git a/receiver/githubreceiver/model_test.go b/receiver/githubreceiver/model_test.go new file mode 100644 index 000000000000..09bba1f7db03 --- /dev/null +++ b/receiver/githubreceiver/model_test.go @@ -0,0 +1,46 @@ +package githubreceiver + +import "testing" + +func TestFormatString(t *testing.T) { + tests := []struct { + name string + input string + expected string + }{ + { + name: "converts underscores to hyphens", + input: "hello_world", + expected: "hello-world", + }, + { + name: "converts to lowercase", + input: "HELLO_WORLD", + expected: "hello-world", + }, + { + name: "handles mixed case and multiple underscores", + input: "Hello_Big_WORLD", + expected: "hello-big-world", + }, + { + name: "handles string with no underscores", + input: "HelloWorld", + expected: "helloworld", + }, + { + name: "handles empty string", + input: "", + expected: "", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := formatString(tt.input) + if got != tt.expected { + t.Errorf("formatString() = %v, want %v", got, tt.expected) + } + }) + } +} diff --git a/receiver/githubreceiver/trace_event_handling.go b/receiver/githubreceiver/trace_event_handling.go new file mode 100644 index 000000000000..890bbf3a6a94 --- /dev/null +++ b/receiver/githubreceiver/trace_event_handling.go @@ -0,0 +1,138 @@ +package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" + +import ( + "crypto/sha256" + "encoding/hex" + "errors" + "fmt" + + "github.com/google/go-github/v68/github" + "go.uber.org/zap" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func (gtr *githubTracesReceiver) handleWorkflowRun(e *github.WorkflowRunEvent) (ptrace.Traces, error) { + t := ptrace.NewTraces() + r := t.ResourceSpans().AppendEmpty() + + resource := r.Resource() + + err := gtr.getWorkflowAttrs(resource, e) + if err != nil { + return ptrace.Traces{}, fmt.Errorf("failed to get workflow attributes: %w", err) + } + + traceID, err := newTraceID(e.GetWorkflowRun().GetID(), int(e.GetWorkflowRun().GetRunAttempt())) + if err != nil { + gtr.logger.Sugar().Errorf("Failed to generate trace ID", zap.String("error", fmt.Sprint(err))) + } + + err = gtr.createRootSpan(r, e, traceID) + if err != nil { + gtr.logger.Error("Failed to create root span", zap.Error(err)) + return ptrace.Traces{}, errors.New("failed to create root span") + } + return t, nil +} + +// TODO: Add and implement handleWorkflowJob, tying corresponding job spans to +// the proper root span and trace ID. +// func (gtr *githubTracesReceiver) handleWorkflowJob(ctx context.Context, e *github.WorkflowJobEvent) (ptrace.Traces, error) { +// t := ptrace.NewTraces() +// // r := t.ResourceSpans().AppendEmpty() +// // s := r.InstrumentationLibrarySpans().AppendEmpty() +// return t, nil +// } + +// newTraceID creates a deterministic Trace ID based on the provided +// inputs of runID and runAttempt. +func newTraceID(runID int64, runAttempt int) (pcommon.TraceID, error) { + // Original implementation appended `t` to TraceId's and `s` to + // ParentSpanId's This was done to separate the two types of IDs eventhough + // SpanID's are only 8 bytes, while TraceID's are 16 bytes. + // TODO: Determine if there is a better way to handle this. + input := fmt.Sprintf("%d%dt", runID, runAttempt) + // TODO: Determine if this is the best hashing algorithm to use. This is + // more likely to generate a unique hash compared to MD5 or SHA1. Could + // alternatively use UUID library to generate a unique ID by also using a + // hash. + hash := sha256.Sum256([]byte(input)) + idHex := hex.EncodeToString(hash[:]) + + var id pcommon.TraceID + _, err := hex.Decode(id[:], []byte(idHex[:32])) + if err != nil { + return pcommon.TraceID{}, err + } + + return id, nil +} + +// newParentId creates a deterministic Parent Span ID based on the provided +// runID and runAttempt. `s` is appended to the end of the input to +// differentiate between a deterministic traceID and the parentSpanID. +func newParentSpanID(runID int64, runAttempt int) (pcommon.SpanID, error) { + input := fmt.Sprintf("%d%ds", runID, runAttempt) + hash := sha256.Sum256([]byte(input)) + spanIDHex := hex.EncodeToString(hash[:]) + + var spanID pcommon.SpanID + _, err := hex.Decode(spanID[:], []byte(spanIDHex[16:32])) + if err != nil { + return pcommon.SpanID{}, err + } + + return spanID, nil +} + +// createRootSpan creates a root span based on the provided event, associated +// with the determinitic traceID. +func (gtr *githubTracesReceiver) createRootSpan( + resourceSpans ptrace.ResourceSpans, + event *github.WorkflowRunEvent, + traceID pcommon.TraceID, +) error { + scopeSpans := resourceSpans.ScopeSpans().AppendEmpty() + span := scopeSpans.Spans().AppendEmpty() + + rootSpanID, err := newParentSpanID(event.GetWorkflowRun().GetID(), event.GetWorkflowRun().GetRunAttempt()) + if err != nil { + return fmt.Errorf("failed to generate root span ID: %w", err) + } + + span.SetTraceID(traceID) + span.SetSpanID(rootSpanID) + span.SetName(event.GetWorkflowRun().GetName()) + span.SetKind(ptrace.SpanKindServer) + span.SetStartTimestamp(pcommon.NewTimestampFromTime(event.GetWorkflowRun().GetRunStartedAt().Time)) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(event.GetWorkflowRun().GetUpdatedAt().Time)) + + switch event.WorkflowRun.GetConclusion() { + case "success": + span.Status().SetCode(ptrace.StatusCodeOk) + case "failure": + span.Status().SetCode(ptrace.StatusCodeError) + default: + span.Status().SetCode(ptrace.StatusCodeUnset) + } + + span.Status().SetMessage(event.GetWorkflowRun().GetConclusion()) + + // Attempt to link to previous trace ID if applicable + if event.GetWorkflowRun().GetPreviousAttemptURL() != "" && event.GetWorkflowRun().GetRunAttempt() > 1 { + gtr.logger.Debug("Linking to previous trace ID for WorkflowRunEvent") + previousRunAttempt := event.GetWorkflowRun().GetRunAttempt() - 1 + previousTraceID, err := newTraceID(event.GetWorkflowRun().GetID(), previousRunAttempt) + if err != nil { + return fmt.Errorf("failed to generate previous traceID: %w", err) + } + + link := span.Links().AppendEmpty() + link.SetTraceID(previousTraceID) + gtr.logger.Debug("successfully linked to previous trace ID", zap.String("previousTraceID", previousTraceID.String())) + } + + return nil +} diff --git a/receiver/githubreceiver/trace_event_handling_test.go b/receiver/githubreceiver/trace_event_handling_test.go new file mode 100644 index 000000000000..4035298bd920 --- /dev/null +++ b/receiver/githubreceiver/trace_event_handling_test.go @@ -0,0 +1,43 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" + +import ( + // "context" + // "net/http" + // "net/http/httptest" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/ptrace" + // "go.opentelemetry.io/collector/component/componenttest" + // "go.opentelemetry.io/collector/consumer/consumertest" + // "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestNewParentSpanID(t *testing.T) { + tests := []struct { + runID int64 + runAttempt int + expectedParentSpanID string + expectedError error + }{ + { + runID: 12345, + runAttempt: 1, + expectedParentSpanID: pcommon.SpanID{}, + expectedError: nil, + }, + } + + for _, tc := range tests { + t.Run(tc.expectedParentSpanID, func(t *testing.T) { + parentSpanID, err := newParentSpanID(tc.runID, tc.runAttempt) + require.Equal(t, tc.expectedParentSpanID, parentSpanID) + require.Equal(t, tc.expectedError, err) + }) + } + +} diff --git a/receiver/githubreceiver/trace_receiver.go b/receiver/githubreceiver/trace_receiver.go index bcf984d898c1..0b947172d560 100644 --- a/receiver/githubreceiver/trace_receiver.go +++ b/receiver/githubreceiver/trace_receiver.go @@ -16,11 +16,10 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" - // "go.opentelemetry.io/collector/pdata/pcommon" - // "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/zap" ) @@ -95,10 +94,10 @@ func (gtr *githubTracesReceiver) Start(ctx context.Context, host component.Host) router := mux.NewRouter() // setup health route - router.HandleFunc(gtr.cfg.WebHook.HealthPath, gtr.handleHealthCheck) - - // setup webhook route for traces - router.HandleFunc(gtr.cfg.WebHook.Path, gtr.handleReq) + router.HandleFunc(gtr.cfg.WebHook.HealthPath, gtr.handleHealthCheck) + + // setup webhook route for traces + router.HandleFunc(gtr.cfg.WebHook.Path, gtr.handleReq) // webhook server standup and configuration gtr.server, err = gtr.cfg.WebHook.ServerConfig.ToServer(ctx, host, gtr.settings.TelemetrySettings, router) @@ -134,58 +133,68 @@ func (gtr *githubTracesReceiver) Shutdown(_ context.Context) error { // handleReq handles incoming request sent to the webhook endoint. On success // returns a 200 response code. func (gtr *githubTracesReceiver) handleReq(w http.ResponseWriter, req *http.Request) { - // ctx := gtr.obsrecv.StartTracesOp(req.Context()) - - p, err := github.ValidatePayload(req, []byte(gtr.cfg.WebHook.Secret)) - if err != nil { - gtr.logger.Sugar().Debugf("unable to validate payload", zap.Error(err)) - http.Error(w, "invalid payload", http.StatusBadRequest) - return - } - - eventType := github.WebHookType(req) - event, err := github.ParseWebHook(eventType, p) - if err != nil { - gtr.logger.Sugar().Debugf("failed to parse event", zap.Error(err)) - http.Error(w, "failed to parse event", http.StatusBadRequest) - return - } - - var rawEvent interface{} - - if err := json.Unmarshal(p, &rawEvent); err != nil { - gtr.logger.Sugar().Errorf("failed to unmarshal event", zap.Error(err)) - } - // payload, err := github.Parse - - switch e := event.(type) { - case *github.WorkflowRunEvent: - if e.GetWorkflowRun().GetStatus() == "completed" { - // var rawEvent []interface{} - // event := append(rawEvent, e.GetWorkflowRun(), e.GetInstallation(), e.GetSender(), e.GetOrg(), e.GetRepo(), e.GetWorkflow()) - gtr.logger.Debug("event", zap.Any("event", event)) - } - // if e.GetWorkflowRun().GetStatus() != "completed" { - // gtr.logger.Debug("skipping non-completed WorkflowRunEvent", zap.String("status", e.GetWorkflowRun().GetStatus())) - // w.WriteHeader(http.StatusNoContent) - // return - // } - return - case *github.WorkflowJobEvent: + ctx := gtr.obsrecv.StartTracesOp(req.Context()) + + p, err := github.ValidatePayload(req, []byte(gtr.cfg.WebHook.Secret)) + if err != nil { + gtr.logger.Sugar().Debugf("unable to validate payload", zap.Error(err)) + http.Error(w, "invalid payload", http.StatusBadRequest) + return + } + + eventType := github.WebHookType(req) + event, err := github.ParseWebHook(eventType, p) + if err != nil { + gtr.logger.Sugar().Debugf("failed to parse event", zap.Error(err)) + http.Error(w, "failed to parse event", http.StatusBadRequest) + return + } + + var rawEvent interface{} + + if err := json.Unmarshal(p, &rawEvent); err != nil { + gtr.logger.Sugar().Errorf("failed to unmarshal event", zap.Error(err)) + } + + var td ptrace.Traces + switch e := event.(type) { + case *github.WorkflowRunEvent: + if e.GetWorkflowRun().GetStatus() != "completed" { + gtr.logger.Debug("workflow run not complete, skipping...", zap.String("status", e.GetWorkflowRun().GetStatus())) + w.WriteHeader(http.StatusNoContent) + return + } + td, err = gtr.handleWorkflowRun(e) + case *github.WorkflowJobEvent: if e.GetWorkflowJob().GetStatus() != "completed" { - gtr.logger.Debug("skipping non-completed WorkflowJobEvent", zap.String("status", e.GetWorkflowJob().GetStatus())) + gtr.logger.Debug("workflow job not complete, skipping...", zap.String("status", e.GetWorkflowJob().GetStatus())) w.WriteHeader(http.StatusNoContent) return } - return - default: - gtr.logger.Sugar().Debugf("event type not supported", zap.String("event_type", eventType)) - http.Error(w, "event type not supported", http.StatusBadRequest) - return - } - - // TODO: Figure this out - // gtr.obsrecv.EndTracesOp(ctx, "protobuf", td.SpanCount(), err) + return + // TODO: Enable + // td, err = gtr.handleWorkflowJob(ctx, e) + case *github.PingEvent: + w.Header().Add("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + return + default: + gtr.logger.Sugar().Debugf("event type not supported", zap.String("event_type", eventType)) + http.Error(w, "event type not supported", http.StatusBadRequest) + return + } + + if td.SpanCount() > 0 { + err = gtr.traceConsumer.ConsumeTraces(ctx, td) + if err != nil { + http.Error(w, "failed to consume traces", http.StatusInternalServerError) + return + } + } + + w.WriteHeader(http.StatusOK) + + gtr.obsrecv.EndTracesOp(ctx, "protobuf", td.SpanCount(), err) } // Simple healthcheck endpoint. @@ -195,48 +204,3 @@ func (gtr *githubTracesReceiver) handleHealthCheck(w http.ResponseWriter, _ *htt _, _ = w.Write([]byte(healthyResponse)) } - -// maybe accept event.type here directly. -// func (gtr *githubTracesReceiver) eventToSpan(e interface{}) (ptrace.Traces, error) { -// t := ptrace.NewTraces() -// r := t.ResourceSpans().AppendEmpty() -// s := r.ScopeSpans().AppendEmpty() -// -// switch e := e.(type) { -// case *github.WorkflowJobEvent: -// jobResource := resourceSpans.Resource() -// createResourceAttributes(jobResource, e, config, logger) -// -// traceID, err := generateTraceID(e.GetWorkflowJob().GetRunID(), int(e.GetWorkflowJob().GetRunAttempt())) -// if err != nil { -// logger.Error("Failed to generate trace ID", zap.Error(err)) -// return ptrace.Traces{}, fmt.Errorf("failed to generate trace ID: %w", err) -// } -// -// parentSpanID := createParentSpan(scopeSpans, e.GetWorkflowJob().Steps, e.GetWorkflowJob(), traceID, logger) -// processSteps(scopeSpans, e.GetWorkflowJob().Steps, e.GetWorkflowJob(), traceID, parentSpanID, logger) -// -// case *github.WorkflowRunEvent: -// runResource := resourceSpans.Resource() -// -// traceID, err := generateTraceID(e.GetWorkflowRun().GetID(), e.GetWorkflowRun().GetRunAttempt()) -// if err != nil { -// logger.Error("Failed to generate trace ID", zap.Error(err)) -// return ptrace.Traces{}, fmt.Errorf("failed to generate trace ID: %w", err) -// } -// -// createResourceAttributes(runResource, e, config, logger) -// _, err = createRootSpan(resourceSpans, e, traceID, logger) -// if err != nil { -// logger.Error("Failed to create root span", zap.Error(err)) -// return ptrace.Traces{}, fmt.Errorf("failed to create root span: %w", err) -// } -// -// default: -// logger.Error("unknown event type, dropping payload") -// return ptrace.Traces{}, fmt.Errorf("unknown event type") -// } -// -// -// return nil, nil -// } From b4a4a8fb8872a0ef44f59ba35204597c6cf9cb34 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Wed, 29 Jan 2025 12:05:51 -0500 Subject: [PATCH 06/18] [test] add newTraceID and newParentSpanID tests --- .../trace_event_handling_test.go | 94 ++++++++++++++----- 1 file changed, 72 insertions(+), 22 deletions(-) diff --git a/receiver/githubreceiver/trace_event_handling_test.go b/receiver/githubreceiver/trace_event_handling_test.go index 4035298bd920..b8dc24c88606 100644 --- a/receiver/githubreceiver/trace_event_handling_test.go +++ b/receiver/githubreceiver/trace_event_handling_test.go @@ -11,33 +11,83 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/ptrace" + // "go.opentelemetry.io/collector/pdata/ptrace" // "go.opentelemetry.io/collector/component/componenttest" // "go.opentelemetry.io/collector/consumer/consumertest" // "go.opentelemetry.io/collector/receiver/receivertest" ) func TestNewParentSpanID(t *testing.T) { - tests := []struct { - runID int64 - runAttempt int - expectedParentSpanID string - expectedError error - }{ - { - runID: 12345, - runAttempt: 1, - expectedParentSpanID: pcommon.SpanID{}, - expectedError: nil, - }, - } - - for _, tc := range tests { - t.Run(tc.expectedParentSpanID, func(t *testing.T) { - parentSpanID, err := newParentSpanID(tc.runID, tc.runAttempt) - require.Equal(t, tc.expectedParentSpanID, parentSpanID) - require.Equal(t, tc.expectedError, err) - }) - } + tests := []struct { + name string + runID int64 + runAttempt int + wantError bool + }{ + { + name: "basic span ID generation", + runID: 12345, + runAttempt: 1, + wantError: false, + }, + { + name: "different run ID", + runID: 54321, + runAttempt: 1, + wantError: false, + }, + { + name: "different attempt", + runID: 12345, + runAttempt: 2, + wantError: false, + }, + { + name: "zero values", + runID: 0, + runAttempt: 0, + wantError: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // First call to get span ID + spanID1, err1 := newParentSpanID(tt.runID, tt.runAttempt) + + if tt.wantError { + require.Error(t, err1) + return + } + require.NoError(t, err1) + + // Verify span ID is not empty + require.NotEqual(t, pcommon.SpanID{}, spanID1, "span ID should not be empty") + + // Verify consistent results for same input + spanID2, err2 := newParentSpanID(tt.runID, tt.runAttempt) + require.NoError(t, err2) + require.Equal(t, spanID1, spanID2, "same inputs should generate same span ID") + + // Verify different inputs generate different span IDs + differentSpanID, err3 := newParentSpanID(tt.runID+1, tt.runAttempt) + require.NoError(t, err3) + require.NotEqual(t, spanID1, differentSpanID, "different inputs should generate different span IDs") + }) + } +} + +func TestNewParentSpanID_Consistency(t *testing.T) { + // Test that generates the same span ID for same inputs across multiple calls + runID := int64(12345) + runAttempt := 1 + + spanID1, err1 := newParentSpanID(runID, runAttempt) + require.NoError(t, err1) + + for i := 0; i < 5; i++ { + spanID2, err2 := newParentSpanID(runID, runAttempt) + require.NoError(t, err2) + require.Equal(t, spanID1, spanID2, "span ID should be consistent across multiple calls") + } } From f6edd9d6fccc510f5783ef63e779668f3f0d11a7 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Wed, 29 Jan 2025 16:25:31 -0500 Subject: [PATCH 07/18] [test] add TestHandleWorkflowRun test --- .../trace_event_handling_test.go | 134 +++++++++++++++++- 1 file changed, 132 insertions(+), 2 deletions(-) diff --git a/receiver/githubreceiver/trace_event_handling_test.go b/receiver/githubreceiver/trace_event_handling_test.go index b8dc24c88606..29fdd465a287 100644 --- a/receiver/githubreceiver/trace_event_handling_test.go +++ b/receiver/githubreceiver/trace_event_handling_test.go @@ -7,16 +7,146 @@ import ( // "context" // "net/http" // "net/http/httptest" + // "os" + "time" "testing" + "go.uber.org/zap" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/pcommon" - // "go.opentelemetry.io/collector/pdata/ptrace" + "github.com/google/go-github/v68/github" + "go.opentelemetry.io/collector/pdata/ptrace" // "go.opentelemetry.io/collector/component/componenttest" // "go.opentelemetry.io/collector/consumer/consumertest" - // "go.opentelemetry.io/collector/receiver/receivertest" + "go.opentelemetry.io/collector/receiver/receivertest" ) +func TestHandleWorkflowRun(t *testing.T) { + // Helper function to create a test workflow run event + createTestWorkflowRunEvent := func(id int64, runAttempt int, name, conclusion string, startTime, updateTime time.Time) *github.WorkflowRunEvent { + return &github.WorkflowRunEvent{ + WorkflowRun: &github.WorkflowRun{ + ID: &id, + Name: &name, + RunAttempt: &runAttempt, + RunStartedAt: &github.Timestamp{Time: startTime}, + UpdatedAt: &github.Timestamp{Time: updateTime}, + Conclusion: &conclusion, + }, + Repo: &github.Repository{ + Name: github.Ptr("test-repo"), + Organization: &github.Organization{Login: github.Ptr("test-org")}, + DefaultBranch: github.Ptr("main"), + CustomProperties: map[string]interface{}{ + "service_name": "test-service", + }, + }, + Workflow: &github.Workflow{ + Name: github.Ptr("test-workflow"), + Path: github.Ptr(".github/workflows/test.yml"), + }, + } + } + + tests := []struct { + name string + event *github.WorkflowRunEvent + wantErr bool + validate func(t *testing.T, traces ptrace.Traces) + }{ + { + name: "successful workflow run", + event: createTestWorkflowRunEvent( + 123, + 1, + "Test Workflow", + "success", + time.Now().Add(-time.Hour), + time.Now(), + ), + wantErr: false, + validate: func(t *testing.T, traces ptrace.Traces) { + require.Equal(t, 1, traces.ResourceSpans().Len()) + + rs := traces.ResourceSpans().At(0) + require.Equal(t, 1, rs.ScopeSpans().Len()) + + spans := rs.ScopeSpans().At(0).Spans() + require.Equal(t, 1, spans.Len()) + + span := spans.At(0) + require.Equal(t, "Test Workflow", span.Name()) + require.Equal(t, ptrace.SpanKindServer, span.Kind()) + require.Equal(t, ptrace.StatusCodeOk, span.Status().Code()) + require.Equal(t, "success", span.Status().Message()) + }, + }, + { + name: "failed workflow run", + event: createTestWorkflowRunEvent( + 124, + 1, + "Test Workflow", + "failure", + time.Now().Add(-time.Hour), + time.Now(), + ), + wantErr: false, + validate: func(t *testing.T, traces ptrace.Traces) { + spans := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans() + span := spans.At(0) + require.Equal(t, ptrace.StatusCodeError, span.Status().Code()) + require.Equal(t, "failure", span.Status().Message()) + }, + }, + { + name: "workflow run with retry", + event: func() *github.WorkflowRunEvent { + e := createTestWorkflowRunEvent( + 125, + 2, + "Test Workflow", + "success", + time.Now().Add(-time.Hour), + time.Now(), + ) + previousURL := "https://api.github.com/repos/test-org/test-repo/actions/runs/125/attempts/1" + e.WorkflowRun.PreviousAttemptURL = &previousURL + return e + }(), + wantErr: false, + validate: func(t *testing.T, traces ptrace.Traces) { + spans := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans() + span := spans.At(0) + require.Equal(t, 1, span.Links().Len()) + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Create a new receiver with a test logger + logger := zap.NewNop() + receiver := &githubTracesReceiver{ + logger: logger, + cfg: createDefaultConfig().(*Config), + settings: receivertest.NewNopSettings(), + } + + // Handle the workflow run event + traces, err := receiver.handleWorkflowRun(tt.event) + + if tt.wantErr { + require.Error(t, err) + return + } + + require.NoError(t, err) + tt.validate(t, traces) + }) + } +} + func TestNewParentSpanID(t *testing.T) { tests := []struct { name string From f4b4f8b1809e0ffc1717b80bf7d20fc1a4b44aea Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Wed, 29 Jan 2025 16:57:56 -0500 Subject: [PATCH 08/18] [chore] run checks and fix lints --- receiver/githubreceiver/factory.go | 6 +- receiver/githubreceiver/go.mod | 75 ++-- receiver/githubreceiver/go.sum | 154 +++---- receiver/githubreceiver/model.go | 4 +- receiver/githubreceiver/model_test.go | 3 + .../githubreceiver/trace_event_handling.go | 10 +- .../trace_event_handling_test.go | 396 +++++++++--------- receiver/githubreceiver/trace_receiver.go | 8 - 8 files changed, 325 insertions(+), 331 deletions(-) diff --git a/receiver/githubreceiver/factory.go b/receiver/githubreceiver/factory.go index c6d98bae4239..2bc0e1bc9f32 100644 --- a/receiver/githubreceiver/factory.go +++ b/receiver/githubreceiver/factory.go @@ -93,7 +93,7 @@ func createMetricsReceiver( return nil, err } - return scraperhelper.NewScraperControllerReceiver( + return scraperhelper.NewMetricsController( &conf.ControllerConfig, params, consumer, @@ -121,8 +121,8 @@ func createAddScraperOpts( params receiver.Settings, cfg *Config, factories map[string]internal.ScraperFactory, -) ([]scraperhelper.ScraperControllerOption, error) { - scraperControllerOptions := make([]scraperhelper.ScraperControllerOption, 0, len(cfg.Scrapers)) +) ([]scraperhelper.ControllerOption, error) { + scraperControllerOptions := make([]scraperhelper.ControllerOption, 0, len(cfg.Scrapers)) for key, cfg := range cfg.Scrapers { githubScraper, err := createGitHubScraper(ctx, params, key, cfg, factories) diff --git a/receiver/githubreceiver/go.mod b/receiver/githubreceiver/go.mod index 82d28b8f4496..d3958c70822a 100644 --- a/receiver/githubreceiver/go.mod +++ b/receiver/githubreceiver/go.mod @@ -10,22 +10,22 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.117.0 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/component v0.117.0 - go.opentelemetry.io/collector/component/componentstatus v0.117.0 - go.opentelemetry.io/collector/component/componenttest v0.117.0 - go.opentelemetry.io/collector/config/confighttp v0.117.0 - go.opentelemetry.io/collector/confmap v1.23.0 - go.opentelemetry.io/collector/consumer v1.23.0 - go.opentelemetry.io/collector/consumer/consumertest v0.117.0 - go.opentelemetry.io/collector/filter v0.117.0 + go.opentelemetry.io/collector/component v0.118.0 + go.opentelemetry.io/collector/component/componentstatus v0.118.0 + go.opentelemetry.io/collector/component/componenttest v0.118.0 + go.opentelemetry.io/collector/config/confighttp v0.118.0 + go.opentelemetry.io/collector/confmap v1.24.0 + go.opentelemetry.io/collector/consumer v1.24.0 + go.opentelemetry.io/collector/consumer/consumertest v0.118.0 + go.opentelemetry.io/collector/filter v0.118.0 go.opentelemetry.io/collector/otelcol/otelcoltest v0.117.0 - go.opentelemetry.io/collector/pdata v1.23.0 - go.opentelemetry.io/collector/pipeline v0.117.0 - go.opentelemetry.io/collector/receiver v0.117.0 - go.opentelemetry.io/collector/receiver/receivertest v0.117.0 - go.opentelemetry.io/collector/scraper v0.117.0 - go.opentelemetry.io/collector/scraper/scraperhelper v0.117.0 - go.opentelemetry.io/collector/semconv v0.117.0 + go.opentelemetry.io/collector/pdata v1.24.0 + go.opentelemetry.io/collector/pipeline v0.118.0 + go.opentelemetry.io/collector/receiver v0.118.0 + go.opentelemetry.io/collector/receiver/receivertest v0.118.0 + go.opentelemetry.io/collector/scraper v0.118.0 + go.opentelemetry.io/collector/scraper/scraperhelper v0.118.0 + go.opentelemetry.io/collector/semconv v0.118.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -75,14 +75,15 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect - github.com/vektah/gqlparser/v2 v2.5.20 // indirect + github.com/vektah/gqlparser/v2 v2.5.22 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/client v1.23.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.117.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.23.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.23.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.117.0 // indirect - go.opentelemetry.io/collector/config/configtls v1.23.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/collector/client v1.24.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.118.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.24.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.24.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.118.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.24.0 // indirect go.opentelemetry.io/collector/confmap/provider/envprovider v1.23.0 // indirect go.opentelemetry.io/collector/confmap/provider/fileprovider v1.23.0 // indirect go.opentelemetry.io/collector/confmap/provider/httpprovider v1.23.0 // indirect @@ -90,31 +91,31 @@ require ( go.opentelemetry.io/collector/connector v0.117.0 // indirect go.opentelemetry.io/collector/connector/connectortest v0.117.0 // indirect go.opentelemetry.io/collector/connector/xconnector v0.117.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.117.0 // indirect - go.opentelemetry.io/collector/consumer/xconsumer v0.117.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.118.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.118.0 // indirect go.opentelemetry.io/collector/exporter v0.117.0 // indirect go.opentelemetry.io/collector/exporter/exportertest v0.117.0 // indirect go.opentelemetry.io/collector/exporter/xexporter v0.117.0 // indirect - go.opentelemetry.io/collector/extension v0.117.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.117.0 // indirect + go.opentelemetry.io/collector/extension v0.118.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.118.0 // indirect go.opentelemetry.io/collector/extension/extensioncapabilities v0.117.0 // indirect go.opentelemetry.io/collector/extension/extensiontest v0.117.0 // indirect go.opentelemetry.io/collector/featuregate v1.23.0 // indirect go.opentelemetry.io/collector/internal/fanoutconsumer v0.117.0 // indirect go.opentelemetry.io/collector/otelcol v0.117.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.117.0 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.117.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.118.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.118.0 // indirect go.opentelemetry.io/collector/pipeline/xpipeline v0.117.0 // indirect go.opentelemetry.io/collector/processor v0.117.0 // indirect go.opentelemetry.io/collector/processor/processortest v0.117.0 // indirect go.opentelemetry.io/collector/processor/xprocessor v0.117.0 // indirect - go.opentelemetry.io/collector/receiver/xreceiver v0.117.0 // indirect + go.opentelemetry.io/collector/receiver/xreceiver v0.118.0 // indirect go.opentelemetry.io/collector/service v0.117.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 // indirect go.opentelemetry.io/contrib/config v0.10.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.31.0 // indirect - go.opentelemetry.io/otel v1.32.0 // indirect + go.opentelemetry.io/otel v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.7.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.32.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.32.0 // indirect @@ -126,21 +127,21 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.32.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0 // indirect go.opentelemetry.io/otel/log v0.8.0 // indirect - go.opentelemetry.io/otel/metric v1.32.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/log v0.7.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect - go.opentelemetry.io/otel/trace v1.32.0 // indirect + go.opentelemetry.io/otel/trace v1.34.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/net v0.34.0 // indirect golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 // indirect - google.golang.org/grpc v1.69.2 // indirect - google.golang.org/protobuf v1.36.2 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 // indirect + google.golang.org/grpc v1.70.0 // indirect + google.golang.org/protobuf v1.36.4 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/receiver/githubreceiver/go.sum b/receiver/githubreceiver/go.sum index 857011fdf38a..2924162933d8 100644 --- a/receiver/githubreceiver/go.sum +++ b/receiver/githubreceiver/go.sum @@ -118,38 +118,40 @@ github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08 github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0= github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= -github.com/vektah/gqlparser/v2 v2.5.20 h1:kPaWbhBntxoZPaNdBaIPT1Kh0i1b/onb5kXgEdP5JCo= -github.com/vektah/gqlparser/v2 v2.5.20/go.mod h1:xMl+ta8a5M1Yo1A1Iwt/k7gSpscwSnHZdw7tfhEGfTM= +github.com/vektah/gqlparser/v2 v2.5.22 h1:yaaeJ0fu+nv1vUMW0Hl+aS1eiv1vMfapBNjpffAda1I= +github.com/vektah/gqlparser/v2 v2.5.22/go.mod h1:xMl+ta8a5M1Yo1A1Iwt/k7gSpscwSnHZdw7tfhEGfTM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/collector v0.117.0 h1:nj/Q89KGmev1l4YxWJt4JH3+fV1YFmci9MRmr9bULf4= go.opentelemetry.io/collector v0.117.0/go.mod h1:z8XawVuKONaUkJW5w1GrfAXokrgxdF8mGtekK0sFIyQ= -go.opentelemetry.io/collector/client v1.23.0 h1:X11yEZ2T3T1Cr1CfDPI0xjZgw7ekes7CVbF/NVYxGG0= -go.opentelemetry.io/collector/client v1.23.0/go.mod h1:pfhOGJ13n5xH3HgmFwUHa1nBE1kCIa9X/DLTJVxtbVM= -go.opentelemetry.io/collector/component v0.117.0 h1:A3Im4PqLyfduAdVyUgbOZdUs7J/USegdpnkoIAOuN3Y= -go.opentelemetry.io/collector/component v0.117.0/go.mod h1:+SxJgeMwNV6y3aKNR2sP0PfovcUlRwC0+pEv4tTYdXA= -go.opentelemetry.io/collector/component/componentstatus v0.117.0 h1:8PGN66p9o5L7xCfT4jDJHd3d2VdtIuzPU2mEXOSONt8= -go.opentelemetry.io/collector/component/componentstatus v0.117.0/go.mod h1:u8tVDI+S9TxBa5NtxJNdxqjI0CLIzbmqbRl9DPrdR/0= -go.opentelemetry.io/collector/component/componenttest v0.117.0 h1:r3k0BsU/cJlqVQRtgFjxfduNEGaM2qCAU7JitIGkRds= -go.opentelemetry.io/collector/component/componenttest v0.117.0/go.mod h1:MoBWSGb3KwGc5FAIO+htez/QWK2uqJ4fnbEnfHB384c= -go.opentelemetry.io/collector/config/configauth v0.117.0 h1:o+sEz1aeS01XD3procwMmvDAhGHFFH1dxmC6XHwxG6s= -go.opentelemetry.io/collector/config/configauth v0.117.0/go.mod h1:oWkIayfVGS/ED6jEDTILSypW8MVNZ/bHd11lXrt7fsQ= -go.opentelemetry.io/collector/config/configcompression v1.23.0 h1:KCEztOb+2L4+dUCCadOW/byRiw7LbgguNqHD5LxJcwY= -go.opentelemetry.io/collector/config/configcompression v1.23.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= -go.opentelemetry.io/collector/config/confighttp v0.117.0 h1:0BRGo1aivqIsGtAMmxTZ0u3rlGJ073+iyHD5RvUOtQk= -go.opentelemetry.io/collector/config/confighttp v0.117.0/go.mod h1:iNCp62v5k9SPTOdOxQlPfs/4gLGh7YLGpjP//9uvT0A= -go.opentelemetry.io/collector/config/configopaque v1.23.0 h1:SEnEzOHufGc4KGOjQq8zKIQuDBmRFl9ncZ3qs1SRpJk= -go.opentelemetry.io/collector/config/configopaque v1.23.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/client v1.24.0 h1:eH7ctqDnRWNH5QVVbAvdYYdkvr8QWLkEm8FUPaaYbWE= +go.opentelemetry.io/collector/client v1.24.0/go.mod h1:C/38SYPa0tTL6ikPz/glYz6f3GVzEuT4nlEml6IBDMw= +go.opentelemetry.io/collector/component v0.118.0 h1:sSO/ObxJ+yH77Z4DmT1mlSuxhbgUmY1ztt7xCA1F/8w= +go.opentelemetry.io/collector/component v0.118.0/go.mod h1:LUJ3AL2b+tmFr3hZol3hzKzCMvNdqNq0M5CF3SWdv4M= +go.opentelemetry.io/collector/component/componentstatus v0.118.0 h1:1aCIdUjqz0noKNQr1v04P+lwF89Lkua5U7BhH9IAxkE= +go.opentelemetry.io/collector/component/componentstatus v0.118.0/go.mod h1:ynO1Nyj0t1h6x/djIMJy35bhnnWEc2mlQaFgDNUO504= +go.opentelemetry.io/collector/component/componenttest v0.118.0 h1:knEHckoiL2fEWSIc0iehg39zP4IXzi9sHa45O+oxKo8= +go.opentelemetry.io/collector/component/componenttest v0.118.0/go.mod h1:aHc7t7zVwCpbhrWIWY+GMuaMxMCUP8C8P7pJOt8r/vU= +go.opentelemetry.io/collector/config/configauth v0.118.0 h1:uBH/s9kRw/m7VWuibrkCzbXSCVLf9ElKq9NuKb0wAwk= +go.opentelemetry.io/collector/config/configauth v0.118.0/go.mod h1:uAmSGkihIENoIah6mEQ8S/HX4oiFOHZu3EoZLZwi9OI= +go.opentelemetry.io/collector/config/configcompression v1.24.0 h1:jyM6BX7wYcrh+eVSC0FMbWgy/zb9iP58SerOrvisccE= +go.opentelemetry.io/collector/config/configcompression v1.24.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/confighttp v0.118.0 h1:ey50dfySOCPgUPJ1x8Kq6CmNcv/TpZHt6cYmPhZItj0= +go.opentelemetry.io/collector/config/confighttp v0.118.0/go.mod h1:4frheVFiIfKUHuD/KAPn+u+d+EUx5GlQTNmoI1ftReA= +go.opentelemetry.io/collector/config/configopaque v1.24.0 h1:EPOprMDreZPKyIgT0/eVBvEGQVvq7ncvBCBVnWerj54= +go.opentelemetry.io/collector/config/configopaque v1.24.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= go.opentelemetry.io/collector/config/configretry v1.23.0 h1:0Ox2KvTZyNdgureAs3kJzsNIa6ttrx9bwlKjj/p4fGU= go.opentelemetry.io/collector/config/configretry v1.23.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= -go.opentelemetry.io/collector/config/configtelemetry v0.117.0 h1:xsMfc89VByIF2fJzWuxs/2eqy44DWfNBAysReG4TAr8= -go.opentelemetry.io/collector/config/configtelemetry v0.117.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= -go.opentelemetry.io/collector/config/configtls v1.23.0 h1:52q9dAV923hHn1aoYQyKGnrRXCPvTTT3DXurtxcpZaQ= -go.opentelemetry.io/collector/config/configtls v1.23.0/go.mod h1:cjMoqKm4MX9sc9qyEW5/kRepiKLuDYqFofGa0f/rqFE= -go.opentelemetry.io/collector/confmap v1.23.0 h1:EY+auc0kbyZ4HIfkLYeJyLDCZIFzMA1u8QRGW4bC1Ag= -go.opentelemetry.io/collector/confmap v1.23.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/config/configtelemetry v0.118.0 h1:UlN46EViG2X42odWtXgWaqY7Y01ZKpsnswSwXTWx5mM= +go.opentelemetry.io/collector/config/configtelemetry v0.118.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.24.0 h1:rOhl8qjIlUVVRHnwQj6/vZe6cuCYImyx7aVDBR35bqI= +go.opentelemetry.io/collector/config/configtls v1.24.0/go.mod h1:d0OdfkbuYEMYDBJLSbpH0wPI29lmSiFT3geqh/ygF2k= +go.opentelemetry.io/collector/confmap v1.24.0 h1:UUHVhkDCsVw14jPOarug9PDQE2vaB2ELPWMr7ARFBCA= +go.opentelemetry.io/collector/confmap v1.24.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= go.opentelemetry.io/collector/confmap/provider/envprovider v1.23.0 h1:b1aZxceRYYH1wXqqVHYZpepiVKYy8WJ27NHq/KQFQJs= go.opentelemetry.io/collector/confmap/provider/envprovider v1.23.0/go.mod h1:c1zdel/NZJumOWY8RhKfOuF/uxihNxQrJzBQcnY0HFw= go.opentelemetry.io/collector/confmap/provider/fileprovider v1.23.0 h1:2CwU9PZLCP76iNTk6vP1CN3BA1C9OnnebpCE0WQf6F4= @@ -164,26 +166,26 @@ go.opentelemetry.io/collector/connector/connectortest v0.117.0 h1:tRes8VpoYEXbOZ go.opentelemetry.io/collector/connector/connectortest v0.117.0/go.mod h1:rb7ax+hQzL2fiUFI9QpfOPQX2S6GfJlyxjT4tsIYODQ= go.opentelemetry.io/collector/connector/xconnector v0.117.0 h1:H4tTVBKDW9bfEJ+6p6ZDIdN7yUkGl59ELs0+46UtQ78= go.opentelemetry.io/collector/connector/xconnector v0.117.0/go.mod h1:aAfKBBFnJrPgKC653Lt1gwfTDbSZUuTY4TPI7Fcv9MM= -go.opentelemetry.io/collector/consumer v1.23.0 h1:JT0nE1vikL5yIk97IHBGzwx8co3w1WsAd3GFEl8r9XA= -go.opentelemetry.io/collector/consumer v1.23.0/go.mod h1:8d0uQ6gq64LbPktV4sc888lRj1cQCmrdl13hRIEURgA= -go.opentelemetry.io/collector/consumer/consumererror v0.117.0 h1:PPIZCcYZcENnyIrpRV4ERvMUoPSTV0zIP0QPzJvz80g= -go.opentelemetry.io/collector/consumer/consumererror v0.117.0/go.mod h1:L47xOVC+Vzos8350j3SWtU43w7rzms6UDhb6IrFxymY= -go.opentelemetry.io/collector/consumer/consumertest v0.117.0 h1:9WFyyjLudvfJDEuUaGsQyNRd1m6D1iRg8Iyg3xliFko= -go.opentelemetry.io/collector/consumer/consumertest v0.117.0/go.mod h1:B7A+OS76QKAzM8W7cmvlfVynFELj9Sa444hSm1SILFw= -go.opentelemetry.io/collector/consumer/xconsumer v0.117.0 h1:vsBNJGaEbYqgMU3PEsOcqjMxX5ul++Cxda44sttoi8c= -go.opentelemetry.io/collector/consumer/xconsumer v0.117.0/go.mod h1:dTr+Tms53lRLvR3OAzYic0yhcwldhTUdVIwJNSDmBmw= +go.opentelemetry.io/collector/consumer v1.24.0 h1:7DeyBm9qdr1EPuCfPjWyChPK16DbVc0wZeSa9LZprFU= +go.opentelemetry.io/collector/consumer v1.24.0/go.mod h1:0G6jvZprIp4dpKMD1ZxCjriiP9GdFvFMObsQEtTk71s= +go.opentelemetry.io/collector/consumer/consumererror v0.118.0 h1:Cx//ZFDa6wUEoRDRYRZ/Rkb52dWNoHj2e9FdlcM9jCA= +go.opentelemetry.io/collector/consumer/consumererror v0.118.0/go.mod h1:2mhnzzLYR5zS2Zz4h9ZnRM8Uogu9qatcfQwGNenhing= +go.opentelemetry.io/collector/consumer/consumertest v0.118.0 h1:8AAS9ejQapP1zqt0+cI6u+AUBheT3X0171N9WtXWsVY= +go.opentelemetry.io/collector/consumer/consumertest v0.118.0/go.mod h1:spRM2wyGr4QZzqMHlLmZnqRCxqXN4Wd0piogC4Qb5PQ= +go.opentelemetry.io/collector/consumer/xconsumer v0.118.0 h1:guWnzzRqgCInjnYlOQ1BPrimppNGIVvnknAjlIbWXuY= +go.opentelemetry.io/collector/consumer/xconsumer v0.118.0/go.mod h1:C5V2d6Ys/Fi6k3tzjBmbdZ9v3J/rZSAMlhx4KVcMIIg= go.opentelemetry.io/collector/exporter v0.117.0 h1:A9kVXzdb8i1eFELImuaSPyijAfg4qMIpM/4y/98mlxk= go.opentelemetry.io/collector/exporter v0.117.0/go.mod h1:Cbrorch2s18w1X7+A+zXQtAffbInnIOP7Su26gbRG+k= go.opentelemetry.io/collector/exporter/exportertest v0.117.0 h1:u+loeqxpniMiJL1iqc/lCCcfniWrqHBgJTAjXfqVBqQ= go.opentelemetry.io/collector/exporter/exportertest v0.117.0/go.mod h1:GyHwJLsOPPau0m+TYrIA7jWD9/GU+ID+l/9sL0cAqhE= go.opentelemetry.io/collector/exporter/xexporter v0.117.0 h1:BB8D0Dvb46CVAZrnPEg5nYgXO7LzONmXeGKEfzSIOZs= go.opentelemetry.io/collector/exporter/xexporter v0.117.0/go.mod h1:yo0T8WkvLCJ7NOqIquHGFe4Xpuc4CbDb8a06T2G5De4= -go.opentelemetry.io/collector/extension v0.117.0 h1:B3cG7g+wbhmpMFugaDxOcyiPKeulaW8+EQdJbZxDfho= -go.opentelemetry.io/collector/extension v0.117.0/go.mod h1:WjyD5h9N5Y0SF8azB2rulvHJieJoWqroGO5hi3ax5+8= -go.opentelemetry.io/collector/extension/auth v0.117.0 h1:tXQdYIdcABXalWyFZP22pREY7+nWUNurx8Y6FseWs7w= -go.opentelemetry.io/collector/extension/auth v0.117.0/go.mod h1:ofrV2BuE46+k7Su/h0ccrMl5Zk5Y7NVlzOb3AwU7Dzw= -go.opentelemetry.io/collector/extension/auth/authtest v0.117.0 h1:wV4OIiWrt7gteQrxL8MCmGvjGhMiu5TplKJHOfVZO6Y= -go.opentelemetry.io/collector/extension/auth/authtest v0.117.0/go.mod h1:nHxcAOyo26JnuYwKIoQM9mDlSXpERQrbjIw3Dtp9hug= +go.opentelemetry.io/collector/extension v0.118.0 h1:9o5jLCTRvs0+rtFDx04zTBuB4WFrE0RvtVCPovYV0sA= +go.opentelemetry.io/collector/extension v0.118.0/go.mod h1:BFwB0WOlse6JnrStO44+k9kwUVjjtseFEHhJLHD7lBg= +go.opentelemetry.io/collector/extension/auth v0.118.0 h1:+eMNUBUK1JK9A3mr95BasbWE90Lxu+WlR9sqS36sJms= +go.opentelemetry.io/collector/extension/auth v0.118.0/go.mod h1:MJpYcRGSERkgOhczqTKoAhkHmcugr+YTlRhc/SpYYYI= +go.opentelemetry.io/collector/extension/auth/authtest v0.118.0 h1:KIORXNc71vfpQrrZOntiZesRCZtQ8alrASWVT/zZkyo= +go.opentelemetry.io/collector/extension/auth/authtest v0.118.0/go.mod h1:0ZlSP9NPAfTRQd6Tx4mOH0IWrp6ufHaVN//L9Mb87gM= go.opentelemetry.io/collector/extension/extensioncapabilities v0.117.0 h1:YbCF0s0jywLZgwNUyKdPUMLMZs3nUPm1tGvJz8x6wTU= go.opentelemetry.io/collector/extension/extensioncapabilities v0.117.0/go.mod h1:VArn6UKAy4pqlATfhDFfc8UOwX/TtavPF5pgAL70AEw= go.opentelemetry.io/collector/extension/extensiontest v0.117.0 h1:XH+tkHdATylYZtASZKK3rCoN/xlaFi8MXLh07ZlQQWw= @@ -194,22 +196,22 @@ go.opentelemetry.io/collector/extension/zpagesextension v0.117.0 h1:TNSMgnCYZ1He go.opentelemetry.io/collector/extension/zpagesextension v0.117.0/go.mod h1:c82ly0hN5nMEtXY9mNdS9xVToYxbUjXblnXZCoICwCc= go.opentelemetry.io/collector/featuregate v1.23.0 h1:N033ROo85qKrsK16QzR6RV+3UWOWF7kpOO8FSnX99s0= go.opentelemetry.io/collector/featuregate v1.23.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= -go.opentelemetry.io/collector/filter v0.117.0 h1:iQAbrho8TzcOxoroJDiQnvy1KvfTqwwNAhtg/sXYYAE= -go.opentelemetry.io/collector/filter v0.117.0/go.mod h1:MUyBRsy3IKVixSWIfA9BXzHhx24LHo4y38uQmFlqddA= +go.opentelemetry.io/collector/filter v0.118.0 h1:mvf08g5VHUcyhqobqId2bVGhgcs1RNR69INGlT0LEsA= +go.opentelemetry.io/collector/filter v0.118.0/go.mod h1:Pgii0Ad2PXdxYSYYqki6Mr4gZdueJG9rDOiaB3fXf3Q= go.opentelemetry.io/collector/internal/fanoutconsumer v0.117.0 h1:IfObXF9WEixWA9baPt0d4GOv8XGxmlsX7oAyD9Gdq/4= go.opentelemetry.io/collector/internal/fanoutconsumer v0.117.0/go.mod h1:n+hmwNk4CbOTmQyUo1K4CEnCGcrPd7RY3E6ljrQ2GYo= go.opentelemetry.io/collector/otelcol v0.117.0 h1:BWmXS+Qh8ypu95w5PKz4NEcyRfX9TzoXQaqD6antji8= go.opentelemetry.io/collector/otelcol v0.117.0/go.mod h1:jbEizqJKjZ1Q7XIbKvYc+vF2sxW5aw0LO7U8wj7wysM= go.opentelemetry.io/collector/otelcol/otelcoltest v0.117.0 h1:uELK5WYoofV19gAq0cZrmAAcBO/SP94fheYJ/+bm49g= go.opentelemetry.io/collector/otelcol/otelcoltest v0.117.0/go.mod h1:Xo9X7JBQVCCjkkMjkRdsuvrwM82xk67HuUge7zXm5FU= -go.opentelemetry.io/collector/pdata v1.23.0 h1:tEk0dkfB8RdSukoOMfEa8duB938gfZowdfRkrJxGDrw= -go.opentelemetry.io/collector/pdata v1.23.0/go.mod h1:I2jggpBMiO8A+7TXhzNpcJZkJtvi1cU0iVNIi+6bc+o= -go.opentelemetry.io/collector/pdata/pprofile v0.117.0 h1:AyOK+rkNGeawmLGUqF84wYks22BSGJtEV++3YSfvD1I= -go.opentelemetry.io/collector/pdata/pprofile v0.117.0/go.mod h1:eh7TLIkLrSI79/R3RL+sZsKpLS0k+83WntucPtXC5Ak= -go.opentelemetry.io/collector/pdata/testdata v0.117.0 h1:ainpacShKHaDkPK6lcvgJ0aPKYUD/E3+I0gYJZleedo= -go.opentelemetry.io/collector/pdata/testdata v0.117.0/go.mod h1:LZAymmRKHQEqJqJUSO15rej3+V1rNRyBMF5mWCKCMBY= -go.opentelemetry.io/collector/pipeline v0.117.0 h1:CSv0Dd3n9AQNQ73e7PdEkgexkSMRZliKATxkoZKUFcY= -go.opentelemetry.io/collector/pipeline v0.117.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/pdata v1.24.0 h1:D6j92eAzmAbQgivNBUnt8r9juOl8ugb+ihYynoFZIEg= +go.opentelemetry.io/collector/pdata v1.24.0/go.mod h1:cf3/W9E/uIvPS4MR26SnMFJhraUCattzzM6qusuONuc= +go.opentelemetry.io/collector/pdata/pprofile v0.118.0 h1:VK/fr65VFOwEhsSGRPj5c3lCv0yIK1Kt0sZxv9WZBb8= +go.opentelemetry.io/collector/pdata/pprofile v0.118.0/go.mod h1:eJyP/vBm179EghV3dPSnamGAWQwLyd+4z/3yG54YFoQ= +go.opentelemetry.io/collector/pdata/testdata v0.118.0 h1:5N0w1SX9KIRkwvtkrpzQgXy9eGk3vfNG0ds6mhEPMIM= +go.opentelemetry.io/collector/pdata/testdata v0.118.0/go.mod h1:UY+GHV5bOC1BnFburOZ0wiHReJj1XbW12mi2Ogbc5Lw= +go.opentelemetry.io/collector/pipeline v0.118.0 h1:RI1DMe7L0+5hGkx0EDGxG00TaJoh96MEQppgOlGx1Oc= +go.opentelemetry.io/collector/pipeline v0.118.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= go.opentelemetry.io/collector/pipeline/xpipeline v0.117.0 h1:jnHQNaNfVRIdrtOPCORUy8s1cEJyxql3uv/WQ1ve1Js= go.opentelemetry.io/collector/pipeline/xpipeline v0.117.0/go.mod h1:lNY3uQjRcb3f7CW1JQMXJcWzCJp5122LOKrKs5eito8= go.opentelemetry.io/collector/processor v0.117.0 h1:K4WdaNC5ROIoLRGgyHmXxtw7xVpAMR4cIMQ5PVLP5cI= @@ -218,32 +220,32 @@ go.opentelemetry.io/collector/processor/processortest v0.117.0 h1:c2zjsm3nQDkq9G go.opentelemetry.io/collector/processor/processortest v0.117.0/go.mod h1:nywNHogkxp++ab3QkXpWKlv41Gkm9cAYB4PHvyoHwjs= go.opentelemetry.io/collector/processor/xprocessor v0.117.0 h1:yGBjlY8HRb2AqYo1Q8pKJOLRbmZKrjeeTO4COiP45OU= go.opentelemetry.io/collector/processor/xprocessor v0.117.0/go.mod h1:MnyEaS47cqol7Cph6LnYIp0g2Km4M+I1vWTwiDeuBN0= -go.opentelemetry.io/collector/receiver v0.117.0 h1:jm+b2G2IKKwGE213lB9cviKEdeATvYtNSY1kO0XdpMM= -go.opentelemetry.io/collector/receiver v0.117.0/go.mod h1:fZXigB3afp54OE+ogPcup/RPwI7j+CwZh9Mz6ObB/Cg= -go.opentelemetry.io/collector/receiver/receivertest v0.117.0 h1:aN4zOuWsiARa+RG9f89JyIrJbx5wsQ71Y0giiHsO1z8= -go.opentelemetry.io/collector/receiver/receivertest v0.117.0/go.mod h1:1wnGEowDmlO89feq1P+b4tQI2G/+iJxRrMallw7zeJE= -go.opentelemetry.io/collector/receiver/xreceiver v0.117.0 h1:HJjBj6P3/WQoYaRKZkWZHnUUCVFpBieqGKzKHcT6HUw= -go.opentelemetry.io/collector/receiver/xreceiver v0.117.0/go.mod h1:K1qMjIiAg6i3vHA+/EpM8nkhna3uIgoEellE2yuhz7A= -go.opentelemetry.io/collector/scraper v0.117.0 h1:FFBM6Pzc3L0sTronrceanvqxT74Nurbi8usUSImexJ0= -go.opentelemetry.io/collector/scraper v0.117.0/go.mod h1:6dM+85+aNPWfu63H+m8ZZutxDYCrWVXJ1yylR0jB9kA= -go.opentelemetry.io/collector/scraper/scraperhelper v0.117.0 h1:jyQ7cdanR541XKSryExBNYKZVvVw27Sos1Rb88Sf/II= -go.opentelemetry.io/collector/scraper/scraperhelper v0.117.0/go.mod h1:zt7M+HIlYJHdnFC5smM8AaczZevVHYkaG1yjnq26/i8= -go.opentelemetry.io/collector/semconv v0.117.0 h1:SavOvSbHPVD/QdAnXlI/cMca+yxCNyXStY1mQzerHs4= -go.opentelemetry.io/collector/semconv v0.117.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= +go.opentelemetry.io/collector/receiver v0.118.0 h1:X4mspHmbbtwdCQZ7o370kNmdWfxRnK1FrsvEShCCKEc= +go.opentelemetry.io/collector/receiver v0.118.0/go.mod h1:wFyfu6sgrkDPLQoGOGMuChGZzkZnYcI/tPJWV4CRTzs= +go.opentelemetry.io/collector/receiver/receivertest v0.118.0 h1:XlMr2mPsyXJsMUOqCpEoY3uCPsLZQbNA5fmVNDGB7Bw= +go.opentelemetry.io/collector/receiver/receivertest v0.118.0/go.mod h1:dtu/H1RNjhy11hTVf/XUfc02uGufMhYYdhhYBbglcUg= +go.opentelemetry.io/collector/receiver/xreceiver v0.118.0 h1:dzECve9e0H3ot0JWnWPuQr9Y84RhOYSd0+CjvJskx7Y= +go.opentelemetry.io/collector/receiver/xreceiver v0.118.0/go.mod h1:Lv1nD/mSYSP64iV8k+C+mWWZZOMLRubv9d1SUory3/E= +go.opentelemetry.io/collector/scraper v0.118.0 h1:944QgQVZ7PM0L9WIwgRPY0LbbHX5qsk2x4uxDO1IOAQ= +go.opentelemetry.io/collector/scraper v0.118.0/go.mod h1:wIa4bIqiU9bkeg3v5QQybwz1+K5DjrP1Afc13Kt22Cw= +go.opentelemetry.io/collector/scraper/scraperhelper v0.118.0 h1:kZu4TgGGSWlNP9ogVr3pVQGX6J/P8ooPj8wMH5+aWyQ= +go.opentelemetry.io/collector/scraper/scraperhelper v0.118.0/go.mod h1:NKOcwL580ycua1HQ9K3OUucBsMsVL5DbvOJxGtg4chs= +go.opentelemetry.io/collector/semconv v0.118.0 h1:V4vlMIK7TIaemrrn2VawvQPwruIKpj7Xgw9P5+BL56w= +go.opentelemetry.io/collector/semconv v0.118.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/collector/service v0.117.0 h1:yx3ZwnjHcL1YAWZDK2Kxco1BSB228+RaCwgmMzXykqE= go.opentelemetry.io/collector/service v0.117.0/go.mod h1:Mtxu9Qn/90kdRrEqRr6n7MbtnW6qF1qCIi/u2LMYrRo= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 h1:j8icMXyyqNf6HGuwlYhniPnVsbJIq7n+WirDu3VAJdQ= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0/go.mod h1:evIOZpl+kAlU5IsaYX2Siw+IbpacAZvXemVsgt70uvw= go.opentelemetry.io/contrib/config v0.10.0 h1:2JknAzMaYjxrHkTnZh3eOme/Y2P5eHE2SWfhfV6Xd6c= go.opentelemetry.io/contrib/config v0.10.0/go.mod h1:aND2M6/KfNkntI5cyvHriR/zvZgPf8j9yETdSmvpfmc= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I= go.opentelemetry.io/contrib/propagators/b3 v1.31.0 h1:PQPXYscmwbCp76QDvO4hMngF2j8Bx/OTV86laEl8uqo= go.opentelemetry.io/contrib/propagators/b3 v1.31.0/go.mod h1:jbqfV8wDdqSDrAYxVpXQnpM0XFMq2FtDesblJ7blOwQ= go.opentelemetry.io/contrib/zpages v0.56.0 h1:W7vP6s3juzL5KiHpr41zLNmsJ0QAZudYu8ay0zGAoko= go.opentelemetry.io/contrib/zpages v0.56.0/go.mod h1:IxPRP4TYHw9jLeaEOSDIiA9zmyJNZNO6sbW55iMvSXs= -go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= -go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.7.0 h1:mMOmtYie9Fx6TSVzw4W+NTpvoaS1JWWga37oI1a/4qQ= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.7.0/go.mod h1:yy7nDsMMBUkD+jeekJ36ur5f3jJIrmCwUrY67VFhNpA= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.32.0 h1:j7ZSD+5yn+lo3sGV69nW04rRR0jhYnBwjuX3r0HvnK0= @@ -266,16 +268,16 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0 h1:UGZ1QwZWY67Z6Bm go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0/go.mod h1:fcwWuDuaObkkChiDlhEpSq9+X1C0omv+s5mBtToAQ64= go.opentelemetry.io/otel/log v0.8.0 h1:egZ8vV5atrUWUbnSsHn6vB8R21G2wrKqNiDt3iWertk= go.opentelemetry.io/otel/log v0.8.0/go.mod h1:M9qvDdUTRCopJcGRKg57+JSQ9LgLBrwwfC32epk5NX8= -go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= -go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= go.opentelemetry.io/otel/sdk/log v0.7.0 h1:dXkeI2S0MLc5g0/AwxTZv6EUEjctiH8aG14Am56NTmQ= go.opentelemetry.io/otel/sdk/log v0.7.0/go.mod h1:oIRXpW+WD6M8BuGj5rtS0aRu/86cbDV/dAfNaZBIjYM= go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= -go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= -go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -322,14 +324,14 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= -google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g= -google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:dguCy7UOdZhTvLzDyt15+rOrawrpM4q7DD9dQ1P11P4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 h1:IfdSdTcLFy4lqUQrQJLkLt1PB+AsqVz6lwkWPzWEz10= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= -google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= -google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= -google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= -google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 h1:J1H9f+LEdWAfHcez/4cvaVBox7cOYT+IU6rgqj5x++8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk= +google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= +google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw= +google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= +google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go index 3ac64b8e3d97..4f3f04e5aba1 100644 --- a/receiver/githubreceiver/model.go +++ b/receiver/githubreceiver/model.go @@ -189,7 +189,7 @@ func (gtr *githubTracesReceiver) getWorkflowAttrs(resource pcommon.Resource, e * // replaced by hyphens. If none of these are set, it returns "unknown_service" // and an error. // func (gtr *githubTracesReceiver) getServiceName(customProps map[string]interface{}, repoName string) (string, error) { -func (gtr *githubTracesReceiver) getServiceName(customProps interface{}, repoName string) (string, error) { +func (gtr *githubTracesReceiver) getServiceName(customProps any, repoName string) (string, error) { switch { case gtr.cfg.WebHook.ServiceName != "": formatted := formatString(gtr.cfg.WebHook.ServiceName) @@ -205,7 +205,7 @@ func (gtr *githubTracesReceiver) getServiceName(customProps interface{}, repoNam default: // This should never happen, but in the event it does, unknown_service // and a error will be returned to abide by semantic conventions. - return "unkown_service", errors.New("unable to generate service.name resource attribute") + return "unknown_service", errors.New("unable to generate service.name resource attribute") } } diff --git a/receiver/githubreceiver/model_test.go b/receiver/githubreceiver/model_test.go index 09bba1f7db03..a73029fae742 100644 --- a/receiver/githubreceiver/model_test.go +++ b/receiver/githubreceiver/model_test.go @@ -1,3 +1,6 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + package githubreceiver import "testing" diff --git a/receiver/githubreceiver/trace_event_handling.go b/receiver/githubreceiver/trace_event_handling.go index 890bbf3a6a94..fab6a2f92d9a 100644 --- a/receiver/githubreceiver/trace_event_handling.go +++ b/receiver/githubreceiver/trace_event_handling.go @@ -1,3 +1,6 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" import ( @@ -7,10 +10,9 @@ import ( "fmt" "github.com/google/go-github/v68/github" - "go.uber.org/zap" - "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" + "go.uber.org/zap" ) func (gtr *githubTracesReceiver) handleWorkflowRun(e *github.WorkflowRunEvent) (ptrace.Traces, error) { @@ -24,7 +26,7 @@ func (gtr *githubTracesReceiver) handleWorkflowRun(e *github.WorkflowRunEvent) ( return ptrace.Traces{}, fmt.Errorf("failed to get workflow attributes: %w", err) } - traceID, err := newTraceID(e.GetWorkflowRun().GetID(), int(e.GetWorkflowRun().GetRunAttempt())) + traceID, err := newTraceID(e.GetWorkflowRun().GetID(), e.GetWorkflowRun().GetRunAttempt()) if err != nil { gtr.logger.Sugar().Errorf("Failed to generate trace ID", zap.String("error", fmt.Sprint(err))) } @@ -88,7 +90,7 @@ func newParentSpanID(runID int64, runAttempt int) (pcommon.SpanID, error) { } // createRootSpan creates a root span based on the provided event, associated -// with the determinitic traceID. +// with the deterministic traceID. func (gtr *githubTracesReceiver) createRootSpan( resourceSpans ptrace.ResourceSpans, event *github.WorkflowRunEvent, diff --git a/receiver/githubreceiver/trace_event_handling_test.go b/receiver/githubreceiver/trace_event_handling_test.go index 29fdd465a287..1e3c9de6bbb9 100644 --- a/receiver/githubreceiver/trace_event_handling_test.go +++ b/receiver/githubreceiver/trace_event_handling_test.go @@ -4,220 +4,214 @@ package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver" import ( - // "context" - // "net/http" - // "net/http/httptest" - // "os" - "time" "testing" + "time" - "go.uber.org/zap" + "github.com/google/go-github/v68/github" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/pcommon" - "github.com/google/go-github/v68/github" "go.opentelemetry.io/collector/pdata/ptrace" - // "go.opentelemetry.io/collector/component/componenttest" - // "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver/receivertest" + "go.uber.org/zap" ) func TestHandleWorkflowRun(t *testing.T) { - // Helper function to create a test workflow run event - createTestWorkflowRunEvent := func(id int64, runAttempt int, name, conclusion string, startTime, updateTime time.Time) *github.WorkflowRunEvent { - return &github.WorkflowRunEvent{ - WorkflowRun: &github.WorkflowRun{ - ID: &id, - Name: &name, - RunAttempt: &runAttempt, - RunStartedAt: &github.Timestamp{Time: startTime}, - UpdatedAt: &github.Timestamp{Time: updateTime}, - Conclusion: &conclusion, - }, - Repo: &github.Repository{ - Name: github.Ptr("test-repo"), - Organization: &github.Organization{Login: github.Ptr("test-org")}, - DefaultBranch: github.Ptr("main"), - CustomProperties: map[string]interface{}{ - "service_name": "test-service", - }, - }, - Workflow: &github.Workflow{ - Name: github.Ptr("test-workflow"), - Path: github.Ptr(".github/workflows/test.yml"), - }, - } - } - - tests := []struct { - name string - event *github.WorkflowRunEvent - wantErr bool - validate func(t *testing.T, traces ptrace.Traces) - }{ - { - name: "successful workflow run", - event: createTestWorkflowRunEvent( - 123, - 1, - "Test Workflow", - "success", - time.Now().Add(-time.Hour), - time.Now(), - ), - wantErr: false, - validate: func(t *testing.T, traces ptrace.Traces) { - require.Equal(t, 1, traces.ResourceSpans().Len()) - - rs := traces.ResourceSpans().At(0) - require.Equal(t, 1, rs.ScopeSpans().Len()) - - spans := rs.ScopeSpans().At(0).Spans() - require.Equal(t, 1, spans.Len()) - - span := spans.At(0) - require.Equal(t, "Test Workflow", span.Name()) - require.Equal(t, ptrace.SpanKindServer, span.Kind()) - require.Equal(t, ptrace.StatusCodeOk, span.Status().Code()) - require.Equal(t, "success", span.Status().Message()) - }, - }, - { - name: "failed workflow run", - event: createTestWorkflowRunEvent( - 124, - 1, - "Test Workflow", - "failure", - time.Now().Add(-time.Hour), - time.Now(), - ), - wantErr: false, - validate: func(t *testing.T, traces ptrace.Traces) { - spans := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans() - span := spans.At(0) - require.Equal(t, ptrace.StatusCodeError, span.Status().Code()) - require.Equal(t, "failure", span.Status().Message()) - }, - }, - { - name: "workflow run with retry", - event: func() *github.WorkflowRunEvent { - e := createTestWorkflowRunEvent( - 125, - 2, - "Test Workflow", - "success", - time.Now().Add(-time.Hour), - time.Now(), - ) - previousURL := "https://api.github.com/repos/test-org/test-repo/actions/runs/125/attempts/1" - e.WorkflowRun.PreviousAttemptURL = &previousURL - return e - }(), - wantErr: false, - validate: func(t *testing.T, traces ptrace.Traces) { - spans := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans() - span := spans.At(0) - require.Equal(t, 1, span.Links().Len()) - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // Create a new receiver with a test logger - logger := zap.NewNop() - receiver := &githubTracesReceiver{ - logger: logger, - cfg: createDefaultConfig().(*Config), - settings: receivertest.NewNopSettings(), - } - - // Handle the workflow run event - traces, err := receiver.handleWorkflowRun(tt.event) - - if tt.wantErr { - require.Error(t, err) - return - } - - require.NoError(t, err) - tt.validate(t, traces) - }) - } + // Helper function to create a test workflow run event + createTestWorkflowRunEvent := func(id int64, runAttempt int, name, conclusion string, startTime, updateTime time.Time) *github.WorkflowRunEvent { + return &github.WorkflowRunEvent{ + WorkflowRun: &github.WorkflowRun{ + ID: &id, + Name: &name, + RunAttempt: &runAttempt, + RunStartedAt: &github.Timestamp{Time: startTime}, + UpdatedAt: &github.Timestamp{Time: updateTime}, + Conclusion: &conclusion, + }, + Repo: &github.Repository{ + Name: github.Ptr("test-repo"), + Organization: &github.Organization{Login: github.Ptr("test-org")}, + DefaultBranch: github.Ptr("main"), + CustomProperties: map[string]any{ + "service_name": "test-service", + }, + }, + Workflow: &github.Workflow{ + Name: github.Ptr("test-workflow"), + Path: github.Ptr(".github/workflows/test.yml"), + }, + } + } + + tests := []struct { + name string + event *github.WorkflowRunEvent + wantErr bool + validate func(t *testing.T, traces ptrace.Traces) + }{ + { + name: "successful workflow run", + event: createTestWorkflowRunEvent( + 123, + 1, + "Test Workflow", + "success", + time.Now().Add(-time.Hour), + time.Now(), + ), + wantErr: false, + validate: func(t *testing.T, traces ptrace.Traces) { + require.Equal(t, 1, traces.ResourceSpans().Len()) + + rs := traces.ResourceSpans().At(0) + require.Equal(t, 1, rs.ScopeSpans().Len()) + + spans := rs.ScopeSpans().At(0).Spans() + require.Equal(t, 1, spans.Len()) + + span := spans.At(0) + require.Equal(t, "Test Workflow", span.Name()) + require.Equal(t, ptrace.SpanKindServer, span.Kind()) + require.Equal(t, ptrace.StatusCodeOk, span.Status().Code()) + require.Equal(t, "success", span.Status().Message()) + }, + }, + { + name: "failed workflow run", + event: createTestWorkflowRunEvent( + 124, + 1, + "Test Workflow", + "failure", + time.Now().Add(-time.Hour), + time.Now(), + ), + wantErr: false, + validate: func(t *testing.T, traces ptrace.Traces) { + spans := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans() + span := spans.At(0) + require.Equal(t, ptrace.StatusCodeError, span.Status().Code()) + require.Equal(t, "failure", span.Status().Message()) + }, + }, + { + name: "workflow run with retry", + event: func() *github.WorkflowRunEvent { + e := createTestWorkflowRunEvent( + 125, + 2, + "Test Workflow", + "success", + time.Now().Add(-time.Hour), + time.Now(), + ) + previousURL := "https://api.github.com/repos/test-org/test-repo/actions/runs/125/attempts/1" + e.WorkflowRun.PreviousAttemptURL = &previousURL + return e + }(), + wantErr: false, + validate: func(t *testing.T, traces ptrace.Traces) { + spans := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans() + span := spans.At(0) + require.Equal(t, 1, span.Links().Len()) + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Create a new receiver with a test logger + logger := zap.NewNop() + receiver := &githubTracesReceiver{ + logger: logger, + cfg: createDefaultConfig().(*Config), + settings: receivertest.NewNopSettings(), + } + + // Handle the workflow run event + traces, err := receiver.handleWorkflowRun(tt.event) + + if tt.wantErr { + require.Error(t, err) + return + } + + require.NoError(t, err) + tt.validate(t, traces) + }) + } } func TestNewParentSpanID(t *testing.T) { - tests := []struct { - name string - runID int64 - runAttempt int - wantError bool - }{ - { - name: "basic span ID generation", - runID: 12345, - runAttempt: 1, - wantError: false, - }, - { - name: "different run ID", - runID: 54321, - runAttempt: 1, - wantError: false, - }, - { - name: "different attempt", - runID: 12345, - runAttempt: 2, - wantError: false, - }, - { - name: "zero values", - runID: 0, - runAttempt: 0, - wantError: false, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // First call to get span ID - spanID1, err1 := newParentSpanID(tt.runID, tt.runAttempt) - - if tt.wantError { - require.Error(t, err1) - return - } - require.NoError(t, err1) - - // Verify span ID is not empty - require.NotEqual(t, pcommon.SpanID{}, spanID1, "span ID should not be empty") - - // Verify consistent results for same input - spanID2, err2 := newParentSpanID(tt.runID, tt.runAttempt) - require.NoError(t, err2) - require.Equal(t, spanID1, spanID2, "same inputs should generate same span ID") - - // Verify different inputs generate different span IDs - differentSpanID, err3 := newParentSpanID(tt.runID+1, tt.runAttempt) - require.NoError(t, err3) - require.NotEqual(t, spanID1, differentSpanID, "different inputs should generate different span IDs") - }) - } + tests := []struct { + name string + runID int64 + runAttempt int + wantError bool + }{ + { + name: "basic span ID generation", + runID: 12345, + runAttempt: 1, + wantError: false, + }, + { + name: "different run ID", + runID: 54321, + runAttempt: 1, + wantError: false, + }, + { + name: "different attempt", + runID: 12345, + runAttempt: 2, + wantError: false, + }, + { + name: "zero values", + runID: 0, + runAttempt: 0, + wantError: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // First call to get span ID + spanID1, err1 := newParentSpanID(tt.runID, tt.runAttempt) + + if tt.wantError { + require.Error(t, err1) + return + } + require.NoError(t, err1) + + // Verify span ID is not empty + require.NotEqual(t, pcommon.SpanID{}, spanID1, "span ID should not be empty") + + // Verify consistent results for same input + spanID2, err2 := newParentSpanID(tt.runID, tt.runAttempt) + require.NoError(t, err2) + require.Equal(t, spanID1, spanID2, "same inputs should generate same span ID") + + // Verify different inputs generate different span IDs + differentSpanID, err3 := newParentSpanID(tt.runID+1, tt.runAttempt) + require.NoError(t, err3) + require.NotEqual(t, spanID1, differentSpanID, "different inputs should generate different span IDs") + }) + } } func TestNewParentSpanID_Consistency(t *testing.T) { - // Test that generates the same span ID for same inputs across multiple calls - runID := int64(12345) - runAttempt := 1 - - spanID1, err1 := newParentSpanID(runID, runAttempt) - require.NoError(t, err1) - - for i := 0; i < 5; i++ { - spanID2, err2 := newParentSpanID(runID, runAttempt) - require.NoError(t, err2) - require.Equal(t, spanID1, spanID2, "span ID should be consistent across multiple calls") - } + // Test that generates the same span ID for same inputs across multiple calls + runID := int64(12345) + runAttempt := 1 + + spanID1, err1 := newParentSpanID(runID, runAttempt) + require.NoError(t, err1) + + for i := 0; i < 5; i++ { + spanID2, err2 := newParentSpanID(runID, runAttempt) + require.NoError(t, err2) + require.Equal(t, spanID1, spanID2, "span ID should be consistent across multiple calls") + } } diff --git a/receiver/githubreceiver/trace_receiver.go b/receiver/githubreceiver/trace_receiver.go index 0b947172d560..252bb08bf743 100644 --- a/receiver/githubreceiver/trace_receiver.go +++ b/receiver/githubreceiver/trace_receiver.go @@ -5,7 +5,6 @@ package githubreceiver // import "github.com/open-telemetry/opentelemetry-collec import ( "context" - "encoding/json" "errors" "fmt" "net/http" @@ -19,7 +18,6 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" - "go.uber.org/zap" ) @@ -150,12 +148,6 @@ func (gtr *githubTracesReceiver) handleReq(w http.ResponseWriter, req *http.Requ return } - var rawEvent interface{} - - if err := json.Unmarshal(p, &rawEvent); err != nil { - gtr.logger.Sugar().Errorf("failed to unmarshal event", zap.Error(err)) - } - var td ptrace.Traces switch e := event.(type) { case *github.WorkflowRunEvent: From a47d810816126823ca8b4af31e183428ff27d05c Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Wed, 29 Jan 2025 17:16:25 -0500 Subject: [PATCH 09/18] [chore] add changelog --- .chloggen/gh-tracing.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .chloggen/gh-tracing.yaml diff --git a/.chloggen/gh-tracing.yaml b/.chloggen/gh-tracing.yaml new file mode 100644 index 000000000000..b8fad207ad4b --- /dev/null +++ b/.chloggen/gh-tracing.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: githubreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: add support for GitHub Actions workflow run events using deterministic Trace and Root Span IDs. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [37578] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] From 8b2f03b09060e42a83b951692bc410b07ab5c726 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Thu, 30 Jan 2025 09:11:04 -0500 Subject: [PATCH 10/18] [chore] add template variables in model --- receiver/githubreceiver/model.go | 48 ++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go index 4f3f04e5aba1..c2308413f0e5 100644 --- a/receiver/githubreceiver/model.go +++ b/receiver/githubreceiver/model.go @@ -91,22 +91,33 @@ const ( AttributeCICDPipelineTaskRunStatusError = "error" AttributeCICDPipelineTaskRunStatusSkip = "skip" - // TODO: Evaluate these + // The following attributes are not part of the semantic conventions yet. AttributeCICDPipelineRunSenderLogin = "cicd.pipeline.run.sender.login" // GitHub's Run Sender Login AttributeCICDPipelineTaskRunSenderLogin = "cicd.pipeline.task.run.sender.login" // GitHub's Task Sender Login AttributeVCSVendorName = "vcs.vendor.name" // GitHub AttributeVCSRepositoryOwner = "vcs.repository.owner" // GitHub's Owner Login + AttributeCICDPipelineFilePath = "cicd.pipeline.file.path" // GitHub's Path in workflow_run - AttributeCICDPipelineFilePath = "cicd.pipeline.file.path" // GitHub's Path in workflow_run - - AttributeGitHubAppInstallationID = "github.app.installation.id" // GitHub's Installation ID - + AttributeGitHubAppInstallationID = "github.app.installation.id" // GitHub's Installation ID AttributeGitHubWorkflowRunAttempt = "github.workflow.run.attempt" // GitHub's Run Attempt // TODO: Evaluate whether or not these should be added. Always iffy on adding specific usernames and emails. - AttributeVCSRefHeadRevisionAuthorName = "vcs.ref.head.revision.author.name" // GitHub's Head Revision Author Name - AttributeVCSRefHeadRevisionAuthorEmail = "vcs.ref.head.revision.author.email" // GitHub's Head Revision Author Email + AttributeVCSRefHeadRevisionAuthorName = "vcs.ref.head.revision.author.name" // GitHub's Head Revision Author Name + AttributeVCSRefHeadRevisionAuthorEmail = "vcs.ref.head.revision.author.email" // GitHub's Head Revision Author Email + + // The following attributes are exclusive to GitHub but not listed under + // Vendor Extensions within Semantic Conventions yet. AttributeGitHubWorkflowTriggerActorUsername = "github.workflow.trigger.actor.username" // GitHub's Triggering Actor Username + + // github.reference.workflow acts as a template attribute where it'll be + // joined with a `name` and a `version` value. There is an unknown amount of + // reference workflows that are sent as a list of string by GitHub making it + // necessary to leverage template attributes. One key thing to note is the + // length of the names. Evaluate if this causes issues. + // eg. github.reference.workflow.my-great-workflow.path + // eg. github.reference.workflow.my-great-workflow.version + // eg. github.reference.workflow.my-great-workflow.revision + AttributeGitHubReferenceWorkflow = "github.reference.workflow" ) // getWorkflowAttrs returns a pcommon.Map of attributes for the Workflow Run @@ -161,13 +172,15 @@ func (gtr *githubTracesReceiver) getWorkflowAttrs(resource pcommon.Resource, e * // TODO: This attribute is important for determining what shared workflows // exist, and what versions (or shas). Previously, it would all get // appended. But this should be a slice of values instead. - // if len(e.GetWorkflowRun().ReferencedWorkflows) > 0 { - // var referencedWorkflows []string - // for _, workflow := range e.GetWorkflowRun().ReferencedWorkflows { - // referencedWorkflows = append(referencedWorkflows, workflow.GetPath()) - // } - // attrs.PutStr("cicd.pipeline.run.referenced_workflows", strings.Join(referencedWorkflows, ";")) - // } + if len(e.GetWorkflowRun().ReferencedWorkflows) > 0 { + var referencedWorkflows []string + for _, w := range e.GetWorkflowRun().ReferencedWorkflows { + referencedWorkflows = append(referencedWorkflows, w.GetPath()) + referencedWorkflows = append(referencedWorkflows, w.GetSHA()) + referencedWorkflows = append(referencedWorkflows, w.GetRef()) + } + attrs.PutStr("cicd.pipeline.run.referenced_workflows", strings.Join(referencedWorkflows, ";")) + } // TODO: Convert this to the VCS Change Request. // if len(e.GetWorkflowRun().PullRequests) > 0 { @@ -181,6 +194,11 @@ func (gtr *githubTracesReceiver) getWorkflowAttrs(resource pcommon.Resource, e * return err } +// splitRefWorkflow takes in the workl +func splitRefWorkflow(workflow string) (name string, version string, err error) { + return "", "", nil +} + // getServiceName returns a generated service.name resource attribute derived // from 1) the service_name defined in the webhook configuration 2) a // service.name value set in the custom_properties section of a GitHub event, or @@ -192,7 +210,7 @@ func (gtr *githubTracesReceiver) getWorkflowAttrs(resource pcommon.Resource, e * func (gtr *githubTracesReceiver) getServiceName(customProps any, repoName string) (string, error) { switch { case gtr.cfg.WebHook.ServiceName != "": - formatted := formatString(gtr.cfg.WebHook.ServiceName) + return formatted, nil // customProps would be an index map[string]interface{} passed in but should // only be non-nil if the index of `service_name` exists From 1aedf0cd03e8e36de5707dc362cbb6b798d38968 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Thu, 30 Jan 2025 11:21:15 -0500 Subject: [PATCH 11/18] [chore] fix removed var declaration --- receiver/githubreceiver/model.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go index c2308413f0e5..2cb89fa8e2d9 100644 --- a/receiver/githubreceiver/model.go +++ b/receiver/githubreceiver/model.go @@ -194,7 +194,6 @@ func (gtr *githubTracesReceiver) getWorkflowAttrs(resource pcommon.Resource, e * return err } -// splitRefWorkflow takes in the workl func splitRefWorkflow(workflow string) (name string, version string, err error) { return "", "", nil } @@ -210,7 +209,7 @@ func splitRefWorkflow(workflow string) (name string, version string, err error) func (gtr *githubTracesReceiver) getServiceName(customProps any, repoName string) (string, error) { switch { case gtr.cfg.WebHook.ServiceName != "": - + formatted := formatString(gtr.cfg.WebHook.ServiceName) return formatted, nil // customProps would be an index map[string]interface{} passed in but should // only be non-nil if the index of `service_name` exists From 0fb1286565dfd69dc1fecdc4cd20cf07b8bbea0d Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Fri, 31 Jan 2025 10:16:43 -0500 Subject: [PATCH 12/18] [chore] add reference workflow and previous attempt attrs --- receiver/githubreceiver/model.go | 94 ++-- receiver/githubreceiver/model_test.go | 78 ++- .../testdata/workflow-job-completed.json | 206 ++++---- .../testdata/workflow-run-completed.json | 500 +++++++++--------- .../githubreceiver/trace_event_handling.go | 4 +- receiver/githubreceiver/trace_receiver.go | 2 +- 6 files changed, 490 insertions(+), 394 deletions(-) diff --git a/receiver/githubreceiver/model.go b/receiver/githubreceiver/model.go index 2cb89fa8e2d9..526f914db85a 100644 --- a/receiver/githubreceiver/model.go +++ b/receiver/githubreceiver/model.go @@ -24,7 +24,6 @@ const ( AttributeVCSChangeStateClosed = "closed" AttributeVCSChangeStateMerged = "merged" - // TODO: Eveluate whether or not this should be a head title attribute // vcs.change.title AttributeVCSChangeTitle = "vcs.change.title" @@ -92,16 +91,20 @@ const ( AttributeCICDPipelineTaskRunStatusSkip = "skip" // The following attributes are not part of the semantic conventions yet. - AttributeCICDPipelineRunSenderLogin = "cicd.pipeline.run.sender.login" // GitHub's Run Sender Login - AttributeCICDPipelineTaskRunSenderLogin = "cicd.pipeline.task.run.sender.login" // GitHub's Task Sender Login - AttributeVCSVendorName = "vcs.vendor.name" // GitHub - AttributeVCSRepositoryOwner = "vcs.repository.owner" // GitHub's Owner Login - AttributeCICDPipelineFilePath = "cicd.pipeline.file.path" // GitHub's Path in workflow_run + AttributeCICDPipelineRunSenderLogin = "cicd.pipeline.run.sender.login" // GitHub's Run Sender Login + AttributeCICDPipelineTaskRunSenderLogin = "cicd.pipeline.task.run.sender.login" // GitHub's Task Sender Login + AttributeVCSVendorName = "vcs.vendor.name" // GitHub + AttributeVCSRepositoryOwner = "vcs.repository.owner" // GitHub's Owner Login + AttributeCICDPipelineFilePath = "cicd.pipeline.file.path" // GitHub's Path in workflow_run + AttributeCICDPipelinePreviousAttemptURLFull = "cicd.pipeline.run.previous_attempt.url.full" AttributeGitHubAppInstallationID = "github.app.installation.id" // GitHub's Installation ID AttributeGitHubWorkflowRunAttempt = "github.workflow.run.attempt" // GitHub's Run Attempt - // TODO: Evaluate whether or not these should be added. Always iffy on adding specific usernames and emails. + // SECURITY: This information will always exist on the repository, but may + // be considered private if the repository is set to private. Care should be + // taken in the data pipeline for sanitizing sensitive user information if + // the user deems it as such. AttributeVCSRefHeadRevisionAuthorName = "vcs.ref.head.revision.author.name" // GitHub's Head Revision Author Name AttributeVCSRefHeadRevisionAuthorEmail = "vcs.ref.head.revision.author.email" // GitHub's Head Revision Author Email @@ -147,7 +150,7 @@ func (gtr *githubTracesReceiver) getWorkflowAttrs(resource pcommon.Resource, e * attrs.PutStr(semconv.AttributeCicdPipelineName, e.GetWorkflowRun().GetName()) attrs.PutStr(AttributeCICDPipelineRunSenderLogin, e.GetSender().GetLogin()) attrs.PutStr(AttributeCICDPipelineRunURLFull, e.GetWorkflowRun().GetHTMLURL()) - attrs.PutInt(semconv.AttributeCicdPipelineRunID, e.GetWorkflowRun().GetID()) // TODO: GitHub events have runIDs, but not available in the SDK?? + attrs.PutInt(semconv.AttributeCicdPipelineRunID, e.GetWorkflowRun().GetID()) switch status := e.GetWorkflowRun().GetConclusion(); status { case "success": attrs.PutStr(AttributeCICDPipelineRunStatus, AttributeCICDPipelineRunStatusSuccess) @@ -157,45 +160,62 @@ func (gtr *githubTracesReceiver) getWorkflowAttrs(resource pcommon.Resource, e * attrs.PutStr(AttributeCICDPipelineRunStatus, AttributeCICDPipelineRunStatusSkip) case "cancelled": attrs.PutStr(AttributeCICDPipelineRunStatus, AttributeCICDPipelineRunStatusCancellation) - // Default sets to whatever is provided by the event. GitHub provides the following additional values: - // neutral, timed_out, action_required, stale, startup_failure, and null. + // Default sets to whatever is provided by the event. GitHub provides the + // following additional values: neutral, timed_out, action_required, stale, + // startup_failure, and null. default: attrs.PutStr(AttributeCICDPipelineRunStatus, status) } - // TODO: Add function and put previous run_attempt_url - // if e.GetWorkflowRun().GetPreviousAttemptURL() != "" { - // htmlURL := transformGitHubAPIURL(e.GetWorkflowRun().GetPreviousAttemptURL()) - // attrs.PutStr("cicd.pipeline.run.previous_attempt_url", htmlURL) - // } + if e.GetWorkflowRun().GetPreviousAttemptURL() != "" { + htmlURL := replaceAPIURL(e.GetWorkflowRun().GetPreviousAttemptURL()) + attrs.PutStr(AttributeCICDPipelinePreviousAttemptURLFull, htmlURL) + } - // TODO: This attribute is important for determining what shared workflows - // exist, and what versions (or shas). Previously, it would all get - // appended. But this should be a slice of values instead. + // Determine if there are any referenced (shared) workflows imported by the + // Workflow run and generated the temmplated attributes for them. if len(e.GetWorkflowRun().ReferencedWorkflows) > 0 { - var referencedWorkflows []string for _, w := range e.GetWorkflowRun().ReferencedWorkflows { - referencedWorkflows = append(referencedWorkflows, w.GetPath()) - referencedWorkflows = append(referencedWorkflows, w.GetSHA()) - referencedWorkflows = append(referencedWorkflows, w.GetRef()) + var name string + name, err = splitRefWorkflowPath(w.GetPath()) + if err != nil { + return err + } + + template := AttributeGitHubReferenceWorkflow + "." + name + pathAttr := template + ".path" + revAttr := template + ".revision" + versionAttr := template + ".version" + + attrs.PutStr(pathAttr, w.GetPath()) + attrs.PutStr(revAttr, w.GetSHA()) + attrs.PutStr(versionAttr, w.GetRef()) } - attrs.PutStr("cicd.pipeline.run.referenced_workflows", strings.Join(referencedWorkflows, ";")) } - // TODO: Convert this to the VCS Change Request. - // if len(e.GetWorkflowRun().PullRequests) > 0 { - // var prUrls []string - // for _, pr := range e.GetWorkflowRun().PullRequests { - // prUrls = append(prUrls, convertPRURL(pr.GetURL())) - // } - // attrs.PutStr("vcs.change.url", strings.Join(prUrls, ";")) - // } - return err } -func splitRefWorkflow(workflow string) (name string, version string, err error) { - return "", "", nil +// splitRefWorkflowPath splits the reference workflow path into just the file +// name normalized to lowercase without the file type. +func splitRefWorkflowPath(path string) (fileName string, err error) { + parts := strings.Split(path, "@") + if len(parts) != 2 { + return "", errors.New("invalid reference workflow path") + } + + parts = strings.Split(parts[0], "/") + if len(parts) == 0 { + return "", errors.New("invalid reference workflow path") + } + + last := parts[len(parts)-1] + parts = strings.Split(last, ".") + if len(parts) == 0 { + return "", errors.New("invalid reference workflow path") + } + + return strings.ToLower(parts[0]), nil } // getServiceName returns a generated service.name resource attribute derived @@ -231,3 +251,9 @@ func (gtr *githubTracesReceiver) getServiceName(customProps any, repoName string func formatString(input string) string { return strings.ToLower(strings.ReplaceAll(input, "_", "-")) } + +// replaceAPIURL replaces a GitHub API URL with the HTML URL version. +func replaceAPIURL(apiURL string) (htmlURL string) { + // TODO: Support enterpise server configuration with custom domain. + return strings.Replace(apiURL, "api.github.com/repos", "github.com", 1) +} diff --git a/receiver/githubreceiver/model_test.go b/receiver/githubreceiver/model_test.go index a73029fae742..e61e60b8fb93 100644 --- a/receiver/githubreceiver/model_test.go +++ b/receiver/githubreceiver/model_test.go @@ -3,7 +3,11 @@ package githubreceiver -import "testing" +import ( + "testing" + + "github.com/stretchr/testify/assert" +) func TestFormatString(t *testing.T) { tests := []struct { @@ -47,3 +51,75 @@ func TestFormatString(t *testing.T) { }) } } + +func TestSplitRefWorkflowPath(t *testing.T) { + tests := []struct { + name string + input string + expected string + wantErr bool + }{ + { + name: "simple workflow with version", + input: "my-great-workflow@v1.0.0", + expected: "my-great-workflow", + wantErr: false, + }, + { + name: "workflow with SHA", + input: "my-great-workflow@3421498310493281409328140932840192384", + expected: "my-great-workflow", + wantErr: false, + }, + { + name: "full path workflow", + input: "org/repo/.github/my-file-path/with/folder/build-woot.yaml@v0.2.3", + expected: "build-woot", + wantErr: false, + }, + { + name: "uppercase file", + input: "org/repo/.github/my-file-path/with/folder/BUILD-WOOT.yaml@v0.2.3", + expected: "build-woot", + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result, err := splitRefWorkflowPath(tt.input) + if tt.wantErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + assert.Equal(t, tt.expected, result) + }) + } +} + +func TestReplaceAPIURL(t *testing.T) { + tests := []struct { + name string + input string + expected string + }{ + { + name: "converts api.github.com URL to html URL", + input: "https://api.github.com/repos/open-telemetry/opentelemetry-collector-contrib/pull/1234", + expected: "https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/1234", + }, + { + name: "converts api.github.com workflow URL to html URL", + input: "https://api.github.com/repos/open-telemetry/opentelemetry-collector-contrib/actions/runs/1234", + expected: "https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/1234", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := replaceAPIURL(tt.input) + assert.Equal(t, tt.expected, result) + }) + } +} diff --git a/receiver/githubreceiver/testdata/workflow-job-completed.json b/receiver/githubreceiver/testdata/workflow-job-completed.json index f64e8d0e9c35..55eaf65623bd 100644 --- a/receiver/githubreceiver/testdata/workflow-job-completed.json +++ b/receiver/githubreceiver/testdata/workflow-job-completed.json @@ -5,25 +5,21 @@ "run_id": 12719320830, "workflow_name": "Release", "head_branch": "main", - "run_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12719320830", + "run_url": "https://api.github.com/repos/example/example-repo/actions/runs/12719320830", "run_attempt": 1, "node_id": "CR_kwDOLaz6mc8AAAAIQvV4IQ", "head_sha": "3dd4d0f1d80f389d5849adb029f7398d8d0f8bc1", - "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/jobs/35483121697", - "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo/runs/35483121697", + "url": "https://api.github.com/repos/example/example-repo/actions/jobs/35483121697", + "html_url": "https://github.com/example/example-repo/runs/35483121697", "status": "completed", "conclusion": "success", "created_at": "2025-01-12T04:07:01Z", "started_at": "2025-01-12T04:07:01Z", "completed_at": "2025-01-12T04:07:02Z", "name": "Test Report", - "steps": [ - - ], - "check_run_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/check-runs/35483121697", - "labels": [ - - ], + "steps": [], + "check_run_url": "https://api.github.com/repos/example/example-repo/check-runs/35483121697", + "labels": [], "runner_id": null, "runner_name": null, "runner_group_id": null, @@ -32,78 +28,78 @@ "repository": { "id": 766311065, "node_id": "R_kgDOLaz6mQ", - "name": "k8s-platform-v3-monorepo", - "full_name": "liatrio/k8s-platform-v3-monorepo", + "name": "example-repo", + "full_name": "example/example-repo", "private": true, "owner": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "login": "example", + "id": 12312321, + "node_id": "MDEyOk9yz2fuaxphdGlvbjU3MjY2MTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1231928?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", + "url": "https://api.github.com/users/example", + "html_url": "https://github.com/example", + "followers_url": "https://api.github.com/users/example/followers", + "following_url": "https://api.github.com/users/example/following{/other_user}", + "gists_url": "https://api.github.com/users/example/gists{/gist_id}", + "starred_url": "https://api.github.com/users/example/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/example/subscriptions", + "organizations_url": "https://api.github.com/users/example/orgs", + "repos_url": "https://api.github.com/users/example/repos", + "events_url": "https://api.github.com/users/example/events{/privacy}", + "received_events_url": "https://api.github.com/users/example/received_events", "type": "Organization", "user_view_type": "public", "site_admin": false }, - "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", - "description": "Liatrio Multi-Tenant Kubernetes Platform", + "html_url": "https://github.com/example/example-repo", + "description": "Example repo", "fork": false, - "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo", - "forks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/forks", - "keys_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/teams", - "hooks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/events", - "assignees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/tags", - "blobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscription", - "commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/merges", - "archive_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/downloads", - "issues_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/deployments", + "url": "https://api.github.com/repos/example/example-repo", + "forks_url": "https://api.github.com/repos/example/example-repo/forks", + "keys_url": "https://api.github.com/repos/example/example-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/example/example-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/example/example-repo/teams", + "hooks_url": "https://api.github.com/repos/example/example-repo/hooks", + "issue_events_url": "https://api.github.com/repos/example/example-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/example/example-repo/events", + "assignees_url": "https://api.github.com/repos/example/example-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/example/example-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/example/example-repo/tags", + "blobs_url": "https://api.github.com/repos/example/example-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/example/example-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/example/example-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/example/example-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/example/example-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/example/example-repo/languages", + "stargazers_url": "https://api.github.com/repos/example/example-repo/stargazers", + "contributors_url": "https://api.github.com/repos/example/example-repo/contributors", + "subscribers_url": "https://api.github.com/repos/example/example-repo/subscribers", + "subscription_url": "https://api.github.com/repos/example/example-repo/subscription", + "commits_url": "https://api.github.com/repos/example/example-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/example/example-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/example/example-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/example/example-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/example/example-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/example/example-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/example/example-repo/merges", + "archive_url": "https://api.github.com/repos/example/example-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/example/example-repo/downloads", + "issues_url": "https://api.github.com/repos/example/example-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/example/example-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/example/example-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/example/example-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/example/example-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/example/example-repo/releases{/id}", + "deployments_url": "https://api.github.com/repos/example/example-repo/deployments", "created_at": "2024-03-02T22:47:40Z", "updated_at": "2025-01-11T00:24:04Z", "pushed_at": "2025-01-11T08:31:59Z", - "git_url": "git://github.com/liatrio/k8s-platform-v3-monorepo.git", - "ssh_url": "git@github.com:liatrio/k8s-platform-v3-monorepo.git", - "clone_url": "https://github.com/liatrio/k8s-platform-v3-monorepo.git", - "svn_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", - "homepage": "https://kpv3.liatr.io/", + "git_url": "git://github.com/example/example-repo.git", + "ssh_url": "git@github.com:example/example-repo.git", + "clone_url": "https://github.com/example/example-repo.git", + "svn_url": "https://github.com/example/example-repo", + "homepage": "https://github.com/", "size": 52025, "stargazers_count": 0, "watchers_count": 0, @@ -123,68 +119,66 @@ "allow_forking": true, "is_template": false, "web_commit_signoff_required": false, - "topics": [ - "k8s-platform-v3" - ], + "topics": ["example"], "visibility": "internal", "forks": 2, "open_issues": 166, "watchers": 0, "default_branch": "main", "custom_properties": { - "service_name": "kpv3-core-platform", - "team_name": "tag-k8s" + "service_name": "example-service", + "team_name": "example-team" } }, "organization": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "url": "https://api.github.com/orgs/liatrio", - "repos_url": "https://api.github.com/orgs/liatrio/repos", - "events_url": "https://api.github.com/orgs/liatrio/events", - "hooks_url": "https://api.github.com/orgs/liatrio/hooks", - "issues_url": "https://api.github.com/orgs/liatrio/issues", - "members_url": "https://api.github.com/orgs/liatrio/members{/member}", - "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" + "login": "example", + "id": 12313121, + "node_id": "mdeyOk9y1kjuaXphdGlvbjU3MjY2MTg=", + "url": "https://api.github.com/orgs/example", + "repos_url": "https://api.github.com/orgs/example/repos", + "events_url": "https://api.github.com/orgs/example/events", + "hooks_url": "https://api.github.com/orgs/example/hooks", + "issues_url": "https://api.github.com/orgs/example/issues", + "members_url": "https://api.github.com/orgs/example/members{/member}", + "public_members_url": "https://api.github.com/orgs/example/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/1234124?v=4", + "description": "example" }, "enterprise": { - "id": 9988, - "slug": "liatrio-partnerdemo", - "name": "Liatrio", + "id": 12312321, + "slug": "example", + "name": "example", "node_id": "E_kgDNJwQ", - "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", + "avatar_url": "https://avatars.githubusercontent.com/b/1231?v=4", "description": "", "website_url": "", - "html_url": "https://github.com/enterprises/liatrio-partnerdemo", + "html_url": "https://github.com/enterprises/example", "created_at": "2021-11-02T23:03:56Z", "updated_at": "2023-09-19T00:04:56Z" }, "sender": { - "login": "gdsmith1", + "login": "example-user", "id": 123333011, "node_id": "U_kgDOB1npkw", "avatar_url": "https://avatars.githubusercontent.com/u/123333011?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/gdsmith1", - "html_url": "https://github.com/gdsmith1", - "followers_url": "https://api.github.com/users/gdsmith1/followers", - "following_url": "https://api.github.com/users/gdsmith1/following{/other_user}", - "gists_url": "https://api.github.com/users/gdsmith1/gists{/gist_id}", - "starred_url": "https://api.github.com/users/gdsmith1/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/gdsmith1/subscriptions", - "organizations_url": "https://api.github.com/users/gdsmith1/orgs", - "repos_url": "https://api.github.com/users/gdsmith1/repos", - "events_url": "https://api.github.com/users/gdsmith1/events{/privacy}", - "received_events_url": "https://api.github.com/users/gdsmith1/received_events", + "url": "https://api.github.com/users/example-user", + "html_url": "https://github.com/example-user", + "followers_url": "https://api.github.com/users/example-user/followers", + "following_url": "https://api.github.com/users/example-user/following{/other_user}", + "gists_url": "https://api.github.com/users/example-user/gists{/gist_id}", + "starred_url": "https://api.github.com/users/example-user/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/example-user/subscriptions", + "organizations_url": "https://api.github.com/users/example-user/orgs", + "repos_url": "https://api.github.com/users/example-user/repos", + "events_url": "https://api.github.com/users/example-user/events{/privacy}", + "received_events_url": "https://api.github.com/users/example-user/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "installation": { "id": 52902335, - "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" + "node_id": "kj1l2k3j1l2kj5zdGFsbGF0aW9uNTI5MDIzMzU=" } } diff --git a/receiver/githubreceiver/testdata/workflow-run-completed.json b/receiver/githubreceiver/testdata/workflow-run-completed.json index d9f060d0dca7..8322fbc0abcc 100644 --- a/receiver/githubreceiver/testdata/workflow-run-completed.json +++ b/receiver/githubreceiver/testdata/workflow-run-completed.json @@ -15,76 +15,78 @@ "workflow_id": 88543479, "check_suite_id": 32953030627, "check_suite_node_id": "CS_kwDOLaz6mc8AAAAHrCdX4w", - "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372", - "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372", - "pull_requests": [ - - ], + "url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372", + "html_url": "https://github.com/example/example-repo/actions/runs/12730301372", + "pull_requests": [], "created_at": "2025-01-12T04:05:35Z", "updated_at": "2025-01-12T04:07:10Z", "actor": { - "login": "blairdrummond", - "id": 10801138, + "login": "example-user", + "id": 12312312, "node_id": "MDQ6VXNlcjEwODAxMTM4", - "avatar_url": "https://avatars.githubusercontent.com/u/10801138?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/123123?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/blairdrummond", - "html_url": "https://github.com/blairdrummond", - "followers_url": "https://api.github.com/users/blairdrummond/followers", - "following_url": "https://api.github.com/users/blairdrummond/following{/other_user}", - "gists_url": "https://api.github.com/users/blairdrummond/gists{/gist_id}", - "starred_url": "https://api.github.com/users/blairdrummond/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/blairdrummond/subscriptions", - "organizations_url": "https://api.github.com/users/blairdrummond/orgs", - "repos_url": "https://api.github.com/users/blairdrummond/repos", - "events_url": "https://api.github.com/users/blairdrummond/events{/privacy}", - "received_events_url": "https://api.github.com/users/blairdrummond/received_events", + "url": "https://api.github.com/users/example-user", + "html_url": "https://github.com/example-user", + "followers_url": "https://api.github.com/users/example-user/followers", + "following_url": "https://api.github.com/users/example-user/following{/other_user}", + "gists_url": "https://api.github.com/users/example-user/gists{/gist_id}", + "starred_url": "https://api.github.com/users/example-user/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/example-user/subscriptions", + "organizations_url": "https://api.github.com/users/example-user/orgs", + "repos_url": "https://api.github.com/users/example-user/repos", + "events_url": "https://api.github.com/users/example-user/events{/privacy}", + "received_events_url": "https://api.github.com/users/example-user/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "run_attempt": 1, "referenced_workflows": [ - + { + "path": "example/example-repo/.github/workflows/build.yaml@v0.4.16", + "sha": "d98007814bbddd380d9aa0ae1e71dcd13dce0af3", + "ref": "refs/tags/v0.4.16" + } ], "run_started_at": "2025-01-12T04:05:35Z", "triggering_actor": { - "login": "blairdrummond", - "id": 10801138, + "login": "example-user", + "id": 12312312, "node_id": "MDQ6VXNlcjEwODAxMTM4", - "avatar_url": "https://avatars.githubusercontent.com/u/10801138?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/123123?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/blairdrummond", - "html_url": "https://github.com/blairdrummond", - "followers_url": "https://api.github.com/users/blairdrummond/followers", - "following_url": "https://api.github.com/users/blairdrummond/following{/other_user}", - "gists_url": "https://api.github.com/users/blairdrummond/gists{/gist_id}", - "starred_url": "https://api.github.com/users/blairdrummond/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/blairdrummond/subscriptions", - "organizations_url": "https://api.github.com/users/blairdrummond/orgs", - "repos_url": "https://api.github.com/users/blairdrummond/repos", - "events_url": "https://api.github.com/users/blairdrummond/events{/privacy}", - "received_events_url": "https://api.github.com/users/blairdrummond/received_events", + "url": "https://api.github.com/users/example-user", + "html_url": "https://github.com/example-user", + "followers_url": "https://api.github.com/users/example-user/followers", + "following_url": "https://api.github.com/users/example-user/following{/other_user}", + "gists_url": "https://api.github.com/users/example-user/gists{/gist_id}", + "starred_url": "https://api.github.com/users/example-user/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/example-user/subscriptions", + "organizations_url": "https://api.github.com/users/example-user/orgs", + "repos_url": "https://api.github.com/users/example-user/repos", + "events_url": "https://api.github.com/users/example-user/events{/privacy}", + "received_events_url": "https://api.github.com/users/example-user/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, - "jobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/jobs", - "logs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/logs", - "check_suite_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/check-suites/32953030627", - "artifacts_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/artifacts", - "cancel_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/cancel", - "rerun_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/runs/12730301372/rerun", + "jobs_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/jobs", + "logs_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/logs", + "check_suite_url": "https://api.github.com/repos/example/example-repo/check-suites/32953030627", + "artifacts_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/artifacts", + "cancel_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/cancel", + "rerun_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/rerun", "previous_attempt_url": null, - "workflow_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/workflows/88543479", + "workflow_url": "https://api.github.com/repos/example/example-repo/actions/workflows/88543479", "head_commit": { "id": "3dd4d0f1d80f389d5849adb029f7398d8d0f8bc1", "tree_id": "f51302143d266a49520d53487e000e8bf338d121", - "message": "fix: unhack argo (#3219)", + "message": "feat: example message", "timestamp": "2025-01-11T00:24:00Z", "author": { - "name": "Gibson Smith", - "email": "123333011+gdsmith1@users.noreply.github.com" + "name": "Example User", + "email": "123333011+example-user@users.noreply.github.com" }, "committer": { "name": "GitHub", @@ -94,138 +96,138 @@ "repository": { "id": 766311065, "node_id": "R_kgDOLaz6mQ", - "name": "k8s-platform-v3-monorepo", - "full_name": "liatrio/k8s-platform-v3-monorepo", + "name": "example-repo", + "full_name": "example/example-repo", "private": true, "owner": { - "login": "liatrio", + "login": "example", "id": 5726618, "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/123123?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", + "url": "https://api.github.com/users/example", + "html_url": "https://github.com/example", + "followers_url": "https://api.github.com/users/example/followers", + "following_url": "https://api.github.com/users/example/following{/other_user}", + "gists_url": "https://api.github.com/users/example/gists{/gist_id}", + "starred_url": "https://api.github.com/users/example/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/example/subscriptions", + "organizations_url": "https://api.github.com/users/example/orgs", + "repos_url": "https://api.github.com/users/example/repos", + "events_url": "https://api.github.com/users/example/events{/privacy}", + "received_events_url": "https://api.github.com/users/example/received_events", "type": "Organization", "user_view_type": "public", "site_admin": false }, - "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", - "description": "Liatrio Multi-Tenant Kubernetes Platform", + "html_url": "https://github.com/example/example-repo", + "description": "Example Repo", "fork": false, - "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo", - "forks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/forks", - "keys_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/teams", - "hooks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/events", - "assignees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/tags", - "blobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscription", - "commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/merges", - "archive_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/downloads", - "issues_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/deployments" + "url": "https://api.github.com/repos/example/example-repo", + "forks_url": "https://api.github.com/repos/example/example-repo/forks", + "keys_url": "https://api.github.com/repos/example/example-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/example/example-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/example/example-repo/teams", + "hooks_url": "https://api.github.com/repos/example/example-repo/hooks", + "issue_events_url": "https://api.github.com/repos/example/example-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/example/example-repo/events", + "assignees_url": "https://api.github.com/repos/example/example-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/example/example-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/example/example-repo/tags", + "blobs_url": "https://api.github.com/repos/example/example-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/example/example-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/example/example-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/example/example-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/example/example-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/example/example-repo/languages", + "stargazers_url": "https://api.github.com/repos/example/example-repo/stargazers", + "contributors_url": "https://api.github.com/repos/example/example-repo/contributors", + "subscribers_url": "https://api.github.com/repos/example/example-repo/subscribers", + "subscription_url": "https://api.github.com/repos/example/example-repo/subscription", + "commits_url": "https://api.github.com/repos/example/example-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/example/example-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/example/example-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/example/example-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/example/example-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/example/example-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/example/example-repo/merges", + "archive_url": "https://api.github.com/repos/example/example-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/example/example-repo/downloads", + "issues_url": "https://api.github.com/repos/example/example-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/example/example-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/example/example-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/example/example-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/example/example-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/example/example-repo/releases{/id}", + "deployments_url": "https://api.github.com/repos/example/example-repo/deployments" }, "head_repository": { "id": 766311065, "node_id": "R_kgDOLaz6mQ", - "name": "k8s-platform-v3-monorepo", - "full_name": "liatrio/k8s-platform-v3-monorepo", + "name": "example-repo", + "full_name": "example/example-repo", "private": true, "owner": { - "login": "liatrio", + "login": "example", "id": 5726618, "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/1231232?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", + "url": "https://api.github.com/users/example", + "html_url": "https://github.com/example", + "followers_url": "https://api.github.com/users/example/followers", + "following_url": "https://api.github.com/users/example/following{/other_user}", + "gists_url": "https://api.github.com/users/example/gists{/gist_id}", + "starred_url": "https://api.github.com/users/example/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/example/subscriptions", + "organizations_url": "https://api.github.com/users/example/orgs", + "repos_url": "https://api.github.com/users/example/repos", + "events_url": "https://api.github.com/users/example/events{/privacy}", + "received_events_url": "https://api.github.com/users/example/received_events", "type": "Organization", "user_view_type": "public", "site_admin": false }, - "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", - "description": "Liatrio Multi-Tenant Kubernetes Platform", + "html_url": "https://github.com/example/example-repo", + "description": "Example Repo", "fork": false, - "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo", - "forks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/forks", - "keys_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/teams", - "hooks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/events", - "assignees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/tags", - "blobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscription", - "commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/merges", - "archive_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/downloads", - "issues_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/deployments" + "url": "https://api.github.com/repos/example/example-repo", + "forks_url": "https://api.github.com/repos/example/example-repo/forks", + "keys_url": "https://api.github.com/repos/example/example-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/example/example-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/example/example-repo/teams", + "hooks_url": "https://api.github.com/repos/example/example-repo/hooks", + "issue_events_url": "https://api.github.com/repos/example/example-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/example/example-repo/events", + "assignees_url": "https://api.github.com/repos/example/example-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/example/example-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/example/example-repo/tags", + "blobs_url": "https://api.github.com/repos/example/example-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/example/example-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/example/example-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/example/example-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/example/example-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/example/example-repo/languages", + "stargazers_url": "https://api.github.com/repos/example/example-repo/stargazers", + "contributors_url": "https://api.github.com/repos/example/example-repo/contributors", + "subscribers_url": "https://api.github.com/repos/example/example-repo/subscribers", + "subscription_url": "https://api.github.com/repos/example/example-repo/subscription", + "commits_url": "https://api.github.com/repos/example/example-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/example/example-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/example/example-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/example/example-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/example/example-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/example/example-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/example/example-repo/merges", + "archive_url": "https://api.github.com/repos/example/example-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/example/example-repo/downloads", + "issues_url": "https://api.github.com/repos/example/example-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/example/example-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/example/example-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/example/example-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/example/example-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/example/example-repo/releases{/id}", + "deployments_url": "https://api.github.com/repos/example/example-repo/deployments" } }, "workflow": { @@ -236,85 +238,85 @@ "state": "active", "created_at": "2024-03-06T00:16:51.000Z", "updated_at": "2024-03-06T00:43:24.000Z", - "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/actions/workflows/88543479", - "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo/blob/main/.github/workflows/test.yml", - "badge_url": "https://github.com/liatrio/k8s-platform-v3-monorepo/workflows/Test/badge.svg" + "url": "https://api.github.com/repos/example/example-repo/actions/workflows/88543479", + "html_url": "https://github.com/example/example-repo/blob/main/.github/workflows/test.yml", + "badge_url": "https://github.com/example/example-repo/workflows/Test/badge.svg" }, "repository": { "id": 766311065, "node_id": "R_kgDOLaz6mQ", - "name": "k8s-platform-v3-monorepo", - "full_name": "liatrio/k8s-platform-v3-monorepo", + "name": "example-repo", + "full_name": "example/example-repo", "private": true, "owner": { - "login": "liatrio", - "id": 5726618, + "login": "example", + "id": 12312312, "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/12312312?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", + "url": "https://api.github.com/users/example", + "html_url": "https://github.com/example", + "followers_url": "https://api.github.com/users/example/followers", + "following_url": "https://api.github.com/users/example/following{/other_user}", + "gists_url": "https://api.github.com/users/example/gists{/gist_id}", + "starred_url": "https://api.github.com/users/example/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/example/subscriptions", + "organizations_url": "https://api.github.com/users/example/orgs", + "repos_url": "https://api.github.com/users/example/repos", + "events_url": "https://api.github.com/users/example/events{/privacy}", + "received_events_url": "https://api.github.com/users/example/received_events", "type": "Organization", "user_view_type": "public", "site_admin": false }, - "html_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", - "description": "Liatrio Multi-Tenant Kubernetes Platform", + "html_url": "https://github.com/example/example-repo", + "description": "Example repo", "fork": false, - "url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo", - "forks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/forks", - "keys_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/teams", - "hooks_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/events", - "assignees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/tags", - "blobs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/subscription", - "commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/merges", - "archive_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/downloads", - "issues_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/k8s-platform-v3-monorepo/deployments", + "url": "https://api.github.com/repos/example/example-repo", + "forks_url": "https://api.github.com/repos/example/example-repo/forks", + "keys_url": "https://api.github.com/repos/example/example-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/example/example-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/example/example-repo/teams", + "hooks_url": "https://api.github.com/repos/example/example-repo/hooks", + "issue_events_url": "https://api.github.com/repos/example/example-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/example/example-repo/events", + "assignees_url": "https://api.github.com/repos/example/example-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/example/example-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/example/example-repo/tags", + "blobs_url": "https://api.github.com/repos/example/example-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/example/example-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/example/example-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/example/example-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/example/example-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/example/example-repo/languages", + "stargazers_url": "https://api.github.com/repos/example/example-repo/stargazers", + "contributors_url": "https://api.github.com/repos/example/example-repo/contributors", + "subscribers_url": "https://api.github.com/repos/example/example-repo/subscribers", + "subscription_url": "https://api.github.com/repos/example/example-repo/subscription", + "commits_url": "https://api.github.com/repos/example/example-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/example/example-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/example/example-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/example/example-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/example/example-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/example/example-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/example/example-repo/merges", + "archive_url": "https://api.github.com/repos/example/example-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/example/example-repo/downloads", + "issues_url": "https://api.github.com/repos/example/example-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/example/example-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/example/example-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/example/example-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/example/example-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/example/example-repo/releases{/id}", + "deployments_url": "https://api.github.com/repos/example/example-repo/deployments", "created_at": "2024-03-02T22:47:40Z", "updated_at": "2025-01-11T00:24:04Z", "pushed_at": "2025-01-11T08:31:59Z", - "git_url": "git://github.com/liatrio/k8s-platform-v3-monorepo.git", - "ssh_url": "git@github.com:liatrio/k8s-platform-v3-monorepo.git", - "clone_url": "https://github.com/liatrio/k8s-platform-v3-monorepo.git", - "svn_url": "https://github.com/liatrio/k8s-platform-v3-monorepo", - "homepage": "https://kpv3.liatr.io/", + "git_url": "git://github.com/example/example-repo.git", + "ssh_url": "git@github.com:example/example-repo.git", + "clone_url": "https://github.com/example/example-repo.git", + "svn_url": "https://github.com/example/example-repo", + "homepage": "https://github.com/", "size": 52025, "stargazers_count": 0, "watchers_count": 0, @@ -334,62 +336,60 @@ "allow_forking": true, "is_template": false, "web_commit_signoff_required": false, - "topics": [ - "k8s-platform-v3" - ], + "topics": ["example"], "visibility": "internal", "forks": 2, "open_issues": 166, "watchers": 0, "default_branch": "main", "custom_properties": { - "service_name": "kpv3-core-platform", - "team_name": "tag-k8s" + "service_name": "example-service", + "team_name": "example-team" } }, "organization": { - "login": "liatrio", - "id": 5726618, + "login": "example", + "id": 12312321, "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "url": "https://api.github.com/orgs/liatrio", - "repos_url": "https://api.github.com/orgs/liatrio/repos", - "events_url": "https://api.github.com/orgs/liatrio/events", - "hooks_url": "https://api.github.com/orgs/liatrio/hooks", - "issues_url": "https://api.github.com/orgs/liatrio/issues", - "members_url": "https://api.github.com/orgs/liatrio/members{/member}", - "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" + "url": "https://api.github.com/orgs/example", + "repos_url": "https://api.github.com/orgs/example/repos", + "events_url": "https://api.github.com/orgs/example/events", + "hooks_url": "https://api.github.com/orgs/example/hooks", + "issues_url": "https://api.github.com/orgs/example/issues", + "members_url": "https://api.github.com/orgs/example/members{/member}", + "public_members_url": "https://api.github.com/orgs/example/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/12312312?v=4", + "description": "Example" }, "enterprise": { - "id": 9988, - "slug": "liatrio-partnerdemo", - "name": "Liatrio", + "id": 12312312, + "slug": "example", + "name": "example", "node_id": "E_kgDNJwQ", - "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", + "avatar_url": "https://avatars.githubusercontent.com/b/12312321?v=4", "description": "", "website_url": "", - "html_url": "https://github.com/enterprises/liatrio-partnerdemo", + "html_url": "https://github.com/enterprises/example", "created_at": "2021-11-02T23:03:56Z", "updated_at": "2023-09-19T00:04:56Z" }, "sender": { - "login": "blairdrummond", - "id": 10801138, + "login": "example-user", + "id": 123132, "node_id": "MDQ6VXNlcjEwODAxMTM4", - "avatar_url": "https://avatars.githubusercontent.com/u/10801138?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/1231321?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/blairdrummond", - "html_url": "https://github.com/blairdrummond", - "followers_url": "https://api.github.com/users/blairdrummond/followers", - "following_url": "https://api.github.com/users/blairdrummond/following{/other_user}", - "gists_url": "https://api.github.com/users/blairdrummond/gists{/gist_id}", - "starred_url": "https://api.github.com/users/blairdrummond/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/blairdrummond/subscriptions", - "organizations_url": "https://api.github.com/users/blairdrummond/orgs", - "repos_url": "https://api.github.com/users/blairdrummond/repos", - "events_url": "https://api.github.com/users/blairdrummond/events{/privacy}", - "received_events_url": "https://api.github.com/users/blairdrummond/received_events", + "url": "https://api.github.com/users/example-user", + "html_url": "https://github.com/example-user", + "followers_url": "https://api.github.com/users/example-user/followers", + "following_url": "https://api.github.com/users/example-user/following{/other_user}", + "gists_url": "https://api.github.com/users/example-user/gists{/gist_id}", + "starred_url": "https://api.github.com/users/example-user/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/example-user/subscriptions", + "organizations_url": "https://api.github.com/users/example-user/orgs", + "repos_url": "https://api.github.com/users/example-user/repos", + "events_url": "https://api.github.com/users/example-user/events{/privacy}", + "received_events_url": "https://api.github.com/users/example-user/received_events", "type": "User", "user_view_type": "public", "site_admin": false diff --git a/receiver/githubreceiver/trace_event_handling.go b/receiver/githubreceiver/trace_event_handling.go index fab6a2f92d9a..cbe28bfe1475 100644 --- a/receiver/githubreceiver/trace_event_handling.go +++ b/receiver/githubreceiver/trace_event_handling.go @@ -43,8 +43,8 @@ func (gtr *githubTracesReceiver) handleWorkflowRun(e *github.WorkflowRunEvent) ( // the proper root span and trace ID. // func (gtr *githubTracesReceiver) handleWorkflowJob(ctx context.Context, e *github.WorkflowJobEvent) (ptrace.Traces, error) { // t := ptrace.NewTraces() -// // r := t.ResourceSpans().AppendEmpty() -// // s := r.InstrumentationLibrarySpans().AppendEmpty() +// r := t.ResourceSpans().AppendEmpty() +// s := r.InstrumentationLibrarySpans().AppendEmpty() // return t, nil // } diff --git a/receiver/githubreceiver/trace_receiver.go b/receiver/githubreceiver/trace_receiver.go index 252bb08bf743..9fa8b7a669b4 100644 --- a/receiver/githubreceiver/trace_receiver.go +++ b/receiver/githubreceiver/trace_receiver.go @@ -164,7 +164,7 @@ func (gtr *githubTracesReceiver) handleReq(w http.ResponseWriter, req *http.Requ return } return - // TODO: Enable + // TODO: Enable when handleWorkflowJob is implemented // td, err = gtr.handleWorkflowJob(ctx, e) case *github.PingEvent: w.Header().Add("Content-Type", "application/json") From 0184a7131c1ee2b0add3e424397ffaff322d5322 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Fri, 31 Jan 2025 12:53:45 -0500 Subject: [PATCH 13/18] [chore] small changes --- receiver/githubreceiver/trace_receiver.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/receiver/githubreceiver/trace_receiver.go b/receiver/githubreceiver/trace_receiver.go index 9fa8b7a669b4..0c0e88b637e7 100644 --- a/receiver/githubreceiver/trace_receiver.go +++ b/receiver/githubreceiver/trace_receiver.go @@ -182,10 +182,9 @@ func (gtr *githubTracesReceiver) handleReq(w http.ResponseWriter, req *http.Requ http.Error(w, "failed to consume traces", http.StatusInternalServerError) return } + w.WriteHeader(http.StatusOK) } - w.WriteHeader(http.StatusOK) - gtr.obsrecv.EndTracesOp(ctx, "protobuf", td.SpanCount(), err) } From 982ca2f74d1b29ec19feb76c1c11bee65851ffde Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Sun, 2 Feb 2025 09:40:59 -0500 Subject: [PATCH 14/18] [chore] update header configuration --- receiver/githubreceiver/config.go | 38 ++++++++++++++------ receiver/githubreceiver/config_test.go | 33 +++++++++++++---- receiver/githubreceiver/factory.go | 11 ++++++ receiver/githubreceiver/go.mod | 2 +- receiver/githubreceiver/testdata/config.yaml | 10 +++--- 5 files changed, 70 insertions(+), 24 deletions(-) diff --git a/receiver/githubreceiver/config.go b/receiver/githubreceiver/config.go index e6215d3d78e6..02dbbfdabbcb 100755 --- a/receiver/githubreceiver/config.go +++ b/receiver/githubreceiver/config.go @@ -10,6 +10,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/config/configopaque" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/scraper/scraperhelper" "go.uber.org/multierr" @@ -20,6 +21,13 @@ import ( const ( scrapersKey = "scrapers" + + // GitHub Delivery Headers: https://docs.github.com/en/webhooks/webhook-events-and-payloads#delivery-headers + defaultGitHubHookIDHeader = "X-GitHub-Hook-ID" // Unique identifier of the webhook. + defaultGitHubEventHeader = "X-GitHub-Event" // The name of the event that triggered the delivery. + defaultGitHubDeliveryHeader = "X-GitHub-Delivery" // A globally unique identifier (GUID) to identify the event. + defaultGitHubSignature256Header = "X-Hub-Signature-256" // The HMAC hex digest of the request body; generated using the SHA-256 hash function and the secret as the HMAC key. + defaultUserAgentHeader = "User-Agent" // Value always prefixed with "GitHub-Hookshot/" ) // Config that is exposed to this github receiver through the OTEL config.yaml @@ -31,17 +39,18 @@ type Config struct { } type WebHook struct { - confighttp.ServerConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct - Path string `mapstructure:"path"` // path for data collection. Default is /events - HealthPath string `mapstructure:"health_path"` // path for health check api. Default is /health_check - RequiredHeader RequiredHeader `mapstructure:"required_header"` // optional setting to set a required header for all requests to have - Secret string `mapstructure:"secret"` // secret for webhook - ServiceName string `mapstructure:"service_name"` + confighttp.ServerConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct + Path string `mapstructure:"path"` // path for data collection. Default is /events + HealthPath string `mapstructure:"health_path"` // path for health check api. Default is /health_check + RequiredHeaders map[string]configopaque.String `mapstructure:"required_headers"` // optional setting to set one or more required headers for all requests to have (except the health check) + GitHubHeaders GitHubHeaders `mapstructure:",squash"` // GitLab headers set by default + Secret string `mapstructure:"secret"` // secret for webhook + ServiceName string `mapstructure:"service_name"` } -type RequiredHeader struct { - Key string `mapstructure:"key"` - Value string `mapstructure:"value"` +type GitHubHeaders struct { + Customizable map[string]string `mapstructure:","` // can be overwritten via required_headers + Fixed map[string]string `mapstructure:","` // are not allowed to be overwritten } var ( @@ -53,6 +62,7 @@ var ( errWriteTimeoutExceedsMaxValue = errors.New("the duration specified for write_timeout exceeds the maximum allowed value of 10s") errRequiredHeader = errors.New("both key and value are required to assign a required_header") errRequireOneScraper = errors.New("must specify at least one scraper") + errGitHubHeader = errors.New("github default headers [X-GitHub-Event, X-GitHub-Delivery, X-GitHub-Hook-ID, X-Hub-Signature-256] cannot be configured") ) // Validate the configuration passed through the OTEL config.yaml @@ -79,8 +89,14 @@ func (cfg *Config) Validate() error { errs = multierr.Append(errs, errWriteTimeoutExceedsMaxValue) } - if (cfg.WebHook.RequiredHeader.Key != "" && cfg.WebHook.RequiredHeader.Value == "") || (cfg.WebHook.RequiredHeader.Value != "" && cfg.WebHook.RequiredHeader.Key == "") { - errs = multierr.Append(errs, errRequiredHeader) + for key, value := range cfg.WebHook.RequiredHeaders { + if key == "" || value == "" { + errs = multierr.Append(errs, errRequiredHeader) + } + + if _, exists := cfg.WebHook.GitHubHeaders.Fixed[key]; exists { + errs = multierr.Append(errs, errGitHubHeader) + } } return errs diff --git a/receiver/githubreceiver/config_test.go b/receiver/githubreceiver/config_test.go index c96b0e8dec13..89090076d642 100644 --- a/receiver/githubreceiver/config_test.go +++ b/receiver/githubreceiver/config_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/config/configopaque" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/otelcol/otelcoltest" "go.opentelemetry.io/collector/scraper/scraperhelper" @@ -49,9 +50,19 @@ func TestLoadConfig(t *testing.T) { }, Path: "some/path", HealthPath: "health/path", - RequiredHeader: RequiredHeader{ - Key: "key-present", - Value: "value-present", + RequiredHeaders: map[string]configopaque.String{ + "key": "vault-present", + }, + GitHubHeaders: GitHubHeaders{ + Customizable: map[string]string{ + "User-Agent": "", + }, + Fixed: map[string]string{ + "X-GitHub-Delivery": "", + "X-GitHub-Event": "", + "X-GitHub-Hook-ID": "", + "X-Hub-Signature-256": "", + }, }, } @@ -74,9 +85,19 @@ func TestLoadConfig(t *testing.T) { }, Path: "some/path", HealthPath: "health/path", - RequiredHeader: RequiredHeader{ - Key: "key-present", - Value: "value-present", + RequiredHeaders: map[string]configopaque.String{ + "key": "vault-present", + }, + GitHubHeaders: GitHubHeaders{ + Customizable: map[string]string{ + "User-Agent": "", + }, + Fixed: map[string]string{ + "X-GitHub-Delivery": "", + "X-GitHub-Event": "", + "X-GitHub-Hook-ID": "", + "X-Hub-Signature-256": "", + }, }, }, } diff --git a/receiver/githubreceiver/factory.go b/receiver/githubreceiver/factory.go index 2bc0e1bc9f32..b521ba9ff72a 100644 --- a/receiver/githubreceiver/factory.go +++ b/receiver/githubreceiver/factory.go @@ -68,6 +68,17 @@ func createDefaultConfig() component.Config { ReadTimeout: defaultReadTimeout, WriteTimeout: defaultWriteTimeout, }, + GitHubHeaders: GitHubHeaders{ + Customizable: map[string]string{ + defaultUserAgentHeader: "", + }, + Fixed: map[string]string{ + defaultGitHubEventHeader: "", + defaultGitHubDeliveryHeader: "", + defaultGitHubHookIDHeader: "", + defaultGitHubSignature256Header: "", + }, + }, Path: defaultPath, HealthPath: defaultHealthPath, }, diff --git a/receiver/githubreceiver/go.mod b/receiver/githubreceiver/go.mod index 226561ff9b85..37b490fc0cd6 100644 --- a/receiver/githubreceiver/go.mod +++ b/receiver/githubreceiver/go.mod @@ -14,6 +14,7 @@ require ( go.opentelemetry.io/collector/component/componentstatus v0.118.1-0.20250131104636-a737a48402e0 go.opentelemetry.io/collector/component/componenttest v0.118.1-0.20250131104636-a737a48402e0 go.opentelemetry.io/collector/config/confighttp v0.118.1-0.20250131104636-a737a48402e0 + go.opentelemetry.io/collector/config/configopaque v1.24.1-0.20250131104636-a737a48402e0 go.opentelemetry.io/collector/confmap v1.24.1-0.20250131104636-a737a48402e0 go.opentelemetry.io/collector/consumer v1.24.1-0.20250131104636-a737a48402e0 go.opentelemetry.io/collector/consumer/consumertest v0.118.1-0.20250131104636-a737a48402e0 @@ -81,7 +82,6 @@ require ( go.opentelemetry.io/collector/client v1.24.1-0.20250131104636-a737a48402e0 // indirect go.opentelemetry.io/collector/config/configauth v0.118.1-0.20250131104636-a737a48402e0 // indirect go.opentelemetry.io/collector/config/configcompression v1.24.1-0.20250131104636-a737a48402e0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.24.1-0.20250131104636-a737a48402e0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.118.1-0.20250131104636-a737a48402e0 // indirect go.opentelemetry.io/collector/config/configtls v1.24.1-0.20250131104636-a737a48402e0 // indirect go.opentelemetry.io/collector/confmap/provider/envprovider v1.24.1-0.20250131104636-a737a48402e0 // indirect diff --git a/receiver/githubreceiver/testdata/config.yaml b/receiver/githubreceiver/testdata/config.yaml index 612b31b0213a..e79f46469bde 100644 --- a/receiver/githubreceiver/testdata/config.yaml +++ b/receiver/githubreceiver/testdata/config.yaml @@ -10,9 +10,8 @@ receivers: write_timeout: "500ms" path: "some/path" health_path: "health/path" - required_header: - key: key-present - value: value-present + required_headers: + key: vault-present github/customname: initial_delay: 1s @@ -25,9 +24,8 @@ receivers: write_timeout: "500ms" path: "some/path" health_path: "health/path" - required_header: - key: key-present - value: value-present + required_headers: + key: vault-present processors: nop: From b3ec694c6bf77c7456ea6ca369b37fe08b6e9457 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Sun, 2 Feb 2025 20:04:42 -0500 Subject: [PATCH 15/18] [chore] update the readme --- receiver/githubreceiver/README.md | 80 ++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 17 deletions(-) diff --git a/receiver/githubreceiver/README.md b/receiver/githubreceiver/README.md index ecff5133e990..504fd0c1286e 100644 --- a/receiver/githubreceiver/README.md +++ b/receiver/githubreceiver/README.md @@ -14,7 +14,26 @@ [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib -The GitHub receiver receives data from [GitHub](https://github.com). +# Table of Contents + +- [Overview](#overview) +- [Metrics - Getting Started](#metrics---getting-started) + - [Scraping](#scraping) +- [Traces - Getting Started](#traces---getting-started) + - [Receiver Configuration](#receiver-configuration) + - [Configuring Service Name](#configuring-service-name) + - [Configuration a GitHub App](#configuration-a-github-app) + +## Overview + +The GitHub receiver receives data from [GitHub](https://github.com) via two methods: + +1. Scrapes [version control system][vcsm] metrics from GitHub repositories and +organizations using the GraphQL and REST APIs. +2. Receives GitHub Actions events by serving a webhook endpoint, converting +those events into traces. + +## Metrics - Getting Started The current default set of metrics can be found in [documentation.md](./documentation.md). @@ -23,11 +42,6 @@ These metrics can be used as leading indicators ([capabilities][doracap]) to the [DORA][dorafour] metrics; helping provide insight into modern-day engineering practices. -[doracap]: https://dora.dev/capabilities/ -[dorafour]: https://dora.dev/guides/dora-metrics-four-keys/ - -## Metrics - Getting Started - The collection interval is common to all scrapers and is set to 30 seconds by default. > Note: Generally speaking, if the vendor allows for anonymous API calls, then you @@ -77,7 +91,7 @@ A Grafana Dashboard exists on the marketplace for metrics from this receiver and can be found [here](https://grafana.com/grafana/dashboards/20976-engineering-effectiveness-metrics/). -## Scraping +### Scraping > Important: > * The GitHub scraper does not emit metrics for branches that have not had @@ -85,9 +99,6 @@ and can be found > * Due to GitHub API limitations, it is possible for the branch time metric to > change when rebases occur, recreating the commits with new timestamps. - - - For additional context on GitHub scraper limitations and inner workings please see the [Scraping README][ghsread]. @@ -105,9 +116,10 @@ Each GitHub Action workflow or job, along with its steps, are converted into trace spans, allowing the observation of workflow execution times, success, and failure rates. -### Configuration +### Receiver Configuration -**IMPORTANT: At this time the tracing portion of this receiver only serves a health check endpoint.** +**IMPORTANT** - Ensure to secure your WebHook endpoint with a secret and a Web +Application Firewall (WAF) or other security measure. The WebHook configuration exposes the following settings: @@ -116,6 +128,9 @@ The WebHook configuration exposes the following settings: * `health_path`: (default = `/health`) - The path for health checks. * `secret`: (optional) - The secret used to [validates the payload][valid]. * `required_header`: (optional) - The required header key and value for incoming requests. +* `service_name`: (optional) - The service name for the traces. See the +[Configuring Service Name](#configuring-service-name) section for more +information. The WebHook configuration block also accepts all the [confighttp][cfghttp] settings. @@ -125,23 +140,54 @@ An example configuration is as follows: ```yaml receivers: github: - scrapers: - ... : # Scraper configurations are required until Tracing functionality is complete. webhook: endpoint: localhost:19418 path: /events health_path: /health secret: ${env:SECRET_STRING_VAR} - required_header: - key: "X-GitHub-Event" - value: "action" + required_headers: + WAF-Header: "value" ``` For tracing, all configuration is set under the `webhook` key. The full set of exposed configuration values can be found in [`config.go`][config.go]. + +### Configuring Service Name + +The `service_name` configuration in the WebHook configuration can be used to set +a pre-defined `service.name` for all traces emitted by the receiver. This takes +priority over the internal generation of the `service.name`. In this +configuration, it would be important to create a GitHub receiver per GitHub app +configured for the set of repositories that match your `service.name`. + +However, a more efficient approach would be to leverage the default generation +of `service.name` by configuring [Custom Properties][cp] in each GitHub +repository. To do that simply add a `service_name` key with the desired value in +each repository and all events sent to the GitHub receiver will properly +associate with that `service.name`. Alternatively, the `service_name` will be +derived from the repository name. + +The order for creating the `service.name` is as follows: + +* `service_name` configuration in the WebHook configuration. +* `service_name` key in the repository's Custom Properties per repository. +* `service_name` derived from the repository name. +* `service.name` set to `unknown_service` per the semantic conventions as a fall back. + +### Configuring A GitHub App + +To configure a GitHub App, you will need to create a new GitHub App within your +organization. Refer to the general [GitHub App documentation][ghapp] for how to +create a GitHub App. During the subscription phase, subscribe to `workflow_run` and `workflow_job` events. + [wjob]: https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_job [wrun]: https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_run [valid]: https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries [config.go] ./config.go [cfghttp]: https://pkg.go.dev/go.opentelemetry.io/collector/config/confighttp#ServerConfig +[cp]: https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization +[vcsm]: https://opentelemetry.io/docs/specs/semconv/cicd/cicd-metrics/#vcs-metrics +[doracap]: https://dora.dev/capabilities/ +[dorafour]: https://dora.dev/guides/dora-metrics-four-keys/ +[ghapp]: https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app From a8b9b583d307870ffad0acaaa21d8fa96a31e963 Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Sun, 2 Feb 2025 20:16:31 -0500 Subject: [PATCH 16/18] [chore] update the readme about workflow events --- receiver/githubreceiver/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/receiver/githubreceiver/README.md b/receiver/githubreceiver/README.md index 504fd0c1286e..d0d2cb908f89 100644 --- a/receiver/githubreceiver/README.md +++ b/receiver/githubreceiver/README.md @@ -181,6 +181,8 @@ To configure a GitHub App, you will need to create a new GitHub App within your organization. Refer to the general [GitHub App documentation][ghapp] for how to create a GitHub App. During the subscription phase, subscribe to `workflow_run` and `workflow_job` events. +> NOTE: Only `workflow_run` events are supported in created traces at this time. + [wjob]: https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_job [wrun]: https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_run [valid]: https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries From c455735ca8f5e4d18377117db3f6eb8fd37bcd9c Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Sun, 2 Feb 2025 20:50:59 -0500 Subject: [PATCH 17/18] [chore] fix typo in test --- receiver/githubreceiver/config_test.go | 4 ++-- receiver/githubreceiver/testdata/config.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/receiver/githubreceiver/config_test.go b/receiver/githubreceiver/config_test.go index 89090076d642..4c7ee755ef92 100644 --- a/receiver/githubreceiver/config_test.go +++ b/receiver/githubreceiver/config_test.go @@ -51,7 +51,7 @@ func TestLoadConfig(t *testing.T) { Path: "some/path", HealthPath: "health/path", RequiredHeaders: map[string]configopaque.String{ - "key": "vault-present", + "key": "value-present", }, GitHubHeaders: GitHubHeaders{ Customizable: map[string]string{ @@ -86,7 +86,7 @@ func TestLoadConfig(t *testing.T) { Path: "some/path", HealthPath: "health/path", RequiredHeaders: map[string]configopaque.String{ - "key": "vault-present", + "key": "value-present", }, GitHubHeaders: GitHubHeaders{ Customizable: map[string]string{ diff --git a/receiver/githubreceiver/testdata/config.yaml b/receiver/githubreceiver/testdata/config.yaml index e79f46469bde..0c9666cae89d 100644 --- a/receiver/githubreceiver/testdata/config.yaml +++ b/receiver/githubreceiver/testdata/config.yaml @@ -11,7 +11,7 @@ receivers: path: "some/path" health_path: "health/path" required_headers: - key: vault-present + key: value-present github/customname: initial_delay: 1s @@ -25,7 +25,7 @@ receivers: path: "some/path" health_path: "health/path" required_headers: - key: vault-present + key: value-present processors: nop: From 5727ddc128a543154e7782cdfabeb628265b4b9f Mon Sep 17 00:00:00 2001 From: Adriel Perkins Date: Sun, 2 Feb 2025 20:57:51 -0500 Subject: [PATCH 18/18] [chore] remove unused files --- .../githubreceiver/testdata/inprogress.json | 259 ----------- .../testdata/referenced-version.json | 411 ------------------ .../githubreceiver/testdata/referenced.json | 410 ----------------- .../testdata/workflow-job-completed.json | 184 -------- .../testdata/workflow-run-completed.json | 401 ----------------- 5 files changed, 1665 deletions(-) delete mode 100644 receiver/githubreceiver/testdata/inprogress.json delete mode 100644 receiver/githubreceiver/testdata/referenced-version.json delete mode 100644 receiver/githubreceiver/testdata/referenced.json delete mode 100644 receiver/githubreceiver/testdata/workflow-job-completed.json delete mode 100644 receiver/githubreceiver/testdata/workflow-run-completed.json diff --git a/receiver/githubreceiver/testdata/inprogress.json b/receiver/githubreceiver/testdata/inprogress.json deleted file mode 100644 index 5c55931f06a8..000000000000 --- a/receiver/githubreceiver/testdata/inprogress.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "action": "completed", - "workflow_job": { - "id": 35483677182, - "run_id": 12730579163, - "workflow_name": "Build and Test", - "head_branch": "main", - "run_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163", - "run_attempt": 1, - "node_id": "CR_kwDONmpY-M8AAAAIQv3x_g", - "head_sha": "eaf8da32bca9be5ba3943cb6273ee473819f4b9a", - "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/jobs/35483677182", - "html_url": "https://github.com/liatrio/golang-demo-app/actions/runs/12730579163/job/35483677182", - "status": "completed", - "conclusion": "success", - "created_at": "2025-01-12T04:51:42Z", - "started_at": "2025-01-12T04:51:48Z", - "completed_at": "2025-01-12T04:52:53Z", - "name": "call-workflow-passing-data / test (1.23)", - "steps": [ - { - "name": "Set up job", - "status": "completed", - "conclusion": "success", - "number": 1, - "started_at": "2025-01-12T04:51:47Z", - "completed_at": "2025-01-12T04:51:48Z" - }, - { - "name": "Run actions/checkout@v4", - "status": "completed", - "conclusion": "success", - "number": 2, - "started_at": "2025-01-12T04:51:48Z", - "completed_at": "2025-01-12T04:51:49Z" - }, - { - "name": "Set up Go", - "status": "completed", - "conclusion": "success", - "number": 3, - "started_at": "2025-01-12T04:51:49Z", - "completed_at": "2025-01-12T04:51:51Z" - }, - { - "name": "Make test", - "status": "completed", - "conclusion": "success", - "number": 4, - "started_at": "2025-01-12T04:51:51Z", - "completed_at": "2025-01-12T04:52:47Z" - }, - { - "name": "Upload coverage to Codecov", - "status": "completed", - "conclusion": "success", - "number": 5, - "started_at": "2025-01-12T04:52:48Z", - "completed_at": "2025-01-12T04:52:51Z" - }, - { - "name": "Post Set up Go", - "status": "completed", - "conclusion": "success", - "number": 9, - "started_at": "2025-01-12T04:52:51Z", - "completed_at": "2025-01-12T04:52:51Z" - }, - { - "name": "Post Run actions/checkout@v4", - "status": "completed", - "conclusion": "success", - "number": 10, - "started_at": "2025-01-12T04:52:53Z", - "completed_at": "2025-01-12T04:52:53Z" - }, - { - "name": "Complete job", - "status": "completed", - "conclusion": "success", - "number": 11, - "started_at": "2025-01-12T04:52:52Z", - "completed_at": "2025-01-12T04:52:52Z" - } - ], - "check_run_url": "https://api.github.com/repos/liatrio/golang-demo-app/check-runs/35483677182", - "labels": [ - "ubuntu-latest" - ], - "runner_id": 238, - "runner_name": "GitHub Actions 212", - "runner_group_id": 2, - "runner_group_name": "GitHub Actions" - }, - "repository": { - "id": 912939256, - "node_id": "R_kgDONmpY-A", - "name": "golang-demo-app", - "full_name": "liatrio/golang-demo-app", - "private": true, - "owner": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/liatrio/golang-demo-app", - "description": "Golang demo app", - "fork": false, - "url": "https://api.github.com/repos/liatrio/golang-demo-app", - "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", - "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", - "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", - "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", - "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", - "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", - "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", - "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments", - "created_at": "2025-01-06T17:47:15Z", - "updated_at": "2025-01-12T04:51:41Z", - "pushed_at": "2025-01-12T04:51:39Z", - "git_url": "git://github.com/liatrio/golang-demo-app.git", - "ssh_url": "git@github.com:liatrio/golang-demo-app.git", - "clone_url": "https://github.com/liatrio/golang-demo-app.git", - "svn_url": "https://github.com/liatrio/golang-demo-app", - "homepage": null, - "size": 106, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Go", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "has_discussions": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 10, - "license": { - "key": "apache-2.0", - "name": "Apache License 2.0", - "spdx_id": "Apache-2.0", - "url": "https://api.github.com/licenses/apache-2.0", - "node_id": "MDc6TGljZW5zZTI=" - }, - "allow_forking": true, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [ - "go" - ], - "visibility": "internal", - "forks": 0, - "open_issues": 10, - "watchers": 0, - "default_branch": "main", - "custom_properties": { - "service_name": "golang-demo-app", - "team_name": "tag-o11y" - } - }, - "organization": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "url": "https://api.github.com/orgs/liatrio", - "repos_url": "https://api.github.com/orgs/liatrio/repos", - "events_url": "https://api.github.com/orgs/liatrio/events", - "hooks_url": "https://api.github.com/orgs/liatrio/hooks", - "issues_url": "https://api.github.com/orgs/liatrio/issues", - "members_url": "https://api.github.com/orgs/liatrio/members{/member}", - "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" - }, - "enterprise": { - "id": 9988, - "slug": "liatrio-partnerdemo", - "name": "Liatrio", - "node_id": "E_kgDNJwQ", - "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", - "description": "", - "website_url": "", - "html_url": "https://github.com/enterprises/liatrio-partnerdemo", - "created_at": "2021-11-02T23:03:56Z", - "updated_at": "2023-09-19T00:04:56Z" - }, - "sender": { - "login": "adrielp", - "id": 25961386, - "node_id": "MDQ6VXNlcjI1OTYxMzg2", - "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/adrielp", - "html_url": "https://github.com/adrielp", - "followers_url": "https://api.github.com/users/adrielp/followers", - "following_url": "https://api.github.com/users/adrielp/following{/other_user}", - "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", - "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", - "organizations_url": "https://api.github.com/users/adrielp/orgs", - "repos_url": "https://api.github.com/users/adrielp/repos", - "events_url": "https://api.github.com/users/adrielp/events{/privacy}", - "received_events_url": "https://api.github.com/users/adrielp/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "installation": { - "id": 52902335, - "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" - } -} diff --git a/receiver/githubreceiver/testdata/referenced-version.json b/receiver/githubreceiver/testdata/referenced-version.json deleted file mode 100644 index d9dd2e66c6f1..000000000000 --- a/receiver/githubreceiver/testdata/referenced-version.json +++ /dev/null @@ -1,411 +0,0 @@ -{ - "action": "completed", - "workflow_run": { - "id": 12734274353, - "name": "Build and Test", - "node_id": "WFR_kwLONmpY-M8AAAAC9wWbMQ", - "head_branch": "main", - "head_sha": "15ecdce788097c7d6889a2890098e3a6a5f81a08", - "path": ".github/workflows/build.yml", - "display_title": "chore: see if referenced workflow with version propagates", - "run_number": 67, - "event": "push", - "status": "completed", - "conclusion": "success", - "workflow_id": 136621389, - "check_suite_id": 32960671609, - "check_suite_node_id": "CS_kwDONmpY-M8AAAAHrJvveQ", - "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353", - "html_url": "https://github.com/liatrio/golang-demo-app/actions/runs/12734274353", - "pull_requests": [ - - ], - "created_at": "2025-01-12T14:13:53Z", - "updated_at": "2025-01-12T14:17:43Z", - "actor": { - "login": "adrielp", - "id": 25961386, - "node_id": "MDQ6VXNlcjI1OTYxMzg2", - "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/adrielp", - "html_url": "https://github.com/adrielp", - "followers_url": "https://api.github.com/users/adrielp/followers", - "following_url": "https://api.github.com/users/adrielp/following{/other_user}", - "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", - "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", - "organizations_url": "https://api.github.com/users/adrielp/orgs", - "repos_url": "https://api.github.com/users/adrielp/repos", - "events_url": "https://api.github.com/users/adrielp/events{/privacy}", - "received_events_url": "https://api.github.com/users/adrielp/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "run_attempt": 1, - "referenced_workflows": [ - { - "path": "liatrio/tag-o11y-github-actions/.github/workflows/build.yml@v0.1.7", - "sha": "d8def4264d3756a6b94615bfd3cbdb2ddd4cd3cc", - "ref": "refs/tags/v0.1.7" - } - ], - "run_started_at": "2025-01-12T14:13:53Z", - "triggering_actor": { - "login": "adrielp", - "id": 25961386, - "node_id": "MDQ6VXNlcjI1OTYxMzg2", - "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/adrielp", - "html_url": "https://github.com/adrielp", - "followers_url": "https://api.github.com/users/adrielp/followers", - "following_url": "https://api.github.com/users/adrielp/following{/other_user}", - "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", - "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", - "organizations_url": "https://api.github.com/users/adrielp/orgs", - "repos_url": "https://api.github.com/users/adrielp/repos", - "events_url": "https://api.github.com/users/adrielp/events{/privacy}", - "received_events_url": "https://api.github.com/users/adrielp/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "jobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/jobs", - "logs_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/logs", - "check_suite_url": "https://api.github.com/repos/liatrio/golang-demo-app/check-suites/32960671609", - "artifacts_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/artifacts", - "cancel_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/cancel", - "rerun_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12734274353/rerun", - "previous_attempt_url": null, - "workflow_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/workflows/136621389", - "head_commit": { - "id": "15ecdce788097c7d6889a2890098e3a6a5f81a08", - "tree_id": "0c969850a4b97d1971ed7c1c1e6e06c13b28ead9", - "message": "chore: see if referenced workflow with version propagates", - "timestamp": "2025-01-12T14:13:50Z", - "author": { - "name": "Adriel Perkins", - "email": "adrielp@liatrio.com" - }, - "committer": { - "name": "GitHub", - "email": "noreply@github.com" - } - }, - "repository": { - "id": 912939256, - "node_id": "R_kgDONmpY-A", - "name": "golang-demo-app", - "full_name": "liatrio/golang-demo-app", - "private": true, - "owner": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/liatrio/golang-demo-app", - "description": "Golang demo app", - "fork": false, - "url": "https://api.github.com/repos/liatrio/golang-demo-app", - "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", - "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", - "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", - "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", - "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", - "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", - "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", - "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments" - }, - "head_repository": { - "id": 912939256, - "node_id": "R_kgDONmpY-A", - "name": "golang-demo-app", - "full_name": "liatrio/golang-demo-app", - "private": true, - "owner": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/liatrio/golang-demo-app", - "description": "Golang demo app", - "fork": false, - "url": "https://api.github.com/repos/liatrio/golang-demo-app", - "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", - "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", - "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", - "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", - "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", - "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", - "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", - "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments" - } - }, - "workflow": { - "id": 136621389, - "node_id": "W_kwDONmpY-M4IJK1N", - "name": "Build and Test", - "path": ".github/workflows/build.yml", - "state": "active", - "created_at": "2025-01-06T17:47:19.000Z", - "updated_at": "2025-01-06T20:53:09.000Z", - "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/workflows/136621389", - "html_url": "https://github.com/liatrio/golang-demo-app/blob/main/.github/workflows/build.yml", - "badge_url": "https://github.com/liatrio/golang-demo-app/workflows/Build%20and%20Test/badge.svg" - }, - "repository": { - "id": 912939256, - "node_id": "R_kgDONmpY-A", - "name": "golang-demo-app", - "full_name": "liatrio/golang-demo-app", - "private": true, - "owner": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/liatrio/golang-demo-app", - "description": "Golang demo app", - "fork": false, - "url": "https://api.github.com/repos/liatrio/golang-demo-app", - "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", - "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", - "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", - "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", - "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", - "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", - "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", - "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments", - "created_at": "2025-01-06T17:47:15Z", - "updated_at": "2025-01-12T14:13:54Z", - "pushed_at": "2025-01-12T14:13:51Z", - "git_url": "git://github.com/liatrio/golang-demo-app.git", - "ssh_url": "git@github.com:liatrio/golang-demo-app.git", - "clone_url": "https://github.com/liatrio/golang-demo-app.git", - "svn_url": "https://github.com/liatrio/golang-demo-app", - "homepage": null, - "size": 107, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Go", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "has_discussions": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 10, - "license": { - "key": "apache-2.0", - "name": "Apache License 2.0", - "spdx_id": "Apache-2.0", - "url": "https://api.github.com/licenses/apache-2.0", - "node_id": "MDc6TGljZW5zZTI=" - }, - "allow_forking": true, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [ - "go" - ], - "visibility": "internal", - "forks": 0, - "open_issues": 10, - "watchers": 0, - "default_branch": "main", - "custom_properties": { - "service_name": "golang-demo-app", - "team_name": "tag-o11y" - } - }, - "organization": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "url": "https://api.github.com/orgs/liatrio", - "repos_url": "https://api.github.com/orgs/liatrio/repos", - "events_url": "https://api.github.com/orgs/liatrio/events", - "hooks_url": "https://api.github.com/orgs/liatrio/hooks", - "issues_url": "https://api.github.com/orgs/liatrio/issues", - "members_url": "https://api.github.com/orgs/liatrio/members{/member}", - "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" - }, - "enterprise": { - "id": 9988, - "slug": "liatrio-partnerdemo", - "name": "Liatrio", - "node_id": "E_kgDNJwQ", - "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", - "description": "", - "website_url": "", - "html_url": "https://github.com/enterprises/liatrio-partnerdemo", - "created_at": "2021-11-02T23:03:56Z", - "updated_at": "2023-09-19T00:04:56Z" - }, - "sender": { - "login": "adrielp", - "id": 25961386, - "node_id": "MDQ6VXNlcjI1OTYxMzg2", - "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/adrielp", - "html_url": "https://github.com/adrielp", - "followers_url": "https://api.github.com/users/adrielp/followers", - "following_url": "https://api.github.com/users/adrielp/following{/other_user}", - "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", - "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", - "organizations_url": "https://api.github.com/users/adrielp/orgs", - "repos_url": "https://api.github.com/users/adrielp/repos", - "events_url": "https://api.github.com/users/adrielp/events{/privacy}", - "received_events_url": "https://api.github.com/users/adrielp/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "installation": { - "id": 52902335, - "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" - } -} diff --git a/receiver/githubreceiver/testdata/referenced.json b/receiver/githubreceiver/testdata/referenced.json deleted file mode 100644 index 57d4c67a3e30..000000000000 --- a/receiver/githubreceiver/testdata/referenced.json +++ /dev/null @@ -1,410 +0,0 @@ -{ - "action": "completed", - "workflow_run": { - "id": 12730579163, - "name": "Build and Test", - "node_id": "WFR_kwLONmpY-M8AAAAC9s042w", - "head_branch": "main", - "head_sha": "eaf8da32bca9be5ba3943cb6273ee473819f4b9a", - "path": ".github/workflows/build.yml", - "display_title": "build(deps): bump golang.org/x/crypto in /internal/tools (#2)", - "run_number": 66, - "event": "push", - "status": "completed", - "conclusion": "success", - "workflow_id": 136621389, - "check_suite_id": 32953541673, - "check_suite_node_id": "CS_kwDONmpY-M8AAAAHrC8kKQ", - "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163", - "html_url": "https://github.com/liatrio/golang-demo-app/actions/runs/12730579163", - "pull_requests": [ - - ], - "created_at": "2025-01-12T04:51:41Z", - "updated_at": "2025-01-12T04:55:27Z", - "actor": { - "login": "adrielp", - "id": 25961386, - "node_id": "MDQ6VXNlcjI1OTYxMzg2", - "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/adrielp", - "html_url": "https://github.com/adrielp", - "followers_url": "https://api.github.com/users/adrielp/followers", - "following_url": "https://api.github.com/users/adrielp/following{/other_user}", - "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", - "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", - "organizations_url": "https://api.github.com/users/adrielp/orgs", - "repos_url": "https://api.github.com/users/adrielp/repos", - "events_url": "https://api.github.com/users/adrielp/events{/privacy}", - "received_events_url": "https://api.github.com/users/adrielp/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "run_attempt": 1, - "referenced_workflows": [ - { - "path": "liatrio/tag-o11y-github-actions/.github/workflows/build.yml@d8def4264d3756a6b94615bfd3cbdb2ddd4cd3cc", - "sha": "d8def4264d3756a6b94615bfd3cbdb2ddd4cd3cc" - } - ], - "run_started_at": "2025-01-12T04:51:41Z", - "triggering_actor": { - "login": "adrielp", - "id": 25961386, - "node_id": "MDQ6VXNlcjI1OTYxMzg2", - "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/adrielp", - "html_url": "https://github.com/adrielp", - "followers_url": "https://api.github.com/users/adrielp/followers", - "following_url": "https://api.github.com/users/adrielp/following{/other_user}", - "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", - "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", - "organizations_url": "https://api.github.com/users/adrielp/orgs", - "repos_url": "https://api.github.com/users/adrielp/repos", - "events_url": "https://api.github.com/users/adrielp/events{/privacy}", - "received_events_url": "https://api.github.com/users/adrielp/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "jobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/jobs", - "logs_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/logs", - "check_suite_url": "https://api.github.com/repos/liatrio/golang-demo-app/check-suites/32953541673", - "artifacts_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/artifacts", - "cancel_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/cancel", - "rerun_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/runs/12730579163/rerun", - "previous_attempt_url": null, - "workflow_url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/workflows/136621389", - "head_commit": { - "id": "eaf8da32bca9be5ba3943cb6273ee473819f4b9a", - "tree_id": "bfbe708f1c900ee902b17c98368933d51887dd6c", - "message": "build(deps): bump golang.org/x/crypto in /internal/tools (#2)\n\nBumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.29.0 to 0.31.0.\n- [Commits](https://github.com/golang/crypto/compare/v0.29.0...v0.31.0)\n\n---\nupdated-dependencies:\n- dependency-name: golang.org/x/crypto\n dependency-type: indirect\n...\n\nSigned-off-by: dependabot[bot] \nCo-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>", - "timestamp": "2025-01-12T04:51:38Z", - "author": { - "name": "dependabot[bot]", - "email": "49699333+dependabot[bot]@users.noreply.github.com" - }, - "committer": { - "name": "GitHub", - "email": "noreply@github.com" - } - }, - "repository": { - "id": 912939256, - "node_id": "R_kgDONmpY-A", - "name": "golang-demo-app", - "full_name": "liatrio/golang-demo-app", - "private": true, - "owner": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/liatrio/golang-demo-app", - "description": "Golang demo app", - "fork": false, - "url": "https://api.github.com/repos/liatrio/golang-demo-app", - "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", - "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", - "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", - "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", - "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", - "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", - "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", - "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments" - }, - "head_repository": { - "id": 912939256, - "node_id": "R_kgDONmpY-A", - "name": "golang-demo-app", - "full_name": "liatrio/golang-demo-app", - "private": true, - "owner": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/liatrio/golang-demo-app", - "description": "Golang demo app", - "fork": false, - "url": "https://api.github.com/repos/liatrio/golang-demo-app", - "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", - "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", - "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", - "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", - "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", - "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", - "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", - "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments" - } - }, - "workflow": { - "id": 136621389, - "node_id": "W_kwDONmpY-M4IJK1N", - "name": "Build and Test", - "path": ".github/workflows/build.yml", - "state": "active", - "created_at": "2025-01-06T17:47:19.000Z", - "updated_at": "2025-01-06T20:53:09.000Z", - "url": "https://api.github.com/repos/liatrio/golang-demo-app/actions/workflows/136621389", - "html_url": "https://github.com/liatrio/golang-demo-app/blob/main/.github/workflows/build.yml", - "badge_url": "https://github.com/liatrio/golang-demo-app/workflows/Build%20and%20Test/badge.svg" - }, - "repository": { - "id": 912939256, - "node_id": "R_kgDONmpY-A", - "name": "golang-demo-app", - "full_name": "liatrio/golang-demo-app", - "private": true, - "owner": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/liatrio", - "html_url": "https://github.com/liatrio", - "followers_url": "https://api.github.com/users/liatrio/followers", - "following_url": "https://api.github.com/users/liatrio/following{/other_user}", - "gists_url": "https://api.github.com/users/liatrio/gists{/gist_id}", - "starred_url": "https://api.github.com/users/liatrio/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/liatrio/subscriptions", - "organizations_url": "https://api.github.com/users/liatrio/orgs", - "repos_url": "https://api.github.com/users/liatrio/repos", - "events_url": "https://api.github.com/users/liatrio/events{/privacy}", - "received_events_url": "https://api.github.com/users/liatrio/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/liatrio/golang-demo-app", - "description": "Golang demo app", - "fork": false, - "url": "https://api.github.com/repos/liatrio/golang-demo-app", - "forks_url": "https://api.github.com/repos/liatrio/golang-demo-app/forks", - "keys_url": "https://api.github.com/repos/liatrio/golang-demo-app/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/liatrio/golang-demo-app/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/liatrio/golang-demo-app/teams", - "hooks_url": "https://api.github.com/repos/liatrio/golang-demo-app/hooks", - "issue_events_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/events{/number}", - "events_url": "https://api.github.com/repos/liatrio/golang-demo-app/events", - "assignees_url": "https://api.github.com/repos/liatrio/golang-demo-app/assignees{/user}", - "branches_url": "https://api.github.com/repos/liatrio/golang-demo-app/branches{/branch}", - "tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/tags", - "blobs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/liatrio/golang-demo-app/statuses/{sha}", - "languages_url": "https://api.github.com/repos/liatrio/golang-demo-app/languages", - "stargazers_url": "https://api.github.com/repos/liatrio/golang-demo-app/stargazers", - "contributors_url": "https://api.github.com/repos/liatrio/golang-demo-app/contributors", - "subscribers_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscribers", - "subscription_url": "https://api.github.com/repos/liatrio/golang-demo-app/subscription", - "commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/liatrio/golang-demo-app/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/liatrio/golang-demo-app/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/liatrio/golang-demo-app/contents/{+path}", - "compare_url": "https://api.github.com/repos/liatrio/golang-demo-app/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/liatrio/golang-demo-app/merges", - "archive_url": "https://api.github.com/repos/liatrio/golang-demo-app/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/liatrio/golang-demo-app/downloads", - "issues_url": "https://api.github.com/repos/liatrio/golang-demo-app/issues{/number}", - "pulls_url": "https://api.github.com/repos/liatrio/golang-demo-app/pulls{/number}", - "milestones_url": "https://api.github.com/repos/liatrio/golang-demo-app/milestones{/number}", - "notifications_url": "https://api.github.com/repos/liatrio/golang-demo-app/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/liatrio/golang-demo-app/labels{/name}", - "releases_url": "https://api.github.com/repos/liatrio/golang-demo-app/releases{/id}", - "deployments_url": "https://api.github.com/repos/liatrio/golang-demo-app/deployments", - "created_at": "2025-01-06T17:47:15Z", - "updated_at": "2025-01-12T04:51:41Z", - "pushed_at": "2025-01-12T04:51:39Z", - "git_url": "git://github.com/liatrio/golang-demo-app.git", - "ssh_url": "git@github.com:liatrio/golang-demo-app.git", - "clone_url": "https://github.com/liatrio/golang-demo-app.git", - "svn_url": "https://github.com/liatrio/golang-demo-app", - "homepage": null, - "size": 106, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Go", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "has_discussions": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 10, - "license": { - "key": "apache-2.0", - "name": "Apache License 2.0", - "spdx_id": "Apache-2.0", - "url": "https://api.github.com/licenses/apache-2.0", - "node_id": "MDc6TGljZW5zZTI=" - }, - "allow_forking": true, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [ - "go" - ], - "visibility": "internal", - "forks": 0, - "open_issues": 10, - "watchers": 0, - "default_branch": "main", - "custom_properties": { - "service_name": "golang-demo-app", - "team_name": "tag-o11y" - } - }, - "organization": { - "login": "liatrio", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "url": "https://api.github.com/orgs/liatrio", - "repos_url": "https://api.github.com/orgs/liatrio/repos", - "events_url": "https://api.github.com/orgs/liatrio/events", - "hooks_url": "https://api.github.com/orgs/liatrio/hooks", - "issues_url": "https://api.github.com/orgs/liatrio/issues", - "members_url": "https://api.github.com/orgs/liatrio/members{/member}", - "public_members_url": "https://api.github.com/orgs/liatrio/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/5726618?v=4", - "description": "Enterprise Delivery Transformation, DevOps, Cloud Native Automation" - }, - "enterprise": { - "id": 9988, - "slug": "liatrio-partnerdemo", - "name": "Liatrio", - "node_id": "E_kgDNJwQ", - "avatar_url": "https://avatars.githubusercontent.com/b/9988?v=4", - "description": "", - "website_url": "", - "html_url": "https://github.com/enterprises/liatrio-partnerdemo", - "created_at": "2021-11-02T23:03:56Z", - "updated_at": "2023-09-19T00:04:56Z" - }, - "sender": { - "login": "adrielp", - "id": 25961386, - "node_id": "MDQ6VXNlcjI1OTYxMzg2", - "avatar_url": "https://avatars.githubusercontent.com/u/25961386?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/adrielp", - "html_url": "https://github.com/adrielp", - "followers_url": "https://api.github.com/users/adrielp/followers", - "following_url": "https://api.github.com/users/adrielp/following{/other_user}", - "gists_url": "https://api.github.com/users/adrielp/gists{/gist_id}", - "starred_url": "https://api.github.com/users/adrielp/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/adrielp/subscriptions", - "organizations_url": "https://api.github.com/users/adrielp/orgs", - "repos_url": "https://api.github.com/users/adrielp/repos", - "events_url": "https://api.github.com/users/adrielp/events{/privacy}", - "received_events_url": "https://api.github.com/users/adrielp/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "installation": { - "id": 52902335, - "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" - } -} diff --git a/receiver/githubreceiver/testdata/workflow-job-completed.json b/receiver/githubreceiver/testdata/workflow-job-completed.json deleted file mode 100644 index 55eaf65623bd..000000000000 --- a/receiver/githubreceiver/testdata/workflow-job-completed.json +++ /dev/null @@ -1,184 +0,0 @@ -{ - "action": "completed", - "workflow_job": { - "id": 35483121697, - "run_id": 12719320830, - "workflow_name": "Release", - "head_branch": "main", - "run_url": "https://api.github.com/repos/example/example-repo/actions/runs/12719320830", - "run_attempt": 1, - "node_id": "CR_kwDOLaz6mc8AAAAIQvV4IQ", - "head_sha": "3dd4d0f1d80f389d5849adb029f7398d8d0f8bc1", - "url": "https://api.github.com/repos/example/example-repo/actions/jobs/35483121697", - "html_url": "https://github.com/example/example-repo/runs/35483121697", - "status": "completed", - "conclusion": "success", - "created_at": "2025-01-12T04:07:01Z", - "started_at": "2025-01-12T04:07:01Z", - "completed_at": "2025-01-12T04:07:02Z", - "name": "Test Report", - "steps": [], - "check_run_url": "https://api.github.com/repos/example/example-repo/check-runs/35483121697", - "labels": [], - "runner_id": null, - "runner_name": null, - "runner_group_id": null, - "runner_group_name": null - }, - "repository": { - "id": 766311065, - "node_id": "R_kgDOLaz6mQ", - "name": "example-repo", - "full_name": "example/example-repo", - "private": true, - "owner": { - "login": "example", - "id": 12312321, - "node_id": "MDEyOk9yz2fuaxphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/1231928?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/example", - "html_url": "https://github.com/example", - "followers_url": "https://api.github.com/users/example/followers", - "following_url": "https://api.github.com/users/example/following{/other_user}", - "gists_url": "https://api.github.com/users/example/gists{/gist_id}", - "starred_url": "https://api.github.com/users/example/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/example/subscriptions", - "organizations_url": "https://api.github.com/users/example/orgs", - "repos_url": "https://api.github.com/users/example/repos", - "events_url": "https://api.github.com/users/example/events{/privacy}", - "received_events_url": "https://api.github.com/users/example/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/example/example-repo", - "description": "Example repo", - "fork": false, - "url": "https://api.github.com/repos/example/example-repo", - "forks_url": "https://api.github.com/repos/example/example-repo/forks", - "keys_url": "https://api.github.com/repos/example/example-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/example/example-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/example/example-repo/teams", - "hooks_url": "https://api.github.com/repos/example/example-repo/hooks", - "issue_events_url": "https://api.github.com/repos/example/example-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/example/example-repo/events", - "assignees_url": "https://api.github.com/repos/example/example-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/example/example-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/example/example-repo/tags", - "blobs_url": "https://api.github.com/repos/example/example-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/example/example-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/example/example-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/example/example-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/example/example-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/example/example-repo/languages", - "stargazers_url": "https://api.github.com/repos/example/example-repo/stargazers", - "contributors_url": "https://api.github.com/repos/example/example-repo/contributors", - "subscribers_url": "https://api.github.com/repos/example/example-repo/subscribers", - "subscription_url": "https://api.github.com/repos/example/example-repo/subscription", - "commits_url": "https://api.github.com/repos/example/example-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/example/example-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/example/example-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/example/example-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/example/example-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/example/example-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/example/example-repo/merges", - "archive_url": "https://api.github.com/repos/example/example-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/example/example-repo/downloads", - "issues_url": "https://api.github.com/repos/example/example-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/example/example-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/example/example-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/example/example-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/example/example-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/example/example-repo/releases{/id}", - "deployments_url": "https://api.github.com/repos/example/example-repo/deployments", - "created_at": "2024-03-02T22:47:40Z", - "updated_at": "2025-01-11T00:24:04Z", - "pushed_at": "2025-01-11T08:31:59Z", - "git_url": "git://github.com/example/example-repo.git", - "ssh_url": "git@github.com:example/example-repo.git", - "clone_url": "https://github.com/example/example-repo.git", - "svn_url": "https://github.com/example/example-repo", - "homepage": "https://github.com/", - "size": 52025, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Go", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "has_discussions": false, - "forks_count": 2, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 166, - "license": null, - "allow_forking": true, - "is_template": false, - "web_commit_signoff_required": false, - "topics": ["example"], - "visibility": "internal", - "forks": 2, - "open_issues": 166, - "watchers": 0, - "default_branch": "main", - "custom_properties": { - "service_name": "example-service", - "team_name": "example-team" - } - }, - "organization": { - "login": "example", - "id": 12313121, - "node_id": "mdeyOk9y1kjuaXphdGlvbjU3MjY2MTg=", - "url": "https://api.github.com/orgs/example", - "repos_url": "https://api.github.com/orgs/example/repos", - "events_url": "https://api.github.com/orgs/example/events", - "hooks_url": "https://api.github.com/orgs/example/hooks", - "issues_url": "https://api.github.com/orgs/example/issues", - "members_url": "https://api.github.com/orgs/example/members{/member}", - "public_members_url": "https://api.github.com/orgs/example/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/1234124?v=4", - "description": "example" - }, - "enterprise": { - "id": 12312321, - "slug": "example", - "name": "example", - "node_id": "E_kgDNJwQ", - "avatar_url": "https://avatars.githubusercontent.com/b/1231?v=4", - "description": "", - "website_url": "", - "html_url": "https://github.com/enterprises/example", - "created_at": "2021-11-02T23:03:56Z", - "updated_at": "2023-09-19T00:04:56Z" - }, - "sender": { - "login": "example-user", - "id": 123333011, - "node_id": "U_kgDOB1npkw", - "avatar_url": "https://avatars.githubusercontent.com/u/123333011?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/example-user", - "html_url": "https://github.com/example-user", - "followers_url": "https://api.github.com/users/example-user/followers", - "following_url": "https://api.github.com/users/example-user/following{/other_user}", - "gists_url": "https://api.github.com/users/example-user/gists{/gist_id}", - "starred_url": "https://api.github.com/users/example-user/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/example-user/subscriptions", - "organizations_url": "https://api.github.com/users/example-user/orgs", - "repos_url": "https://api.github.com/users/example-user/repos", - "events_url": "https://api.github.com/users/example-user/events{/privacy}", - "received_events_url": "https://api.github.com/users/example-user/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "installation": { - "id": 52902335, - "node_id": "kj1l2k3j1l2kj5zdGFsbGF0aW9uNTI5MDIzMzU=" - } -} diff --git a/receiver/githubreceiver/testdata/workflow-run-completed.json b/receiver/githubreceiver/testdata/workflow-run-completed.json deleted file mode 100644 index 8322fbc0abcc..000000000000 --- a/receiver/githubreceiver/testdata/workflow-run-completed.json +++ /dev/null @@ -1,401 +0,0 @@ -{ - "action": "completed", - "workflow_run": { - "id": 12730301372, - "name": "Test", - "node_id": "WFR_kwLOLaz6mc8AAAAC9sj7vA", - "head_branch": "main", - "head_sha": "3dd4d0f1d80f389d5849adb029f7398d8d0f8bc1", - "path": ".github/workflows/test.yml", - "display_title": "Test", - "run_number": 10692, - "event": "schedule", - "status": "completed", - "conclusion": "success", - "workflow_id": 88543479, - "check_suite_id": 32953030627, - "check_suite_node_id": "CS_kwDOLaz6mc8AAAAHrCdX4w", - "url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372", - "html_url": "https://github.com/example/example-repo/actions/runs/12730301372", - "pull_requests": [], - "created_at": "2025-01-12T04:05:35Z", - "updated_at": "2025-01-12T04:07:10Z", - "actor": { - "login": "example-user", - "id": 12312312, - "node_id": "MDQ6VXNlcjEwODAxMTM4", - "avatar_url": "https://avatars.githubusercontent.com/u/123123?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/example-user", - "html_url": "https://github.com/example-user", - "followers_url": "https://api.github.com/users/example-user/followers", - "following_url": "https://api.github.com/users/example-user/following{/other_user}", - "gists_url": "https://api.github.com/users/example-user/gists{/gist_id}", - "starred_url": "https://api.github.com/users/example-user/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/example-user/subscriptions", - "organizations_url": "https://api.github.com/users/example-user/orgs", - "repos_url": "https://api.github.com/users/example-user/repos", - "events_url": "https://api.github.com/users/example-user/events{/privacy}", - "received_events_url": "https://api.github.com/users/example-user/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "run_attempt": 1, - "referenced_workflows": [ - { - "path": "example/example-repo/.github/workflows/build.yaml@v0.4.16", - "sha": "d98007814bbddd380d9aa0ae1e71dcd13dce0af3", - "ref": "refs/tags/v0.4.16" - } - ], - "run_started_at": "2025-01-12T04:05:35Z", - "triggering_actor": { - "login": "example-user", - "id": 12312312, - "node_id": "MDQ6VXNlcjEwODAxMTM4", - "avatar_url": "https://avatars.githubusercontent.com/u/123123?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/example-user", - "html_url": "https://github.com/example-user", - "followers_url": "https://api.github.com/users/example-user/followers", - "following_url": "https://api.github.com/users/example-user/following{/other_user}", - "gists_url": "https://api.github.com/users/example-user/gists{/gist_id}", - "starred_url": "https://api.github.com/users/example-user/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/example-user/subscriptions", - "organizations_url": "https://api.github.com/users/example-user/orgs", - "repos_url": "https://api.github.com/users/example-user/repos", - "events_url": "https://api.github.com/users/example-user/events{/privacy}", - "received_events_url": "https://api.github.com/users/example-user/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "jobs_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/jobs", - "logs_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/logs", - "check_suite_url": "https://api.github.com/repos/example/example-repo/check-suites/32953030627", - "artifacts_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/artifacts", - "cancel_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/cancel", - "rerun_url": "https://api.github.com/repos/example/example-repo/actions/runs/12730301372/rerun", - "previous_attempt_url": null, - "workflow_url": "https://api.github.com/repos/example/example-repo/actions/workflows/88543479", - "head_commit": { - "id": "3dd4d0f1d80f389d5849adb029f7398d8d0f8bc1", - "tree_id": "f51302143d266a49520d53487e000e8bf338d121", - "message": "feat: example message", - "timestamp": "2025-01-11T00:24:00Z", - "author": { - "name": "Example User", - "email": "123333011+example-user@users.noreply.github.com" - }, - "committer": { - "name": "GitHub", - "email": "noreply@github.com" - } - }, - "repository": { - "id": 766311065, - "node_id": "R_kgDOLaz6mQ", - "name": "example-repo", - "full_name": "example/example-repo", - "private": true, - "owner": { - "login": "example", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/123123?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/example", - "html_url": "https://github.com/example", - "followers_url": "https://api.github.com/users/example/followers", - "following_url": "https://api.github.com/users/example/following{/other_user}", - "gists_url": "https://api.github.com/users/example/gists{/gist_id}", - "starred_url": "https://api.github.com/users/example/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/example/subscriptions", - "organizations_url": "https://api.github.com/users/example/orgs", - "repos_url": "https://api.github.com/users/example/repos", - "events_url": "https://api.github.com/users/example/events{/privacy}", - "received_events_url": "https://api.github.com/users/example/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/example/example-repo", - "description": "Example Repo", - "fork": false, - "url": "https://api.github.com/repos/example/example-repo", - "forks_url": "https://api.github.com/repos/example/example-repo/forks", - "keys_url": "https://api.github.com/repos/example/example-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/example/example-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/example/example-repo/teams", - "hooks_url": "https://api.github.com/repos/example/example-repo/hooks", - "issue_events_url": "https://api.github.com/repos/example/example-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/example/example-repo/events", - "assignees_url": "https://api.github.com/repos/example/example-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/example/example-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/example/example-repo/tags", - "blobs_url": "https://api.github.com/repos/example/example-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/example/example-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/example/example-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/example/example-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/example/example-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/example/example-repo/languages", - "stargazers_url": "https://api.github.com/repos/example/example-repo/stargazers", - "contributors_url": "https://api.github.com/repos/example/example-repo/contributors", - "subscribers_url": "https://api.github.com/repos/example/example-repo/subscribers", - "subscription_url": "https://api.github.com/repos/example/example-repo/subscription", - "commits_url": "https://api.github.com/repos/example/example-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/example/example-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/example/example-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/example/example-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/example/example-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/example/example-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/example/example-repo/merges", - "archive_url": "https://api.github.com/repos/example/example-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/example/example-repo/downloads", - "issues_url": "https://api.github.com/repos/example/example-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/example/example-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/example/example-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/example/example-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/example/example-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/example/example-repo/releases{/id}", - "deployments_url": "https://api.github.com/repos/example/example-repo/deployments" - }, - "head_repository": { - "id": 766311065, - "node_id": "R_kgDOLaz6mQ", - "name": "example-repo", - "full_name": "example/example-repo", - "private": true, - "owner": { - "login": "example", - "id": 5726618, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/1231232?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/example", - "html_url": "https://github.com/example", - "followers_url": "https://api.github.com/users/example/followers", - "following_url": "https://api.github.com/users/example/following{/other_user}", - "gists_url": "https://api.github.com/users/example/gists{/gist_id}", - "starred_url": "https://api.github.com/users/example/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/example/subscriptions", - "organizations_url": "https://api.github.com/users/example/orgs", - "repos_url": "https://api.github.com/users/example/repos", - "events_url": "https://api.github.com/users/example/events{/privacy}", - "received_events_url": "https://api.github.com/users/example/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/example/example-repo", - "description": "Example Repo", - "fork": false, - "url": "https://api.github.com/repos/example/example-repo", - "forks_url": "https://api.github.com/repos/example/example-repo/forks", - "keys_url": "https://api.github.com/repos/example/example-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/example/example-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/example/example-repo/teams", - "hooks_url": "https://api.github.com/repos/example/example-repo/hooks", - "issue_events_url": "https://api.github.com/repos/example/example-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/example/example-repo/events", - "assignees_url": "https://api.github.com/repos/example/example-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/example/example-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/example/example-repo/tags", - "blobs_url": "https://api.github.com/repos/example/example-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/example/example-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/example/example-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/example/example-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/example/example-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/example/example-repo/languages", - "stargazers_url": "https://api.github.com/repos/example/example-repo/stargazers", - "contributors_url": "https://api.github.com/repos/example/example-repo/contributors", - "subscribers_url": "https://api.github.com/repos/example/example-repo/subscribers", - "subscription_url": "https://api.github.com/repos/example/example-repo/subscription", - "commits_url": "https://api.github.com/repos/example/example-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/example/example-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/example/example-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/example/example-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/example/example-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/example/example-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/example/example-repo/merges", - "archive_url": "https://api.github.com/repos/example/example-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/example/example-repo/downloads", - "issues_url": "https://api.github.com/repos/example/example-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/example/example-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/example/example-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/example/example-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/example/example-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/example/example-repo/releases{/id}", - "deployments_url": "https://api.github.com/repos/example/example-repo/deployments" - } - }, - "workflow": { - "id": 88543479, - "node_id": "W_kwDOLaz6mc4FRxD3", - "name": "Test", - "path": ".github/workflows/test.yml", - "state": "active", - "created_at": "2024-03-06T00:16:51.000Z", - "updated_at": "2024-03-06T00:43:24.000Z", - "url": "https://api.github.com/repos/example/example-repo/actions/workflows/88543479", - "html_url": "https://github.com/example/example-repo/blob/main/.github/workflows/test.yml", - "badge_url": "https://github.com/example/example-repo/workflows/Test/badge.svg" - }, - "repository": { - "id": 766311065, - "node_id": "R_kgDOLaz6mQ", - "name": "example-repo", - "full_name": "example/example-repo", - "private": true, - "owner": { - "login": "example", - "id": 12312312, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "avatar_url": "https://avatars.githubusercontent.com/u/12312312?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/example", - "html_url": "https://github.com/example", - "followers_url": "https://api.github.com/users/example/followers", - "following_url": "https://api.github.com/users/example/following{/other_user}", - "gists_url": "https://api.github.com/users/example/gists{/gist_id}", - "starred_url": "https://api.github.com/users/example/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/example/subscriptions", - "organizations_url": "https://api.github.com/users/example/orgs", - "repos_url": "https://api.github.com/users/example/repos", - "events_url": "https://api.github.com/users/example/events{/privacy}", - "received_events_url": "https://api.github.com/users/example/received_events", - "type": "Organization", - "user_view_type": "public", - "site_admin": false - }, - "html_url": "https://github.com/example/example-repo", - "description": "Example repo", - "fork": false, - "url": "https://api.github.com/repos/example/example-repo", - "forks_url": "https://api.github.com/repos/example/example-repo/forks", - "keys_url": "https://api.github.com/repos/example/example-repo/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/example/example-repo/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/example/example-repo/teams", - "hooks_url": "https://api.github.com/repos/example/example-repo/hooks", - "issue_events_url": "https://api.github.com/repos/example/example-repo/issues/events{/number}", - "events_url": "https://api.github.com/repos/example/example-repo/events", - "assignees_url": "https://api.github.com/repos/example/example-repo/assignees{/user}", - "branches_url": "https://api.github.com/repos/example/example-repo/branches{/branch}", - "tags_url": "https://api.github.com/repos/example/example-repo/tags", - "blobs_url": "https://api.github.com/repos/example/example-repo/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/example/example-repo/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/example/example-repo/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/example/example-repo/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/example/example-repo/statuses/{sha}", - "languages_url": "https://api.github.com/repos/example/example-repo/languages", - "stargazers_url": "https://api.github.com/repos/example/example-repo/stargazers", - "contributors_url": "https://api.github.com/repos/example/example-repo/contributors", - "subscribers_url": "https://api.github.com/repos/example/example-repo/subscribers", - "subscription_url": "https://api.github.com/repos/example/example-repo/subscription", - "commits_url": "https://api.github.com/repos/example/example-repo/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/example/example-repo/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/example/example-repo/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/example/example-repo/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/example/example-repo/contents/{+path}", - "compare_url": "https://api.github.com/repos/example/example-repo/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/example/example-repo/merges", - "archive_url": "https://api.github.com/repos/example/example-repo/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/example/example-repo/downloads", - "issues_url": "https://api.github.com/repos/example/example-repo/issues{/number}", - "pulls_url": "https://api.github.com/repos/example/example-repo/pulls{/number}", - "milestones_url": "https://api.github.com/repos/example/example-repo/milestones{/number}", - "notifications_url": "https://api.github.com/repos/example/example-repo/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/example/example-repo/labels{/name}", - "releases_url": "https://api.github.com/repos/example/example-repo/releases{/id}", - "deployments_url": "https://api.github.com/repos/example/example-repo/deployments", - "created_at": "2024-03-02T22:47:40Z", - "updated_at": "2025-01-11T00:24:04Z", - "pushed_at": "2025-01-11T08:31:59Z", - "git_url": "git://github.com/example/example-repo.git", - "ssh_url": "git@github.com:example/example-repo.git", - "clone_url": "https://github.com/example/example-repo.git", - "svn_url": "https://github.com/example/example-repo", - "homepage": "https://github.com/", - "size": 52025, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Go", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "has_discussions": false, - "forks_count": 2, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 166, - "license": null, - "allow_forking": true, - "is_template": false, - "web_commit_signoff_required": false, - "topics": ["example"], - "visibility": "internal", - "forks": 2, - "open_issues": 166, - "watchers": 0, - "default_branch": "main", - "custom_properties": { - "service_name": "example-service", - "team_name": "example-team" - } - }, - "organization": { - "login": "example", - "id": 12312321, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU3MjY2MTg=", - "url": "https://api.github.com/orgs/example", - "repos_url": "https://api.github.com/orgs/example/repos", - "events_url": "https://api.github.com/orgs/example/events", - "hooks_url": "https://api.github.com/orgs/example/hooks", - "issues_url": "https://api.github.com/orgs/example/issues", - "members_url": "https://api.github.com/orgs/example/members{/member}", - "public_members_url": "https://api.github.com/orgs/example/public_members{/member}", - "avatar_url": "https://avatars.githubusercontent.com/u/12312312?v=4", - "description": "Example" - }, - "enterprise": { - "id": 12312312, - "slug": "example", - "name": "example", - "node_id": "E_kgDNJwQ", - "avatar_url": "https://avatars.githubusercontent.com/b/12312321?v=4", - "description": "", - "website_url": "", - "html_url": "https://github.com/enterprises/example", - "created_at": "2021-11-02T23:03:56Z", - "updated_at": "2023-09-19T00:04:56Z" - }, - "sender": { - "login": "example-user", - "id": 123132, - "node_id": "MDQ6VXNlcjEwODAxMTM4", - "avatar_url": "https://avatars.githubusercontent.com/u/1231321?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/example-user", - "html_url": "https://github.com/example-user", - "followers_url": "https://api.github.com/users/example-user/followers", - "following_url": "https://api.github.com/users/example-user/following{/other_user}", - "gists_url": "https://api.github.com/users/example-user/gists{/gist_id}", - "starred_url": "https://api.github.com/users/example-user/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/example-user/subscriptions", - "organizations_url": "https://api.github.com/users/example-user/orgs", - "repos_url": "https://api.github.com/users/example-user/repos", - "events_url": "https://api.github.com/users/example-user/events{/privacy}", - "received_events_url": "https://api.github.com/users/example-user/received_events", - "type": "User", - "user_view_type": "public", - "site_admin": false - }, - "installation": { - "id": 52902335, - "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNTI5MDIzMzU=" - } -}