Skip to content

Commit

Permalink
Merge branch 'master' into join-which-na
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki committed Dec 9, 2023
2 parents 32fcdc1 + f37f8e9 commit 4c1feb6
Show file tree
Hide file tree
Showing 206 changed files with 18,124 additions and 10,345 deletions.
18 changes: 16 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
.dir-locals.el
^\.Rprofile$
^data\.table_.*\.tar\.gz$
^vignettes/plots/figures$
^\.Renviron$
^[^/]+\.R$
^[^/]+\.csv$
^[^/]+\.csvy$
^[^/]+\.RDS$
^[^/]+\.diff$
^[^/]+\.patch$

^\.ci$
^\.dev$
^\.devcontainer$
^\.graphics$
^\.github$

^\.travis\.yml$
^\.appveyor\.yml$
^\.gitlab-ci\.yml$

^Makefile$
^NEWS\.0\.md$
^README\.md$
^NEWS\.1\.md$
^_pkgdown\.yml$
^src/Makevars$
^CODEOWNERS$

^\.RData$
^\.Rhistory$
Expand All @@ -25,8 +34,13 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.idea$
^\.libs$

^.*\.dll$

^bus$
^pkgdown$
^docs$
^lib$
^library$
^devwd$
2 changes: 0 additions & 2 deletions .Rprofile

This file was deleted.

13 changes: 5 additions & 8 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,20 @@ environment:
global:
CRAN: http://cloud.r-project.org
WARNINGS_ARE_ERRORS: 1
R_CHECK_ARGS: --no-manual
# R_CHECK_ARGS specified in order to turn off --as-cran (on by default) as that can be slow
R_ARCH: x64
# multiarch is on by default which runs tests on both 32bit R and 64bit R in one x64 job; i.e. very nice and convenient for all.
# The default for R_ARCH is i386, though, for which multiarch would just compile and test 32bit, hence setting R_ARCH to x64
GCC_PATH: mingw_64
# Default GCC_PATH appears to be gcc-4.6.3 which is now unsupported as from Rtools.exe v3.4.
R_CHECK_ARGS: --as-cran --no-manual
# --no-manual to avoid error 'pdflatex is not available'
# --as-cran no longer a lot slower (now takes under 6 mins with and without); logs show _R_CHECK_CRAN_INCOMING_=FALSE which could take 5+ mins
_R_CHECK_NO_STOP_ON_TEST_ERROR_: true
# continue tests even if some script failed
_R_CHECK_TESTS_NLINES_: 0
# Block truncation of any error messages in R CMD check
# R is 64-bit only on Windows from 4.2.0 (prior default was build and test both 32bit and 64bit) so we no longer use R_ARCH to pick one to reduce CI time in PRs

matrix:

- R_VERSION: release # the single Windows.zip binary (both 32bit/64bit) that users following dev version of installation instructions should click

# - R_VERSION: devel # When off it's to speed up dev cycle; R-devel is still checked but by GLCI on a roughly hourly cycle.
# - R_VERSION: devel # Never turn back on. GLCI after merge covers latest daily R-devel very well, so we shouldn't confuse and slow down PR dev cycle by measuring PRs against daily R-devel too. If a change in R-devel yesterday breaks the PR, it's very unlikely to be due to something in the PR. So we should accept the PR if it passes R-release and fix separately anything related to R-devel which we'll see from GLCI.

before_build:
- cmd: ECHO no Revision metadata added to DESCRIPTION
Expand Down
9 changes: 0 additions & 9 deletions .ci/Dockerfile.in

This file was deleted.

65 changes: 22 additions & 43 deletions .ci/README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,50 @@
# data.table continuous integration and deployment

On each Pull Request opened in GitHub we run Travis CI and Appveyor to provide prompt feedback about the status of PR. Our main CI pipeline runs on GitLab CI. GitLab repository automatically mirrors our GitHub repository and runs pipeline on `master` branch. It tests more environments and different configurations. It publish variety of artifacts. Windows jobs are being run on our private windows CI runner.
On each Pull Request opened in GitHub we run GitHub Actions test jobs to provide prompt feedback about the status of PR. Our main CI pipeline runs on GitLab CI nightly. GitLab repository automatically mirrors our GitHub repository and runs pipeline on `master` branch every night. It tests more environments and different configurations. It publish variety of artifacts.

