[codeface] Re: [PATCH 3/5] Allow mailing list analysis to run even if no vcs analysis

  • From: Wolfgang Mauerer <wolfgang.mauerer@xxxxxxxxxxxxxxxxx>
  • To: <codeface@xxxxxxxxxxxxx>, "Joblin, Mitchell (ext)" <mitchell.joblin.ext@xxxxxxxxxxx>
  • Date: Wed, 4 Nov 2015 23:50:35 +0100



Am 29/10/15 um 11:57 schrieb Mitchell Joblin:

- The global mail analysis does not really on release ranges
really _rely_?
so it should still be able to execute without them

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
---
codeface/R/ml/analysis.r | 33 +++++++++++++++++++--------------
codeface/R/query.r | 2 +-
2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/codeface/R/ml/analysis.r b/codeface/R/ml/analysis.r
index eb137b6..80b36d5 100644
--- a/codeface/R/ml/analysis.r
+++ b/codeface/R/ml/analysis.r
@@ -333,22 +333,27 @@ dispatch.all <- function(conf, repo.path, resdir) {
## Compute a list of intervals for the project release cycles
cycles <- get.cycles(conf)

- ## NOTE: We store the lubridate intervals in a list (instead of
- ## simply appending them to the cycles data frame) because they
- ## are coerced to numeric by the conversion to a data frame.
- release.intervals <- list(dim(cycles)[1])
- for (i in 1:(dim(cycles)[1])) {
- release.intervals[[i]] <- new_interval(cycles$date.start[[i]],
- cycles$date.end[[i]])
- }
+ if(nrow(cycles)!=0){
Coding style
+ ## NOTE: We store the lubridate intervals in a list (instead of
+ ## simply appending them to the cycles data frame) because they
+ ## are coerced to numeric by the conversion to a data frame.
+ release.intervals <- list(dim(cycles)[1])
+ for (i in 1:(dim(cycles)[1])) {
+ release.intervals[[i]] <- new_interval(cycles$date.start[[i]],
+ cycles$date.end[[i]])
+ }

- release.labels <- as.list(cycles$cycle)
+ release.labels <- as.list(cycles$cycle)

- ## The mailing list data may not cover the complete timeframe of
- ## the repository, so remove any empty intervals
- nonempty.release.intervals <- get.nonempty.intervals(dates,
release.intervals)
- release.intervals <- release.intervals[nonempty.release.intervals]
- release.labels <- release.labels[nonempty.release.intervals]
+ ## The mailing list data may not cover the complete timeframe of
+ ## the repository, so remove any empty intervals
+ nonempty.release.intervals <- get.nonempty.intervals(dates,
release.intervals)
+ release.intervals <- release.intervals[nonempty.release.intervals]
+ release.labels <- release.labels[nonempty.release.intervals]
+ }
+ else {
+ nonempty.release.intervals <- NULL
+ }

## Obtain a unique numerical ID for the mailing list (and clear
## any existing results on the way)
diff --git a/codeface/R/query.r b/codeface/R/query.r
index d30b749..720e9b9 100644
--- a/codeface/R/query.r
+++ b/codeface/R/query.r
@@ -129,7 +129,7 @@ get.cycles.con <- function(con, pid, boundaries=FALSE) {
"FROM revisions_view ",
"WHERE projectId=", pid))
if (nrow(res) == 0) {
- stop(paste("No release range found for projectId=", pid))
+ logwarn(paste("No release range found for projectId=", pid))

please add some information that the mailing list analysis is run
nonetheless -- otherwise, users might not know what the point of
the warning is.

Reviewed-by: Wolfgang Mauerer <wolfgang.mauerer@xxxxxxxxxxxxxxxxx>


}

colnames(res) <- gsub("_", ".", colnames(res))


Other related posts: