Skip to content

Commit

Permalink
Experimental: Adds a Github Integration to fetch profiled code (#2965)
Browse files Browse the repository at this point in the history
* Experimental: Adds a Github Integration to fetch profiled code

* Fixes temp test

* Fixes cookie deletion and use external encryption

* Refactoring of the code, still needs to add back tests.

* Add proper tests back to golang package

* Add documentation on how the github integration works

* mae fmt

* fixes weird utc test

* Pass start, end, and query as props

* working on github login

* Create drawer to show code components

* add macos std lib support

* Fixes URL and nil panic

* Add function name to code component

* support unit

* Add function name

* make code view scrollable

* gray only 0 callsite

* Make code scrollable and close draw on icon click

* Support versionned std lib path

* drop frontend changes for now

* drop frontend changes for now

* improve html example

* Fixes dependency rollback from merge

* remove test

* Adds a commit info api

* Fixes github token expiration and validation

* Addressing review feedback

Co-authored-by: bryanhuhta

* go/mod

* remove testing page

* Add automatic git ref to self profiling

---------

Co-authored-by: Bryan Huhta <bryan.huhta@grafana.com>
  • Loading branch information
cyriltovena and bryanhuhta authored Feb 19, 2024
1 parent 8cfb617 commit 75160cf
Show file tree
Hide file tree
Showing 35 changed files with 6,343 additions and 51 deletions.
772 changes: 772 additions & 0 deletions api/gen/proto/go/vcs/v1/vcs.pb.go

Large diffs are not rendered by default.

2,275 changes: 2,275 additions & 0 deletions api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go

Large diffs are not rendered by default.

199 changes: 199 additions & 0 deletions api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.mux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
connectrpc.com/connect v1.14.0
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0
github.com/prometheus/common v0.44.0
github.com/prometheus/common v0.45.0
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917
google.golang.org/grpc v1.61.0
google.golang.org/protobuf v1.32.0
Expand All @@ -16,7 +16,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
Expand Down
10 changes: 4 additions & 6 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
Expand All @@ -14,19 +13,18 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg=
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM=
github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY=
github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
Expand Down
70 changes: 70 additions & 0 deletions api/openapiv2/gen/phlare.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
{
"name": "StoreGatewayService"
},
{
"name": "VCSService"
},
{
"name": "Version"
}
Expand Down Expand Up @@ -524,6 +527,19 @@
}
}
},
"v1CommitAuthor": {
"type": "object",
"properties": {
"login": {
"type": "string",
"title": "the author login"
},
"avatarURL": {
"type": "string",
"title": "the author avatar URL"
}
}
},
"v1DiffResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -659,6 +675,44 @@
}
}
},
"v1GetCommitResponse": {
"type": "object",
"properties": {
"message": {
"type": "string",
"title": "the commit message"
},
"author": {
"$ref": "#/definitions/v1CommitAuthor",
"title": "the commit author login"
},
"date": {
"type": "string",
"title": "the commit date"
},
"sha": {
"type": "string",
"title": "the commit sha"
},
"URL": {
"type": "string",
"title": "the full URL to the commit"
}
}
},
"v1GetFileResponse": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "base64 content of the file"
},
"URL": {
"type": "string",
"title": "the full URL to the file"
}
}
},
"v1GetSettingsResponse": {
"type": "object",
"properties": {
Expand All @@ -671,6 +725,22 @@
}
}
},
"v1GithubAppResponse": {
"type": "object",
"properties": {
"clientID": {
"type": "string"
}
}
},
"v1GithubLoginResponse": {
"type": "object",
"properties": {
"cookie": {
"type": "string"
}
}
},
"v1Hints": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 75160cf

Please sign in to comment.