Skip to content

doc+ci: match ci and style with epipredict/epidatr #418

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

Merged
merged 25 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9885f70
doc+ci+repo: fix style and release guide
dshemetov Feb 16, 2024
6b325da
Update .github/workflows/pkgdown.yaml
dshemetov Mar 7, 2024
c16b98b
Update DEVELOPMENT.md
dshemetov Mar 7, 2024
219e04a
ci: add document, lint, style like epidatr
dshemetov Mar 5, 2024
b40f90f
ci: add doc string with workflow mods
dshemetov Mar 6, 2024
cbf4e44
ci: fix style indentation
dshemetov Mar 6, 2024
4a941d2
doc: improve release process wording
dshemetov Mar 7, 2024
aa52363
doc: add link to DEVELOPMENT.md in pull request template
dshemetov Mar 7, 2024
f89ecdd
ci: simplify pkgdown ref logic
dshemetov Mar 7, 2024
a48d82c
doc: transfer maintainer role from Ryan to Logan
dshemetov Mar 7, 2024
9143422
doc: add comments explaining pkgdown action
dshemetov Mar 7, 2024
1a0a885
doc: clarify DEVELOPMENT.md
dshemetov Mar 7, 2024
d6f3675
Merge pull request #425 from cmu-delphi/ds/ci
dshemetov Mar 7, 2024
6fd2e1f
ci: fix pkgdown
dshemetov Mar 7, 2024
b19921a
More color-blind friendly green
dsweber2 Mar 7, 2024
68c027b
repo: add to .Rbuildignore
dshemetov Mar 7, 2024
0c8144e
lint: increase lintr happiness
dshemetov Mar 7, 2024
9331e6e
ci: build README.rmd only if it exists
dshemetov Mar 7, 2024
eb55b8b
ci: build README.rmd only if it exists
dshemetov Mar 7, 2024
b1f0432
Merge branch 'dev' into ds/docs-style
dshemetov Mar 7, 2024
69e0228
repo: ignore linter commit in blame
dshemetov Mar 7, 2024
9256dd2
refactor+lint: remove unused functions, snake_case
dshemetov Mar 7, 2024
0f47808
lint: objects to dplyr perhaps too much
dsweber2 Mar 7, 2024
ae1f3ad
style: styler (GHA)
dsweber2 Mar 7, 2024
216f0e9
light searchbar
dsweber2 Mar 8, 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
25 changes: 13 additions & 12 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

Please:

- [ ] Make sure this PR is against "dev", not "main".
- [ ] Request a review from one of the current epiprocess main reviewers:
brookslogan, nmdefries.
- [ ] Makes sure to bump the version number in `DESCRIPTION` and `NEWS.md`.
Always increment the patch version number (the third number), unless you are
making a release PR from dev to main, in which case increment the minor
version number (the second number).
- [ ] Describe changes made in NEWS.md, making sure breaking changes
(backwards-incompatible changes to the documented interface) are noted.
Collect the changes under the next release number (e.g. if you are on
0.7.2, then write your changes under the 0.8 heading).
- [ ] Make sure this PR is against "dev", not "main" (unless this is a release
PR).
- [ ] Request a review from one of the current main reviewers:
brookslogan, nmdefries.
- [ ] Makes sure to bump the version number in `DESCRIPTION`. Always increment
the patch version number (the third number), unless you are making a
release PR from dev to main, in which case increment the minor version
number (the second number).
- [ ] Describe changes made in NEWS.md, making sure breaking changes
(backwards-incompatible changes to the documented interface) are noted.
Collect the changes under the next release number (e.g. if you are on
1.7.2, then write your changes under the 1.8 heading).

### Change explanations for reviewer

### Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch

- Resolves #{issue number}
- Resolves #{issue number}
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_dispatch:

name: R-CMD-check

Expand Down
33 changes: 22 additions & 11 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# Created with usethis + edited to run on PRs to dev, use API key.
# Edits from above workflow: also check pkgdown for PRs to `dev` branch, and
# update the documentation web site on pushes to `dev` branch.
on:
push:
branches: [dev, main]
branches: [main, dev]
pull_request:
branches: [dev, main]
branches: [main, dev]
release:
types: [published]
workflow_dispatch:
Expand All @@ -15,14 +16,14 @@ name: pkgdown

jobs:
pkgdown:
# only build docs on the main repository and not forks
if: github.repository_owner == 'cmu-delphi'
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIPROCESS_GHACTIONS_DELPHI_EPIDATA_KEY }}
steps:
- uses: actions/checkout@v3

Expand All @@ -34,19 +35,29 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
extra-packages: any::pkgdown, local::., any::cli
needs: website

