1
0

updating commits for c1 with new specs

This commit is contained in:
Matthew Gaughan 2025-04-21 11:26:56 -07:00
parent 7c51725205
commit 52a09fe037
5 changed files with 93 additions and 12 deletions

View File

@ -82,3 +82,29 @@ mv core_2010-01-01_to_2024-12-31.csv mediawiki_core.csv
ls ls
mv mediawiki_core.csv mediawiki_core_commits.csv mv mediawiki_core.csv mediawiki_core_commits.csv
ls ls
cd ..
ls
cd case1
l;s
ls
mkdir 042125_stale_counts
mv en-testing_0312_extensions_ve_weekly_commit_count_data.csv 042125_stale_counts/
mv en-testing_0316_extensions_ve_weekly_commit_count_data.csv 042125_stale_counts/
mv wide-testing_0316_extensions_ve_weekly_commit_count_data.csv 042125_stale_counts/
mv wide-testing_0312_extensions_ve_weekly_commit_count_data.csv 042125_stale_counts/
mv event__0312_extensions_ve_weekly_commit_count_data.csv 042125_stale_counts/
mv event_0312_extensions_ve_weekly_commit_count_data.csv 042125_stale_counts/
mv event_0316_extensions_ve_weekly_commit_count_data.csv 042125_stale_counts/
mv event_0316_mediawiki_core_weekly_commit_count_data.csv 042125_stale_counts/
mv event_0314_mediawiki_core_weekly_commit_count_data.csv 042125_stale_counts/
mv event_0312_mediawiki_core_weekly_commit_count_data.csv 042125_stale_counts/
mv wide-testing_0312_mediawiki_core_weekly_commit_count_data.csv 042125_stale_counts/
mv wide-testing_0316_mediawiki_core_weekly_commit_count_data.csv 042125_stale_counts/
mv en-testing_0316_mediawiki_core_weekly_commit_count_data.csv 042125_stale_counts/
mv en-testing_0312_mediawiki_core_weekly_commit_count_data.csv 042125_stale_counts/
l
ls
mv event_0401_extensions_ve_weekly_commit_count_data.csv 042125_stale_commits/
mv event_0401_extensions_ve_weekly_commit_count_data.csv 042125_stale_counts/
mv event_0401_mediawiki_core_weekly_commit_count_data.csv 042125_stale_counts/
ls

BIN
0421-ve-commits.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
0421-ve-spike-commits.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 KiB

View File