## Environments

### [GitLab CI](./../.gitlab-ci.yml)

Test jobs:
- `test-rel-lin` - `r-release` on Linux, most comprehensive test environment, `-O3 -flto -fno-common -Wunused-result`, extra check for no compilation warnings, includes testing [_with other packages_](./../inst/tests/other.Rraw) ([extended suggests](./../inst/tests/tests-DESCRIPTION))
- `test-rel-cran-lin` - `--as-cran` on Linux, `-g0`, extra check for final status of `R CMD check` where we allow one NOTE (_size of tarball_).
- `test-dev-cran-lin` - `r-devel` and `--as-cran` on Linux, `--enable-strict-barrier --disable-long-double`
- `test-rel-vanilla-lin` - `r-release` on Linux, no suggested deps, no OpenMP, `-O0`, tracks memory usage during tests
- `test-310-cran-lin` - R 3.1.0 on Linux
- `test-344-cran-lin` - R 3.4.4 on Linux
- `test-350-cran-lin` - R 3.5.0 on Linux, no `r-recommended`
- `test-rel-win` - `r-release` on Windows
- `test-dev-win` - `r-devel` on Windows
- `test-rel-osx` - MacOSX build not yet deployed, see [#3326](https://github.com/Rdatatable/data.table/issues/3326) for status
- `test-lin-rel` - `r-release` on Linux, most comprehensive test environment, force all suggests, `-O3 -flto=auto -fno-common -Wunused-result`, test for no compilation warnings.
- `test-lin-rel-vanilla` - `r-release` on Linux, no suggested deps, no zlib, no OpenMP, flags `-g -O0 -fno-openmp`, skip manual and vignettes.
- `test-lin-rel-cran` - `--as-cran` on Linux, strict test for final status of `R CMD check`.
- `test-lin-dev-gcc-strict-cran` - `--as-cran` on Linux, `r-devel` built with `-enable-strict-barrier --disable-long-double`, test for compilation warnings, test for new NOTEs/WARNINGs from `R CMD check`.
- `test-lin-dev-clang-cran` - same as `gcc-strict` job but R built with `clang` and no `--enable-strict-barrier --disable-long-double` flags.
- `test-lin-310-cran` - R 3.1.0 on Linux, stated R dependency version.
- `test-win-rel` - `r-release` on Windows.
- `test-win-dev` - `r-devel` on Windows.
- `test-win-old` - `r-oldrel` on Windows.
- `test-mac-rel` - macOS build not yet available, see [#3326](https://github.com/Rdatatable/data.table/issues/3326) for status

Tests jobs are allowed to fail, summary and logs of test jobs are later published at _CRAN-like checks_ page, see artifacts below.

Artifacts:
- [homepage](https://rdatatable.gitlab.io/data.table) - made with [pkgdown](https://github.com/r-lib/pkgdown)
- [html manual](https://rdatatable.gitlab.io/data.table/library/data.table/html/00Index.html)
- [pdf manual](https://rdatatable.gitlab.io/data.table/web/packages/data.table/data.table.pdf)
- [html vignettes](https://rdatatable.gitlab.io/data.table/library/data.table/doc/index.html)
- R packages repository for `data.table` and all _Suggests_ dependencies, url: `https://Rdatatable.gitlab.io/data.table`
- R packages repository for `data.table` and all _Suggests_ dependencies, url: `https://rdatatable.gitlab.io/data.table`
- sources
- Windows binaries for `r-release` and `r-devel`
- Windows binaries for `r-release`, `r-devel` and `r-oldrel`
- [CRAN-like homepage](https://rdatatable.gitlab.io/data.table/web/packages/data.table/index.html)
- [CRAN-like checks results](https://rdatatable.gitlab.io/data.table/web/checks/check_results_data.table.html) - note that all artifacts, including this page, are being published only when all test jobs successfully pass, thus one will not see an _ERROR_ status there (unless `allow_failure` option has been used in a job).
- [docker images](https://gitlab.com/Rdatatable/data.table/container_registry) - copy/paste-able `docker pull` commands can be found at the bottom of our [CRAN-like homepage](https://rdatatable.gitlab.io/data.table/web/packages/data.table/index.html)
- [CRAN-like checks results](https://rdatatable.gitlab.io/data.table/web/checks/check_results_data.table.html)

### [Travis CI](./../.travis.yml)
### [GitHub Actions](./../.github/workflows)

Test jobs:
- `r-release` on Linux, includes code coverage check
- _(might be disabled)_ `r-release` on OSX

Artifacts:
- R packages repository having `data.table` sources only, url: `https://Rdatatable.github.io/data.table`
- code coverage stats pushed to [codecov.io/gh/Rdatatable/data.table](https://codecov.io/gh/Rdatatable/data.table)
TODO document

### [Appveyor](./../.appveyor.yml)

Test jobs:
- Windows `r-release`
- _(might be disabled)_ Windows `r-devel`

Artifacts:
- Windows `r-release` binaries accessed only via web UI
TODO document

## Tools
## CI tools

### [`ci.R`](./ci.R)

Base R implemented helper script, [originally proposed to R](https://svn.r-project.org/R/branches/tools4pkgs/src/library/tools/R/packages.R), that ease the process of extracting dependency information from description files, also to mirror packages and their recursive dependencies from CRAN to local CRAN-like directory. It is widely used in our [GitLab CI pipeline](./../.gitlab-ci.yml).
Base R implemented helper script, [originally proposed to base R](https://svn.r-project.org/R/branches/tools4pkgs/src/library/tools/R/packages.R), that ease the process of extracting dependency information from description files, and to mirror packages and their recursive dependencies from CRAN to local CRAN-like directory. It is used in [GitLab CI pipeline](./../.gitlab-ci.yml).

### [`publish.R`](./publish.R)

Base R implemented helper script to orchestrate generation of most artifacts. It is being used only in [_integration_ stage in GitLab CI pipeline](./../.gitlab-ci.yml).

### [`Dockerfile.in`](./Dockerfile.in)

Template file to produce `Dockerfile` for, as of now, three docker images. Docker images are being built and published in [_deploy_ stage in GitLab CI pipeline](./../.gitlab-ci.yml).
- `r-base-dev` using `r-release`: publish docker image of `data.table` on R-release
- `r-builder` using `r-release`: publish on R-release and OS dependencies for building Rmarkdown vignettes
- `r-devel`: publish docker image of `data.table` on R-devel

### [`deploy.sh`](./deploy.sh)

Script used on Travis CI to publish CRAN-like repository of `data.table` sources. It publishes to `gh-pages` branch in GitHub repository. It depends on a token, which is provided based on `secure` environment variable in [.travis.yml](./../.travis.yml). It has been generated by @jangorecki.
Base R implemented helper script to orchestrate generation of most artifacts and to arrange them nicely. It is being used only in [_integration_ stage in GitLab CI pipeline](./../.gitlab-ci.yml).
49 changes: 26 additions & 23 deletions .ci/ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
## added ver argument to produce R version independent urls
## https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17420
contrib.url <-
function (repos, type = getOption("pkgType"), ver)
function (repos, type = getOption("pkgType"), ver)
{
type <- utils:::resolvePkgType(type)
if (is.null(repos))
if (is.null(repos))
return(NULL)
if ("@CRAN@" %in% repos && interactive()) {
cat(gettext("--- Please select a CRAN mirror for use in this session ---"), "\n", sep = "")
Expand All @@ -17,12 +17,12 @@ function (repos, type = getOption("pkgType"), ver)
m <- match("@CRAN@", repos)
nm <- names(repos)
repos[m] <- getOption("repos")["CRAN"]
if (is.null(nm))
if (is.null(nm))
nm <- rep("", length(repos))
nm[m] <- "CRAN"
names(repos) <- nm
}
if ("@CRAN@" %in% repos)
if ("@CRAN@" %in% repos)
stop("trying to use CRAN without setting a mirror")
if(missing(ver)) {
ver <- paste(R.version$major, strsplit(R.version$minor, ".", fixed=TRUE)[[1L]][1L], sep = ".")
Expand All @@ -37,17 +37,18 @@ function (repos, type = getOption("pkgType"), ver)
res <- switch(
type,
source = paste(gsub("/$", "", repos), "src", "contrib", sep = "/"),
mac.binary = paste(gsub("/$", "", repos), "bin", mac.path, "contrib", ver, sep = "/"),
mac.binary = paste(gsub("/$", "", repos), "bin", mac.path, "contrib", ver, sep = "/"),
win.binary = paste(gsub("/$", "", repos), "bin", "windows", "contrib", ver, sep = "/")
)
res
}

## returns dependencies for a package based on its DESCRIPTION file
dcf.dependencies <-
function(file = "DESCRIPTION",
function(file = "DESCRIPTION",
which = NA,
except.priority = "base") {
except.priority = "base",
exclude = NULL) {
if (!is.character(file) || !length(file) || !all(file.exists(file)))
stop("file argument must be character of filepath(s) to existing DESCRIPTION file(s)")
if (!is.character(except.priority))
Expand All @@ -71,15 +72,21 @@ function(file = "DESCRIPTION",
}, which = which), use.names = FALSE)
local.extract_dependency_package_names = function (x) {
## do not filter out R like tools:::.extract_dependency_package_names, used for web/$pkg/index.html
if (is.na(x))
if (is.na(x))
return(character())
x <- unlist(strsplit(x, ",[[:space:]]*"))
x <- sub("[[:space:]]*([[:alnum:].]+).*", "\\1", x)
x[nzchar(x)]
}
x <- unlist(lapply(x, local.extract_dependency_package_names))
except <- if (length(except.priority)) c("R", unlist(tools:::.get_standard_package_names()[except.priority], use.names = FALSE))
setdiff(x, except)
x = setdiff(x, except)
if (length(exclude)) { # to exclude knitr/rmarkdown, 5294
if (!is.character(exclude) || anyDuplicated(exclude))
stop("exclude may be NULL or a character vector containing no duplicates")
x = setdiff(x, exclude)
}
x
}

## returns additional repositories for dependency packages based on its DESCRIPTION file
Expand All @@ -101,13 +108,13 @@ function(file = "DESCRIPTION") {
## download dependencies recursively for provided packages
## put all downloaded packages into local repository
mirror.packages <-
function(pkgs,
which = c("Depends", "Imports", "LinkingTo"),
repos = getOption("repos"),
type = c("source", "mac.binary", "win.binary"),
repodir,
except.repodir = repodir,
except.priority = "base",
function(pkgs,
which = c("Depends", "Imports", "LinkingTo"),
repos = getOption("repos"),
type = c("source", "mac.binary", "win.binary"),
repodir,
except.repodir = repodir,
except.priority = "base",
method,
quiet = TRUE,
binary.ver,
Expand Down Expand Up @@ -161,7 +168,7 @@ function(pkgs,
warning(sprintf("Packages binaries could not be found in provided reposistories for R version %s: %s", binary.ver, paste(newpkgs[!availpkgs], collapse = ", ")))
newpkgs <- newpkgs[availpkgs]
}

pkgsext <- switch(type,
"source" = "tar.gz",
"mac.binary" = "tgz",
Expand All @@ -171,14 +178,10 @@ function(pkgs,
unlink(dlfiles[file.exists(dlfiles)])
## repos argument is not used in download.packages, only as default for contriburl argument
## we provide contriburl to avoid interactive CRAN menu popup twice in mirror.packages
dp <- utils::download.packages(pkgs = newpkgs, destdir = destdir,
available = db, contriburl = repos.url,
dp <- utils::download.packages(pkgs = newpkgs, destdir = destdir,
available = db, contriburl = repos.url,
type = type, method = method, quiet = quiet)
tools::write_PACKAGES(dir = destdir, type = type, ...)
dp
}

## set repositories for CI tests
if (as.logical(Sys.getenv("GITLAB_CI","false")) && identical(Sys.getenv("CI_PROJECT_NAME"), "data.table")) {
options("repos" = if (.Platform$OS.type == "windows") file.path("file://",getwd(),"bus/mirror-packages/cran") else file.path("file:", normalizePath("bus/mirror-packages/cran", mustWork=FALSE)))
}
30 changes: 0 additions & 30 deletions .ci/deploy.sh

This file was deleted.

Loading

0 comments on commit 4c1feb6

Please sign in to comment.