Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding commit-interactions #252

Merged
merged 38 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d82857f
Add commit-interaction data functionality
Leo-Send Feb 12, 2024
b4fd2a2
Add functionality for equals function
Leo-Send Feb 12, 2024
b3394ee
Remove outdated comment int 'util-read.R'
Leo-Send Feb 12, 2024
eeba7e2
Add test for new functionality of 'equals'
Leo-Send Feb 12, 2024
8bb39f4
Add test for new read functionality
Leo-Send Feb 12, 2024
54b6f65
Add test data files with commit interactions
Leo-Send Feb 12, 2024
7a5497a
Add test for reading empty commit-interactions data
Leo-Send Feb 14, 2024
7b8585f
Add test for change in set.commits
Leo-Send Feb 14, 2024
d7dc713
Add comments for update.commit.interactions
Leo-Send Feb 20, 2024
f25632c
Change indexes for 'match' calls
Leo-Send Feb 20, 2024
8fcc6d5
Fix test to correctly check for inequality
Leo-Send Feb 20, 2024
9117be8
Change colnames used for empty commit-interactions
Leo-Send Feb 20, 2024
49acd59
Remove previously added columns to avoid duplication
Leo-Send Feb 20, 2024
3efb38b
Change merge in 'update.commit.interactions'
Leo-Send Feb 27, 2024
099a096
Add additional columns to commit-interactions
Leo-Send Feb 27, 2024
6f73cff
Change test to reflect change to dataframe columns
Leo-Send Feb 27, 2024
fd0aa05
Add 'cleanup.commit.interactions' function
Leo-Send Feb 27, 2024
ef72540
Add test for cleanup function
Leo-Send Feb 27, 2024
7068cfa
Add test for author network
Leo-Send Mar 5, 2024
329d97e
Change 'util-networks.R' to use colnames
Leo-Send Mar 5, 2024
07e7ed7
Add tests for artifact networks
Leo-Send Mar 5, 2024
dbd07e9
Fix artifact network construction
Leo-Send Mar 5, 2024
169dbfe
Change tests for artifact networks
Leo-Send Mar 8, 2024
8736025
Change vertex kind for artifact networks
Leo-Send Mar 8, 2024
a924e86
Add commits to 'NEWS.md'
Leo-Send Mar 12, 2024
48d9de1
Change warning to use 'logging::logwarn'
Leo-Send Mar 13, 2024
91b9c3b
Fix issues pointed out on PR comments
Leo-Send Mar 19, 2024
8d4965a
Change call to 'read_yaml'
Leo-Send Mar 20, 2024
1addce9
Change to adress comments by @bockthom
Leo-Send Apr 4, 2024
1335965
Add global variable and change function names
Leo-Send Apr 5, 2024
8ce1f07
Change tests to match new function names
Leo-Send Apr 5, 2024
7c92b72
Fix typos and change data frame access
Leo-Send Apr 10, 2024
bc49386
Change NEWS.md with new commit hashes after rebase
Leo-Send Apr 10, 2024
bca3576
Add Configuration for filtering commit interactions
Leo-Send Apr 18, 2024
f8ea987
Add helper function for prefixing function names
Leo-Send Apr 18, 2024
7d8be96
Change 'NEWS.md' to include new commits
Leo-Send Apr 18, 2024
b8857cf
Change some comments and variable names
Leo-Send Apr 23, 2024
ee54b1a
Add missing copyright headers
Leo-Send Apr 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ There is no way to update the entries, except for the revision-based parameters.
- `commit.interactions`:
* Allow construction of author and artifact networks using commit-interaction data
* [`TRUE`, *`FALSE`*]
- `filter.commit.interactions`:
Leo-Send marked this conversation as resolved.
Show resolved Hide resolved
* Filter out entries from commit interaction data that are not matched to a specific function or file
Leo-Send marked this conversation as resolved.
Show resolved Hide resolved
* [*`TRUE`*, `FALSE`]

### NetworkConf

Expand Down
5 changes: 5 additions & 0 deletions tests/test-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ test_that("Compare two ProjectData Objects with commit.interactions", {
proj.conf$update.value("commit.interactions", TRUE)
proj.conf$update.value("commits.filter.untracked.files", FALSE)
proj.conf$update.value("commits.filter.base.artifact", FALSE)
proj.conf$update.value("filter.commit.interactions", FALSE)

proj.data.one = ProjectData$new(project.conf = proj.conf)
proj.data.two = proj.data.one$clone(deep = TRUE)
Expand Down Expand Up @@ -588,4 +589,8 @@ test_that("Compare two ProjectData Objects with commit.interactions", {
commit.interactions.data.expected[["base.file"]] = c("test2.c", "test2.c", "test3.c", "test2.c")

expect_equal(proj.data.two$get.commit.interactions(), commit.interactions.data.expected)

## reactivate filtering of commit interactions
proj.data.two$set.project.conf.entry("filter.commit.interactions", TRUE)
expect_true(nrow(proj.data.two$get.commit.interactions()) == 2)
})
2 changes: 2 additions & 0 deletions tests/test-networks-artifact.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ patrick::with_parameters_test_that("Network construction with commit-interaction
proj.conf$update.value("commit.interactions", TRUE)
proj.conf$update.value("commits.filter.untracked.files", FALSE)
proj.conf$update.value("commits.filter.base.artifact", FALSE)
proj.conf$update.value("filter.commit.interactions", FALSE)
proj.data = ProjectData$new(project.conf = proj.conf)

net.conf = NetworkConf$new()
Expand Down Expand Up @@ -267,6 +268,7 @@ patrick::with_parameters_test_that("Network construction with commit-interaction
proj.conf$update.value("commit.interactions", TRUE)
proj.conf$update.value("commits.filter.untracked.files", FALSE)
proj.conf$update.value("commits.filter.base.artifact", FALSE)
proj.conf$update.value("filter.commit.interactions", FALSE)
proj.data = ProjectData$new(project.conf = proj.conf)

net.conf = NetworkConf$new()
Expand Down
1 change: 1 addition & 0 deletions tests/test-networks-author.R
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ patrick::with_parameters_test_that("Network construction with commit-interaction
proj.conf$update.value("commit.interactions", TRUE)
proj.conf$update.value("commits.filter.untracked.files", FALSE)
proj.conf$update.value("commits.filter.base.artifact", FALSE)
proj.conf$update.value("filter.commit.interactions", FALSE)
Leo-Send marked this conversation as resolved.
Show resolved Hide resolved
proj.data = ProjectData$new(project.conf = proj.conf)

net.conf = NetworkConf$new()
Expand Down
6 changes: 6 additions & 0 deletions util-conf.R
bockthom marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ ProjectConf = R6::R6Class("ProjectConf", inherit = Conf,
allowed = c(TRUE, FALSE),
allowed.number = 1
),
filter.commit.interactions = list(
default = TRUE,
type = "logical",
allowed = c(TRUE, FALSE),
allowed.number = 1
),
custom.event.timestamps.file = list(
default = NA,
type = "character",
Expand Down
5 changes: 5 additions & 0 deletions util-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,11 @@ ProjectData = R6::R6Class("ProjectData",
commit.interaction.data = read.commit.interactions(data.path)
}

## filter commit interactions if configured
if (private$project.conf$get.value("filter.commit.interactions")) {
commit.interaction.data = subset(commit.interaction.data,
file != COMMIT.INTERACTION.GLOBAL.FILE.FUNCTION.NAME)
}
## cache the result
private$commit.interactions = commit.interaction.data
private$update.commit.interactions()
Expand Down