@ -5,7 +5,7 @@ library(tidyr)
library(purrr) library(purrr)
library(stringr) library(stringr)
https_commit_fp <- "/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case3/mediawiki_core_commits.csv" https_commit_fp <- "/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/extensions_visualeditor_commits.csv"
contains_http_but_not_url <- function(text) { contains_http_but_not_url <- function(text) {
if (is.na(text)) { if (is.na(text)) {
@ -45,8 +45,8 @@ transform_commit_data <- function(filepath){
# TODO: this is project/event specific # TODO: this is project/event specific
event_date <- as.Date("2015-07-02") #event_date <- as.Date("2015-07-02")
#event_date <- as.Date("2013-07-01") event_date <- as.Date("2013-07-01")
#event_date <- as.Date("2013-04-25") #event_date <- as.Date("2013-04-25")
#event_date <- as.Date("2012-12-11") #event_date <- as.Date("2012-12-11")
@ -69,7 +69,7 @@ transform_commit_data <- function(filepath){
#drop out data from ''before'' the release process #drop out data from ''before'' the release process
df <- df |> df <- df |>
filter(commit_date >= as.Date("2015-04-01")) filter(commit_date >= as.Date("2012-11-11"))
#we are looking at weekly data, 6m before and 6m after #we are looking at weekly data, 6m before and 6m after
#start_date <- event_date %m-% months(6) #start_date <- event_date %m-% months(6)
@ -96,7 +96,7 @@ transform_commit_data <- function(filepath){
# list all author_emails with >5 commits # list all author_emails with >5 commits
# for big df: if author not in the list, 'new' author # for big df: if author not in the list, 'new' author
old_author_list <- df |> old_author_list <- df |>
filter(commit_date < as.Date("2015-06-01"))|> filter(commit_date < as.Date("2013-06-06"))|>
group_by(author_email) |> group_by(author_email) |>
summarise(commit_count = n()) |> summarise(commit_count = n()) |>
filter(commit_count > 5) |> filter(commit_count > 5) |>
@ -192,7 +192,7 @@ transform_commit_data <- function(filepath){
# ) |> # ) |>
weekly_commits <- weekly_commits |> weekly_commits <- weekly_commits |>
filter(relative_week >= (-14) & relative_week <= 52 ) filter(relative_week >= (-34) & relative_week <= 13 )
#gracefully exit #gracefully exit
return(weekly_commits) return(weekly_commits)
@ -364,7 +364,7 @@ transform_relevant_commit_data <- function(filepath){
} }
transformed <- transform_commit_data(https_commit_fp) transformed <- transform_commit_data(https_commit_fp)
output_filepath <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case3/event_0415_mediawiki_core_weekly_commit_count_data.csv" output_filepath <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/event_0421_extensions_ve_weekly_count.csv"
write.csv(transformed, output_filepath, row.names = FALSE) write.csv(transformed, output_filepath, row.names = FALSE)

View File

@ -1,20 +1,74 @@
library(tidyverse) library(tidyverse)
count_data_fp <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case3/event_0415_mediawiki_core_weekly_commit_count_data.csv" count_data_fp <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/event_0421_extensions_ve_weekly_count.csv"
input_df <- read.csv(count_data_fp, header = TRUE) input_df <- read.csv(count_data_fp, header = TRUE)
input_df$nonbot_commit_count <- input_df$commit_count - input_df$bot_commit_count input_df$nonbot_commit_count <- input_df$commit_count - input_df$bot_commit_count
input_df$unaff_commit_count <- input_df$nonbot_commit_count - input_df$wikimedia_commit_count
library(scales) library(scales)
library(ggplot2) library(ggplot2)
long_df <- input_df |> long_df <- input_df |>
tidyr::pivot_longer(cols = c(nonbot_commit_count, unaff_new_commit_count, wmf_new_commit_count), tidyr::pivot_longer(cols = c(nonbot_commit_count, unaff_commit_count, wikimedia_commit_count),
names_to = "commit_type", names_to = "commit_type",
values_to = "lengthened_commit_count") values_to = "lengthened_commit_count")
affiliationColors <- affiliationColors <-
setNames( c('black','#5da2d8', '#c7756a') setNames( c('black','#5da2d8', '#c7756a')
,c("nonbot_commit_count","unaff_new_commit_count", "wmf_new_commit_count")) ,c("nonbot_commit_count","unaff_commit_count", "wikimedia_commit_count"))
commit_authors <- long_df |>
ggplot(aes(x=relative_week,
y=lengthened_commit_count,
color=factor(commit_type))) +
geom_point() +
geom_line() +
labs(x = "Relative Week", y = "Commits", color="Commit Type") +
scale_color_manual(values = affiliationColors,
labels = c("nonbot_commit_count" = "Total Nonbot Commits",
"unaff_commit_count" = "Unaffiliated Commits",
"wikimedia_commit_count" = "WMF Commits")) +
ggtitle("Total VE Commits Around Opt-out Deployment By Affiliation") +
theme_bw() +
theme(legend.position = "top")
commit_authors
ggsave(filename = "0421-ve-commits.png", plot = commit_authors, width = 12, height = 9, dpi = 800)
# new affiliation things
# relative week >= -4
# new unaffiliated
# returning unaffiliated
input_df$returning_unaff_commit_count = input_df$unaff_commit_count - input_df$unaff_new_commit_count
new_authors_long_df <- input_df |>
filter(relative_week >= -4) |>
tidyr::pivot_longer(cols = c(unaff_new_commit_count, returning_unaff_commit_count),
names_to = "commit_seniority",
values_to = "lengthened_commit_count")
new_unaff_authors <- new_authors_long_df |>
ggplot(aes(x=relative_week,
y=lengthened_commit_count,
linetype=commit_seniority)) +
geom_point(color = '#5da2d8') +
geom_line(color='#5da2d8') +
labs(x = "Relative Week", y = "Commits", linetype="Commit Seniority ('New' contributors <= 5 commits before 06-06-2013)") +
scale_linetype_manual(
values = c("returning_unaff_commit_count" = "solid",
"unaff_new_commit_count" = "dotted"),
labels = c("returning_unaff_commit_count" = "Returning Contributors",
"unaff_new_commit_count" = "New Contributors")
) +
ggtitle("Unaffiliated VE Commits Surrounding Opt-out Deployment") +
theme_bw() +
theme(legend.position = "top")
new_unaff_authors
ggsave(filename = "0421-ve-spike-commits.png", plot = new_unaff_authors, width = 12, height = 9, dpi = 800)
new_authors <- long_df |> new_authors <- long_df |>
ggplot(aes(x=relative_week, ggplot(aes(x=relative_week,
@ -28,8 +82,9 @@ new_authors <- long_df |>
"unaff_new_commit_count" = "New Unaffiliated Commits", "unaff_new_commit_count" = "New Unaffiliated Commits",
"wmf_new_commit_count" = "New WMF Commits")) + "wmf_new_commit_count" = "New WMF Commits")) +
ggtitle("Total MW-core Commits Around HTTP-deprecation ('New' contributors <= 5 commits 04-01-2015 and 06-01-2015)") + ggtitle("Total MW-core Commits Around HTTP-deprecation ('New' contributors <= 5 commits 04-01-2015 and 06-01-2015)") +
theme_bw() + theme_bw()
theme(legend.position = "top") #+
#theme(legend.position = "top")
new_authors new_authors
ggsave(filename = "0403-https-core-event-new-commits.png", plot = new_authors, width = 12, height = 9, dpi = 800) ggsave(filename = "0403-https-core-event-new-commits.png", plot = new_authors, width = 12, height = 9, dpi = 800)