- name: Build site
env:
DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIPROCESS_GHACTIONS_DELPHI_EPIDATA_KEY }}
run: |
if (startsWith("${{ github.event_name }}", "pull_request")) {
mode <- ifelse("${{ github.base_ref }}" == "main", "release", "devel")
override <- if (startsWith("${{ github.event_name }}", "pull_request")) {
if ("${{ github.base_ref }}" == "main") {
list(development = list(mode = "release", version_label = "light"))
} else {
list(development = list(mode = "devel", version_label = "success"))
}
} else {
mode <- ifelse("${{ github.ref_name }}" == "main", "release", "devel")
if ("${{ github.ref_name }}" == "main") {
list(development = list(mode = "release", version_label = "light"))
} else {
list(development = list(mode = "devel", version_label = "success"))
}
}
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, override=list(PKGDOWN_DEV_MODE=mode))
pkg <- pkgdown::as_pkgdown(".", override = override)
cli::cli_rule("Cleaning files from old site...")
pkgdown::clean_site(pkg)
pkgdown::build_site(pkg, preview = FALSE, install = FALSE, new_process = FALSE)
pkgdown:::build_github_pages(pkg)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/release-helper.yaml

This file was deleted.

60 changes: 42 additions & 18 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,62 @@ devtools::check() # check package for errors

## Developing the documentation site

