Skip to content

Commit

Permalink
[FAI-13039] - Add AI Copilot Evaluation dashboards and mock data (#372)
Browse files Browse the repository at this point in the history
* add metric value endpoint

* add metric definition endpoint

* tag endpoint

* metric value tag endpoint

* user tool endpoint

* add hasura functions and mock data test writes

* giant user tool usage

* shrink to essential usage params with mock data test

* comment

* tags and metric defs

* add metric values with tags

* fix user tool endpoint metric definition

* add value type

* add deletes and fixes

* user tool usage

* reorder deletes

* coordiante tool usage with metrics

* add copilot dashboard

* copilot metrics and lines of code by team

* more charts

* more charts and filters

* include current month

* add copilot impact dashboard

* add pr size info

* fix pr size chart

* rename dashboards

* layout

* add survey endpoints

* add delete survey endpoints

* add post/delete survey functions, call delete functions

* fix names

* fix endpoints

* first survey data

* add cadence survey questions

* add pr questions and refactor writeQuestions

* fix survey uid and association

* add surveys dashboard

* add copilot tasks chart and move dashboard folder

* time savings

* tasks and activity charts

* align filters

* fix space

* fix sql charts, add summary numbers, fix layout

* small updates

* newlines

* fix import

* lint

* lint

* pr size to 2 bars

* only 2 tool users out of 3
  • Loading branch information
crupley authored Nov 12, 2024
1 parent 8692445 commit 578adcb
Show file tree
Hide file tree
Showing 26 changed files with 7,133 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_faros_metric_definition($data_origin: String) {
delete_faros_MetricDefinition(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
5 changes: 5 additions & 0 deletions init/resources/hasura/endpoints/delete_faros_metric_value.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_faros_metric_value($data_origin: String) {
delete_faros_MetricValue(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_faros_metric_value_tag($data_origin: String) {
delete_faros_MetricValueTag(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
5 changes: 5 additions & 0 deletions init/resources/hasura/endpoints/delete_faros_tag.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_faros_tag($data_origin: String) {
delete_faros_Tag(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
5 changes: 5 additions & 0 deletions init/resources/hasura/endpoints/delete_survey_question.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_survey_question($data_origin: String) {
delete_survey_Question(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_survey_question_response($data_origin: String) {
delete_survey_QuestionResponse(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
5 changes: 5 additions & 0 deletions init/resources/hasura/endpoints/delete_survey_survey.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_survey_survey($data_origin: String) {
delete_survey_Survey(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_survey_survey_question_association($data_origin: String) {
delete_survey_SurveyQuestionAssociation(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
5 changes: 5 additions & 0 deletions init/resources/hasura/endpoints/delete_vcs_user_tool.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_vcs_user_tool($data_origin: String) {
delete_vcs_UserTool(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation delete_vcs_user_tool_usage($data_origin: String) {
delete_vcs_UserToolUsage(where: { origin: { _eq: $data_origin } }) {
affected_rows
}
}
24 changes: 24 additions & 0 deletions init/resources/hasura/endpoints/faros_metric_definition.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
mutation insert_faros_metric_definition(
$data_uid: String!
$data_name: String!
$data_value_type: jsonb
$data_origin: String
) {
insert_faros_MetricDefinition_one(
object: {
uid: $data_uid
name: $data_name
valueType: $data_value_type
origin: $data_origin
}
on_conflict: {
constraint: faros_MetricDefinition_pkey
update_columns: [
origin
refreshedAt
]
}
) {
id
}
}
34 changes: 34 additions & 0 deletions init/resources/hasura/endpoints/faros_metric_value.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
mutation insert_faros_metric_value(
$data_uid: String!
$data_computedAt: timestamptz!
$data_value: String!
$data_definition: String!
$data_origin: String
) {
insert_faros_MetricValue_one(
object: {
uid: $data_uid
computedAt: $data_computedAt
value: $data_value
faros_MetricDefinition: {
data: {
uid: $data_definition
}
on_conflict: {constraint: faros_MetricDefinition_pkey, update_columns:refreshedAt}
}
origin: $data_origin
}
on_conflict: {
constraint: faros_MetricValue_pkey
update_columns: [
computedAt
value
definition
origin
refreshedAt
]
}
) {
id
}
}
34 changes: 34 additions & 0 deletions init/resources/hasura/endpoints/faros_metric_value_tag.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
mutation insert_faros_metric_value_tag(
$data_value_uid: String!
$data_value_definition_uid: String!
$data_tag_id: String!
$data_origin: String
) {
insert_faros_MetricValueTag_one(
object: {
faros_Tag: {
data: {
uid: $data_tag_id
}
on_conflict: {constraint: faros_Tag_pkey, update_columns: refreshedAt}
}
faros_MetricValue: {
data: {
uid: $data_value_uid
definition: $data_value_definition_uid
}
on_conflict: {constraint: faros_MetricValue_pkey, update_columns: refreshedAt}
}
origin: $data_origin
}
on_conflict: {
constraint: faros_MetricValueTag_pkey
update_columns: [
origin
refreshedAt
]
}
) {
id
}
}
26 changes: 26 additions & 0 deletions init/resources/hasura/endpoints/faros_tag.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
mutation insert_faros_tag(
$data_uid: String!
$data_key: String!
$data_value: String!
$data_origin: String
) {
insert_faros_Tag_one(
object: {
uid: $data_uid
key: $data_key
value: $data_value
origin: $data_origin
}
on_conflict: {
constraint: faros_Tag_pkey
update_columns: [
key
value
origin
refreshedAt
]
}
) {
id
}
}
39 changes: 39 additions & 0 deletions init/resources/hasura/endpoints/survey_question.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
mutation insert_survey_question(
$data_uid: String!
$data_question: String
$data_response_category: String
$data_response_detail: String
$data_question_category: String
$data_question_detail: String
$data_source: String!
$data_origin: String!
) {
insert_survey_Question_one(
object: {
uid: $data_uid
question: $data_question
responseType: {
category: $data_response_category
detail: $data_response_detail
}
questionCategory: {
category: $data_question_category
detail: $data_question_detail
}
source: $data_source
origin: $data_origin
}
on_conflict: {
constraint: survey_Question_pkey
update_columns: [
question
responseType
questionCategory
origin
refreshedAt
]
}
) {
id
}
}
47 changes: 47 additions & 0 deletions init/resources/hasura/endpoints/survey_question_response.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
mutation insert_survey_question_response(
$data_uid: String!
$data_origin: String!
$data_submitted_at: timestamptz
$data_response: String
$data_survey_uid: String
$data_survey_source: String
$data_question_uid: String
$data_question_source:String
) {
insert_survey_QuestionResponse_one(
object: {
uid: $data_uid
submittedAt: $data_submitted_at
response: $data_response
survey_SurveyQuestionAssociation: {
data: {
survey_Survey: {
data: {
uid: $data_survey_uid
source: $data_survey_source
}
on_conflict: {constraint: survey_Survey_pkey, update_columns: refreshedAt}
}
survey_Question: {
data: {
uid: $data_question_uid
source: $data_question_source
}
on_conflict: {constraint: survey_Question_pkey, update_columns: refreshedAt}
}
}
on_conflict: {constraint: survey_SurveyQuestionAssociation_pkey, update_columns: refreshedAt}
}
origin: $data_origin
}
on_conflict: {
constraint: survey_QuestionResponse_pkey
update_columns: [
origin
refreshedAt
]
}
) {
id
}
}
32 changes: 32 additions & 0 deletions init/resources/hasura/endpoints/survey_survey.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
mutation insert_survey_survey(
$data_uid: String!
$data_name: String
$data_type_category: String
$data_type_detail: String
$data_source: String!
$data_origin: String
) {
insert_survey_Survey_one(
object: {
uid: $data_uid
name: $data_name
type: {
category: $data_type_category
detail: $data_type_detail
}
source: $data_source
origin: $data_origin
}
on_conflict: {
constraint: survey_Survey_pkey
update_columns: [
name
type
origin
refreshedAt
]
}
) {
id
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
mutation insert_survey_question(
$data_survey_uid: String!
$data_survey_source: String!
$data_question_uid: String!
$data_question_source: String!
$data_origin: String!
) {
insert_survey_SurveyQuestionAssociation_one(
object: {
survey_Survey: {
data: {
uid: $data_survey_uid
source: $data_survey_source
}
on_conflict: {constraint: survey_Survey_pkey, update_columns: refreshedAt}
}
survey_Question: {
data: {
uid: $data_question_uid
source: $data_question_source
}
on_conflict: {constraint: survey_Question_pkey, update_columns: refreshedAt}
}
origin: $data_origin
}
on_conflict: {
constraint: survey_SurveyQuestionAssociation_pkey
update_columns: [
origin
refreshedAt
]
}
) {
id
}
}
6 changes: 6 additions & 0 deletions init/resources/hasura/endpoints/vcs_pull_request.gql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ mutation insert_vcs_pull_request(
$data_merge_commit_sha: String!
$data_pull_request_create_time: timestamptz!
$data_pull_request_merge_time: timestamptz!
$data_pull_request_lines_added: Int
$data_pull_request_lines_deleted: Int
$data_pull_request_repository: String!
$data_pull_request_organization: String!
$data_pull_request_source: String!
Expand All @@ -16,6 +18,10 @@ mutation insert_vcs_pull_request(
state: $data_pull_request_state
createdAt: $data_pull_request_create_time
mergedAt: $data_pull_request_merge_time
diffStats: {
linesAdded: $data_pull_request_lines_added
linesDeleted: $data_pull_request_lines_deleted
}
vcs_User: {
data: {
uid: $data_pull_request_author
Expand Down
Loading

0 comments on commit 578adcb

Please sign in to comment.