jumpingrivers / intergrate Goto Github PK
View Code? Open in Web Editor NEWContinuous integration
Home Page: https://jumpingrivers.github.io/inteRgrate/
Continuous integration
Home Page: https://jumpingrivers.github.io/inteRgrate/
^[^/]+.R$
If the package has changed, then we should bump the version number
Version numbers don't need to be bumped for ignored files though
If the definition of a 'version' is a tag on the repo, then the definition of whether a given commit is a different 'version' is whether the version number of that commit is different from the version number of the previous tag, if it exists. If no tags exist, then it should be judged that there is no previous version with which to compare the version and the check should accept the version number.
https://github.com/jumpingrivers/inteRgrate/blob/master/R/check_version.R
When inteRgrate::check_all()
detects an issue which is later resolved, the "Issues Detected" message will continue to be displayed on subsequent calls to check_all
.
inteRgrate::check_all()
check_all
tests to fail. For the example results below, I changed the NEWS.md file to have an incorrect format.inteRgrate::check_all()
inteRgrate::check_all()
inteRgrate::check_all()
. Check through the results to confirm no errors other than the "Issues Detected" warning at the end.inteRgrate::check_all()
An output that changes is under the "Creating a tag...create_tag()" section where the output from the passing version is
ℹ No tagging: doesn't seem to be a CI process
but after failing and reverting to the original method, this is stuck on
ℹ No tagging: fix checking errors
Despite no checking errors being shown.
Output from a working and passing package check:
Restarting R session...
> inteRgrate::check_all()
── inteRgrate version 1.0.22 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
── Installing package ──
✔ checking for file ‘/tmp/RtmpMJTIaD/file8e3e5178dc1a/<package_name>/DESCRIPTION’
─ preparing ‘<package_name>’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘<package_name>_1.1.6.tar.gz’ (776ms)
Installing package into ‘/home/keith/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
* installing *source* package ‘<package_name>’ ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (<package_name>)
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘.../DESCRIPTION’ ...
─ preparing ‘<package_name>’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘<package_name>_1.1.6.tar.gz’ (803ms)
── R CMD check ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─ using log directory ‘/tmp/RtmpMJTIaD/file8e3e2b1b5db6/<package_name>.Rcheck’
─ using R version 4.2.0 (2022-04-22)
─ using platform: x86_64-pc-linux-gnu (64-bit)
─ using session charset: UTF-8
✔ checking for file ‘<package_name>/DESCRIPTION’ ...
─ checking extension type ... Package
─ this is package ‘<package_name>’ version ‘1.1.6’
─ package encoding: UTF-8
✔ checking package namespace information ...
✔ checking package dependencies (1.4s)
✔ checking if this is a source package ...
✔ checking if there is a namespace
✔ checking for executable files ...
✔ checking for hidden files and directories ...
✔ checking for portable file names
✔ checking for sufficient/correct file permissions
✔ checking whether package ‘<package_name>’ can be installed (808ms)
✔ checking installed package size ...
✔ checking package directory
✔ checking DESCRIPTION meta-information ...
✔ checking top-level files ...
✔ checking for left-over files
✔ checking index information
✔ checking package subdirectories ...
✔ checking R files for non-ASCII characters ...
✔ checking R files for syntax errors ...
✔ checking whether the package can be loaded ...
✔ checking whether the package can be loaded with stated dependencies ...
✔ checking whether the package can be unloaded cleanly ...
✔ checking whether the namespace can be loaded with stated dependencies ...
✔ checking whether the namespace can be unloaded cleanly ...
✔ checking loading without being on the library search path ...
✔ checking dependencies in R code ...
✔ checking S3 generic/method consistency (437ms)
✔ checking replacement functions ...
✔ checking foreign function calls ...
✔ checking R code for possible problems (571ms)
✔ checking Rd files ...
✔ checking Rd metadata ...
✔ checking Rd cross-references ...
✔ checking for missing documentation entries ...
✔ checking for code/documentation mismatches (461ms)
✔ checking Rd \usage sections (452ms)
✔ checking Rd contents ...
✔ checking for unstated dependencies in examples ...
✔ checking contents of ‘data’ directory (910ms)
✔ checking data for non-ASCII characters (949ms)
✔ checking data for ASCII and uncompressed saves ...
✔ checking examples (1.2s)
✔ checking PDF version of manual (579ms)
── Checking lint...check_lintr()
....
✔ Lint looks good
── Checking namespace for imports()...check_namespace()
✔ Imports look good - 0 found, 0 allowed
── Checking file extensions...check_r_filenames()
ℹ 3 R files found
✔ Extensions look good
✔ Filenames look good
── Checking version...check_version()
From gitlab.com:[redacted]/[redacted]/r/[redacted]-to-[redacted]
* branch main -> FETCH_HEAD
94b4bf7..417ff43 main -> origin/main
✔ Your version is fine!
── Checking .gitignore...check_gitignore()
✔ .gitignore looks good
── Checking tidy descriptions...check_tidy_descriptions()
✔ Setting active project to '/home/keith/[redacted]/[redacted]-intro/r_pkgs/<package_name>'
✔ Your description is tidy!
── Checking file permissions...check_file_permissions()
✔ File modes looks good
── Checking line breaks...check_line_breaks()
✔ Line breaks look good
── Creating a tag...create_tag()
ℹ No tagging: doesn't seem to be a CI process
── Checking NEWS.md...check_news()
✔ Your NEWS.md has the correct format
── Checking Rproj...check_rproj()
ℹ Reading <package_name>.Rproj
✔ Rproj looks good!
After modifying the NEWS file to have an incorrect header:
> inteRgrate::check_all()
── inteRgrate version 1.0.22 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
── Installing package ──
✔ checking for file ‘/tmp/RtmpMJTIaD/file8e3e5f8a2d15/<package_name>/DESCRIPTION’ ...
─ preparing ‘<package_name>’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘<package_name>_1.1.6.tar.gz’ (830ms)
Installing package into ‘/home/keith/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
* installing *source* package ‘<package_name>’ ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (<package_name>)
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘.../DESCRIPTION’ ...
─ preparing ‘<package_name>’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘<package_name>_1.1.6.tar.gz’ (826ms)
── R CMD check ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─ using log directory ‘/tmp/RtmpMJTIaD/file8e3e57f67323/<package_name>.Rcheck’
─ using R version 4.2.0 (2022-04-22)
─ using platform: x86_64-pc-linux-gnu (64-bit)
─ using session charset: UTF-8
✔ checking for file ‘<package_name>/DESCRIPTION’ ...
─ checking extension type ... Package
─ this is package ‘<package_name>’ version ‘1.1.6’
─ package encoding: UTF-8
✔ checking package namespace information ...
✔ checking package dependencies (3.2s)
✔ checking if this is a source package ...
✔ checking if there is a namespace
✔ checking for executable files ...
✔ checking for hidden files and directories ...
✔ checking for portable file names
✔ checking for sufficient/correct file permissions
✔ checking whether package ‘<package_name>’ can be installed (775ms)
✔ checking installed package size ...
✔ checking package directory
✔ checking DESCRIPTION meta-information ...
✔ checking top-level files ...
✔ checking for left-over files
✔ checking index information
✔ checking package subdirectories ...
✔ checking R files for non-ASCII characters ...
✔ checking R files for syntax errors ...
✔ checking whether the package can be loaded ...
✔ checking whether the package can be loaded with stated dependencies ...
✔ checking whether the package can be unloaded cleanly ...
✔ checking whether the namespace can be loaded with stated dependencies ...
✔ checking whether the namespace can be unloaded cleanly ...
✔ checking loading without being on the library search path ...
✔ checking dependencies in R code ...
✔ checking S3 generic/method consistency (393ms)
✔ checking replacement functions ...
✔ checking foreign function calls ...
✔ checking R code for possible problems (562ms)
✔ checking Rd files ...
✔ checking Rd metadata ...
✔ checking Rd cross-references ...
✔ checking for missing documentation entries ...
✔ checking for code/documentation mismatches (457ms)
✔ checking Rd \usage sections (454ms)
✔ checking Rd contents ...
✔ checking for unstated dependencies in examples ...
✔ checking contents of ‘data’ directory (887ms)
✔ checking data for non-ASCII characters (927ms)
✔ checking data for ASCII and uncompressed saves ...
✔ checking examples (1.2s)
✔ checking PDF version of manual (574ms)
── Checking lint...check_lintr()
....
✔ Lint looks good
── Checking namespace for imports()...check_namespace()
✔ Imports look good - 0 found, 0 allowed
── Checking file extensions...check_r_filenames()
ℹ 3 R files found
✔ Extensions look good
✔ Filenames look good
── Checking version...check_version()
From gitlab.com:[redacted]/[redacted]/r/[redacted]-to-[redacted]
* branch main -> FETCH_HEAD
✖ Please update the package version
── Checking .gitignore...check_gitignore()
✔ .gitignore looks good
── Checking tidy descriptions...check_tidy_descriptions()
✔ Your description is tidy!
── Checking file permissions...check_file_permissions()
✔ File modes looks good
── Checking line breaks...check_line_breaks()
✔ Line breaks look good
── Creating a tag...create_tag()
ℹ No tagging: fix checking errors
── Checking NEWS.md...check_news()
✖ Top line of NEWS.md not have correct format. It should be
# <package_name> 1.1.6 _2022-06-27_
── Checking Rproj...check_rproj()
ℹ Reading <package_name>.Rproj
✔ Rproj looks good!
✖ Issues Detected
Error in inteRgrate::check_all() : Please fix
After reverting the code back to working order, but in the same R session as the last check:
> inteRgrate::check_all()
── inteRgrate version 1.0.22 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
── Installing package ──
✔ checking for file ‘/tmp/RtmpMJTIaD/file8e3e40410a30/<package_name>/DESCRIPTION’ ...
─ preparing ‘<package_name>’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘<package_name>_1.1.6.tar.gz’ (790ms)
Installing package into ‘/home/keith/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
* installing *source* package ‘<package_name>’ ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (<package_name>)
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘.../DESCRIPTION’ ...
─ preparing ‘<package_name>’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘<package_name>_1.1.6.tar.gz’ (787ms)
── R CMD check ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─ using log directory ‘/tmp/RtmpMJTIaD/file8e3e16ead3f0/<package_name>.Rcheck’
─ using R version 4.2.0 (2022-04-22)
─ using platform: x86_64-pc-linux-gnu (64-bit)
─ using session charset: UTF-8
✔ checking for file ‘<package_name>/DESCRIPTION’ ...
─ checking extension type ... Package
─ this is package ‘<package_name>’ version ‘1.1.6’
─ package encoding: UTF-8
✔ checking package namespace information ...
✔ checking package dependencies (1.4s)
✔ checking if this is a source package ...
✔ checking if there is a namespace
✔ checking for executable files ...
✔ checking for hidden files and directories ...
✔ checking for portable file names
✔ checking for sufficient/correct file permissions
✔ checking whether package ‘<package_name>’ can be installed (776ms)
✔ checking installed package size ...
✔ checking package directory
✔ checking DESCRIPTION meta-information ...
✔ checking top-level files
✔ checking for left-over files
✔ checking index information
✔ checking package subdirectories ...
✔ checking R files for non-ASCII characters ...
✔ checking R files for syntax errors ...
✔ checking whether the package can be loaded ...
✔ checking whether the package can be loaded with stated dependencies ...
✔ checking whether the package can be unloaded cleanly ...
✔ checking whether the namespace can be loaded with stated dependencies ...
✔ checking whether the namespace can be unloaded cleanly ...
✔ checking loading without being on the library search path ...
✔ checking dependencies in R code ...
✔ checking S3 generic/method consistency (398ms)
✔ checking replacement functions ...
✔ checking foreign function calls ...
✔ checking R code for possible problems (553ms)
✔ checking Rd files ...
✔ checking Rd metadata ...
✔ checking Rd cross-references ...
✔ checking for missing documentation entries ...
✔ checking for code/documentation mismatches (447ms)
✔ checking Rd \usage sections (450ms)
✔ checking Rd contents ...
✔ checking for unstated dependencies in examples ...
✔ checking contents of ‘data’ directory (872ms)
✔ checking data for non-ASCII characters (927ms)
✔ checking data for ASCII and uncompressed saves ...
✔ checking examples (1.2s)
✔ checking PDF version of manual (553ms)
── Checking lint...check_lintr()
....
✔ Lint looks good
── Checking namespace for imports()...check_namespace()
✔ Imports look good - 0 found, 0 allowed
── Checking file extensions...check_r_filenames()
ℹ 3 R files found
✔ Extensions look good
✔ Filenames look good
── Checking version...check_version()
From gitlab.com:[redacted]/[redacted]/r/[redacted]-to-[redacted]
* branch main -> FETCH_HEAD
✔ Your version is fine!
── Checking .gitignore...check_gitignore()
✔ .gitignore looks good
── Checking tidy descriptions...check_tidy_descriptions()
✔ Your description is tidy!
── Checking file permissions...check_file_permissions()
✔ File modes looks good
── Checking line breaks...check_line_breaks()
✔ Line breaks look good
── Creating a tag...create_tag()
ℹ No tagging: fix checking errors
── Checking NEWS.md...check_news()
✔ Your NEWS.md has the correct format
── Checking Rproj...check_rproj()
ℹ Reading <package_name>.Rproj
✔ Rproj looks good!
✖ Issues Detected
Error in inteRgrate::check_all() : Please fix
Checking tidy descriptions...check_tidy_descriptions()
Should be
Checking tidy description...check_tidy_description()
inteRgrate/R/check_tidy_description.R
Line 24 in a0b6b3b
See https://gitlab.com/jr-cloud/training/welcome-page/-/blob/master/.gitlab-ci.yml#L45
Create file pkgdown/extra.css
before running pkgdown::build_site()
Suggested contents:
.template-news h1 em {
color: #999;
font-size: .8em;
font-style: normal;
}
.template-news h1 em::before {
content: " - ";
}
Perhaps add to /inst
for easy copying?
Adding internal package data with usethis::use_data(..., internal = TRUE)
creates R/sysdata.rda.
inteRgrate::check_lintr()
runs inteRgrate:::readLines()
on all files in R/ (check_lintr.R lines 57--58) and throws a warning for no newline at end of file for sysdata.rda file. I could be wrong but I don't think this can/should be fixed directly.
Adding to .lintr exclusions doesn't work in this instance since the code is applied to all files in the R directory regardless.
Suggest perhaps modify line 57 to include .lintr exclusions/include only *.R files?
The description of the check_news.R
function states:
the expected format is either: (...) or \code{# pkg_name _(development version)_}
However, the function actually checks the pattern # pkg_name (development version)
. (No underscores)
The check should:
And I wouldn't be offended if this only runs when the committer is Windows, because potentially scanning all files is a waste for most people.
Current githook:
Change to "check"
Create standard environment variables under travis/gitlab
I think the current code will fail to check version correctly if the central branch is called "main" rather than "master"
Line 13 in 6b3f236
Configure with e.g., DEPLOY_PKGDOWN=true
Run after tagging?
Build pkgdown in CI task
Use Connect app API to create or identify existing app
Update Connect custom URL with API
Use Connect bundle deployment API to push new tar file (https://rstudio.github.io/connectapi/#deployment)
Provide Makefile
and manifest.json
to be stored in e.g., ~/docs
directory of original source of package?
Use Connect app API to create or identify existing app
Update Connect custom URL with API
Trigger git deploy or rebuild on Connect using API
Create/update a dedicated branch for pkdown documentation, like gh-pages
[optional] trigger initial Connect deployment or forced update
https://github.com/ropenscilabs/tic.package
help? (uses dedicated branch)packageVersion("inteRgrate")
for useful feedback
See https://github.com/r-lib/usethis/search?q=git_global_ignore&unscoped_q=git_global_ignore
and
# History files
.Rhistory
.Rapp.history
# Session Data files
.RData
# Example code in package build process
*-Ex.R
# Output files from R CMD build
/*.tar.gz
# Output files from R CMD check
/*.Rcheck/
# RStudio files
.Rproj.user/
# produced vignettes
vignettes/*.html
vignettes/*.pdf
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth
# knitr and R markdown default cache directories
*_cache/
/cache/
# Temporary files created by R markdown
*.utf8.md
*.knit.md
# Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html
rsconnect/
Does an equivalent exist?
check_all = function() {
check_via_env(pkg = TRUE, lintr = TRUE, namespace = TRUE, r_filenames = TRUE,
version = TRUE, gitignore = TRUE, tidy_description = TRUE,
readme = TRUE, file_permissions = TRUE, line_breaks = TRUE, tag = FALSE)
}
I cannot run the code which you provide:
image: rocker/r-ubuntu:18.04
variables:
ALLOWED_WARNINGS: 0
ALLOWED_NOTES: 0
NO_IMPORTS: 0
before_script:
- Rscript -e "install.packages('remotes')"
- Rscript -e "remotes::install_github('jumpingrivers/inteRgrate')"
check:
script:
- Rscript -e "inteRgrate::check_via_env(default = 'true')"
It leaves me following error message:
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
ERROR: dependencies ‘lintr’, ‘rcmdcheck’, ‘usethis’ are not available for package ‘inteRgrate’
* removing ‘/usr/local/lib/R/site-library/inteRgrate’
There were 11 warnings (use warnings() to see them)
$ Rscript -e "inteRgrate::check_lintr(path = '.')"
Error in loadNamespace(x) : there is no package called ‘inteRgrate’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.