The [documentation site](https://cmu-delphi.github.io/epidatr/) is built off of the `main` branch. The `dev` version of the site is available at https://cmu-delphi.github.io/epidatr/dev.
Our CI builds two version of the documentation:

The documentation site can be previewed locally by running in R
- https://cmu-delphi.github.io/epiprocess/ from the `main` branch and
- https://cmu-delphi.github.io/epiprocess/dev from the `dev` branch.

The documentation site can be previewed locally by running in R:

```r
# Should automatically open a browser
pkgdown::build_site(preview=TRUE)
```

The `main` version is available at `file:///<local path>/epidatr/docs/index.html` and `dev` at `file:///<local path>/epidatr/docs/dev/index.html`.
If the above does not open a browser, you can try using a Python server from the
command line:

You can also build the docs manually and launch the site with python. From the terminal, this looks like
```bash
R -e 'devtools::document()'
R -e 'pkgdown::build_site()'
python -m http.server -d docs
```

## Versioning

Please follow the guidelines in the PR template document (reproduced here):

- [ ] Make sure this PR is against "dev", not "main".
- [ ] Request a review from one of the current epiprocess main reviewers:
brookslogan, nmdefries.
- [ ] Makes sure to bump the version number in `DESCRIPTION` and `NEWS.md`.
Always increment the patch version number (the third number), unless you are
making a release PR from dev to main, in which case increment the minor
version number (the second number).
- [ ] Describe changes made in NEWS.md, making sure breaking changes
(backwards-incompatible changes to the documented interface) are noted.
Collect the changes under the next release number (e.g. if you are on
0.7.2, then write your changes under the 0.8 heading).
Please follow the guidelines in the [PR template document](.github/pull_request_template.md).

## Release process

TBD
Open a release issue and then copy and follow this checklist in the issue (modified from the checklist generated by `usethis::use_release_issue(version = "1.0.2")`):

- [ ] `git pull`
- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epiprocess.html)
- [ ] `devtools::check(".", manual = TRUE, env_vars = c(NOT_CRAN = "false"))`.
- Aim for 10/10, no notes.
- [ ] If check works well enough, merge to main. Otherwise open a PR to fix up.
- [ ] [Polish NEWS](https://github.com/cmu-delphi/epiprocess/blob/dev/NEWS.md).
- Some [guidelines](https://style.tidyverse.org/news.html#news-release).
- [ ] `git checkout main`
- [ ] `git pull`
- [ ] `urlchecker::url_check()`.
- This may choke on the MIT license url, and that's ok.
- [ ] `devtools::build_readme()`
- [ ] `devtools::check_win_devel()`
- [ ] Check email for problems
- [ ] `revdepcheck::revdep_check(num_workers = 4)`.
- This may choke, it is very sensitive to the binary versions of packages on a given system. Either bypass or ask someone else to run it if you're concerned.
- [ ] Update `cran-comments.md`
- [ ] PR with any changes

Submit to CRAN:

- [ ] `devtools::submit_cran()`
- [ ] Approve email

Wait for CRAN...

- [ ] Accepted :tada:
- [ ] `dev`
- [ ] `usethis::use_github_release(publish = FALSE)` (publish off, otherwise it won't push).
- [ ] check the release notes and publish the branch on github
166 changes: 87 additions & 79 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,100 @@
template:
bootstrap: 5
# Colors should stay consistent across epipredict, epiprocess, and epidatr,
# using Carnegie Red
# https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html

# This is to give a default value to the `mode` parameter in the
# `pkgdown::build_site` function. This is useful when building the site locally,
# as it will default to `devel` mode. In practice, this should all be handled
# dynamically by the CI/CD pipeline.
development:
mode: devel
version_label: success

template:
bootstrap: 5
bootswatch: cosmo
bslib:
font_scale: 1.0
primary: "#C41230"
link-color: "#C41230"

# Colors from epipredict & epidatr, including Carnegie Red https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html
navbar:
bg: "#C41230"
fg: "#f8f8f8"
bootswatch: cosmo
bslib:
font_scale: 1.0
primary: "#C41230"
link-color: "#C41230"
navbar-bg: "#C41230"
navbar-fg: "#f8f8f8"
bg: primary
type: dark

url: https://cmu-delphi.github.io/epiprocess/

home:
links:
- text: Introduction to Delphi's Tooling Work
href: https://cmu-delphi.github.io/delphi-tooling-book/
- text: Get the epipredict R package
href: https://cmu-delphi.github.io/epipredict/
- text: Get the epidatr R package
href: https://github.com/cmu-delphi/epidatr
- text: Get the epidatasets R package
href: https://cmu-delphi.github.io/epidatasets/
links:
- text: Introduction to Delphi's Tooling Work
href: https://cmu-delphi.github.io/delphi-tooling-book/
- text: Get the epipredict R package
href: https://cmu-delphi.github.io/epipredict/
- text: Get the epidatr R package
href: https://github.com/cmu-delphi/epidatr
- text: Get the epidatasets R package
href: https://cmu-delphi.github.io/epidatasets/

articles:
- title: Using the package
desc: Basic usage and examples.
navbar: ~
contents:
- epiprocess
- slide
- growth_rate
- correlation
- aggregation
- outliers
- archive
- advanced
- compactify
- title: Using the package
desc: Basic usage and examples.
navbar: ~
contents:
- epiprocess
- slide
- growth_rate
- correlation
- aggregation
- outliers
- archive
- advanced
- compactify

repo:
url:
home: https://github.com/cmu-delphi/epiprocess/tree/main/
source: https://github.com/cmu-delphi/epiprocess/blob/main/
issue: https://github.com/cmu-delphi/epiprocess/issues
user: https://github.com/
url:
home: https://github.com/cmu-delphi/epiprocess/tree/main/
source: https://github.com/cmu-delphi/epiprocess/blob/main/
issue: https://github.com/cmu-delphi/epiprocess/issues
user: https://github.com/

reference:
- title: "`epi_df` basics"
desc: Details on `epi_df` format, and basic functionality.
- contents:
- matches("epi_df")
- title: "`epi_*()` functions"
desc: Functions that act on `epi_df` objects.
- contents:
- epi_slide
- epi_cor
- title: Vector functions
desc: Functions that act directly on signal variables.
- contents:
- growth_rate
- detect_outlr
- detect_outlr_rm
- detect_outlr_stl
- title: "`epi_archive` basics"
desc: Details on `epi_archive`, and basic functionality.
- contents:
- matches("archive")
- title: "`epix_*()` functions"
desc: Functions that act on an `epi_archive` and/or `grouped_epi_archive` object.
- contents:
- starts_with("epix")
- group_by.epi_archive
- title: Example data
- contents:
- archive_cases_dv_subset
- incidence_num_outlier_example
- contains("jhu_csse")
- title: Basic automatic plotting
- contents:
- autoplot.epi_df
- title: internal
- contents:
- epiprocess
- max_version_with_row_in
- next_after
- guess_period
- key_colnames
- title: "`epi_df` basics"
desc: Details on `epi_df` format, and basic functionality.
- contents:
- matches("epi_df")
- title: "`epi_*()` functions"
desc: Functions that act on `epi_df` objects.
- contents:
- epi_slide
- epi_cor
- title: Vector functions
desc: Functions that act directly on signal variables.
- contents:
- growth_rate
- detect_outlr
- detect_outlr_rm
- detect_outlr_stl
- title: "`epi_archive` basics"
desc: Details on `epi_archive`, and basic functionality.
- contents:
- matches("archive")
- title: "`epix_*()` functions"
desc: Functions that act on an `epi_archive` and/or `grouped_epi_archive` object.
- contents:
- starts_with("epix")
- group_by.epi_archive
- title: Example data
- contents:
- archive_cases_dv_subset
- incidence_num_outlier_example
- contains("jhu_csse")
- title: Basic automatic plotting
- contents:
- autoplot.epi_df
- title: internal
- contents:
- epiprocess
- max_version_with_row_in
- next_after
- guess_period
- key_colnames
Loading