Get state transition open->proposal label

This commit is contained in:
Marcel Radzio 2022-10-30 01:07:25 +02:00
parent bbba4dbff7
commit 787fecc8af
2 changed files with 76 additions and 24 deletions

View File

@ -18,9 +18,10 @@ The following data is based purely on public knowledge. This means data is fetch
library(gh)
library(tidyverse)
library(hrbrthemes)
library(survminer)
import_roboto_condensed()
extrafont::loadfonts(device="win")
# import_roboto_condensed()
# extrafont::loadfonts(device = "win")
cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
```
@ -242,7 +243,34 @@ if (!exists("element_employee") || !exists("famedly_employee") || !exists("beepe
# Get times for state transitions
```{r message=FALSE, warning=FALSE, tidy = "styler"}
opened_to_proposal <- issues_gql_all
# Opened to Proposal transition
opened_to_proposal <- issues_gql_all |>
filter(!is.na(labels) && is.element("proposal", labels$name)) |>
select(title, author, createdAt, labels)
for (i in 1:length(opened_to_proposal$labels)) {
opened_to_proposal$labels[[i]] <- opened_to_proposal$labels[[i]] |>
rowwise() |>
filter(is.element("proposal", name))
}
opened_to_proposal <- opened_to_proposal |>
mutate(proposalAt = labels$createdAt) |>
select(title, author, createdAt, proposalAt)
opened_to_proposal <- opened_to_proposal |>
mutate(Company = case_when(
!is.null(author) && is.element(author, element_employee) ~ "Element",
!is.null(author) && is.element(author, sct_employee) ~ "SCT",
!is.null(author) && is.element(author, famedly_employee) ~ "Famedly",
!is.null(author) && is.element(author, beeper_employee) ~ "Beeper",
TRUE ~ "Other"
)) |>
group_by(Company)
# Proposal to having impl
# FIXME this doesnt work at this time as we dont know when the labels got removed. We need timelineItems() in the graphql query for this
# proposal_to_impl <- issues_gql_all |>
# filter(!is.na(labels) && is.element("proposal", labels$name)) |>
# select(title, author, createdAt)
```
# MSCs by Company (all kind)
@ -297,7 +325,6 @@ ggplot(data, aes(x = Company, y = Count)) +
xlab("") +
geom_text(
aes(label = Count),
vjust = 0.5,
hjust = 1.5,
colour = "white"
) +
@ -356,7 +383,6 @@ ggplot(data, aes(x = Company, y = Count)) +
xlab("") +
geom_text(
aes(label = Count),
vjust = 0.5,
hjust = 1.5,
colour = "white"
) +

View File

@ -25,9 +25,10 @@ is fetched from github and gitlab as best as I was able to.
library(gh)
library(tidyverse)
library(hrbrthemes)
library(survminer)
import_roboto_condensed()
extrafont::loadfonts(device = "win")
# import_roboto_condensed()
# extrafont::loadfonts(device = "win")
cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
```
@ -247,7 +248,34 @@ if (!exists("element_employee") || !exists("famedly_employee") || !exists("beepe
# Get times for state transitions
``` r
opened_to_proposal <- issues_gql_all
# Opened to Proposal transition
opened_to_proposal <- issues_gql_all |>
filter(!is.na(labels) && is.element("proposal", labels$name)) |>
select(title, author, createdAt, labels)
for (i in 1:length(opened_to_proposal$labels)) {
opened_to_proposal$labels[[i]] <- opened_to_proposal$labels[[i]] |>
rowwise() |>
filter(is.element("proposal", name))
}
opened_to_proposal <- opened_to_proposal |>
mutate(proposalAt = labels$createdAt) |>
select(title, author, createdAt, proposalAt)
opened_to_proposal <- opened_to_proposal |>
mutate(Company = case_when(
!is.null(author) && is.element(author, element_employee) ~ "Element",
!is.null(author) && is.element(author, sct_employee) ~ "SCT",
!is.null(author) && is.element(author, famedly_employee) ~ "Famedly",
!is.null(author) && is.element(author, beeper_employee) ~ "Beeper",
TRUE ~ "Other"
)) |>
group_by(Company)
# Proposal to having impl
# FIXME this doesnt work at this time as we dont know when the labels got removed. We need timelineItems() in the graphql query for this
# proposal_to_impl <- issues_gql_all |>
# filter(!is.na(labels) && is.element("proposal", labels$name)) |>
# select(title, author, createdAt)
```
# MSCs by Company (all kind)
@ -301,7 +329,6 @@ ggplot(data, aes(x = Company, y = Count)) +
xlab("") +
geom_text(
aes(label = Count),
vjust = 0.5,
hjust = 1.5,
colour = "white"
) +
@ -361,7 +388,6 @@ ggplot(data, aes(x = Company, y = Count)) +
xlab("") +
geom_text(
aes(label = Count),
vjust = 0.5,
hjust = 1.5,
colour = "white"
) +