Skip to content

Commit 9885f70

Browse files
committed
doc+ci+repo: fix style and release guide
* update with fixes from epidatr * update pull request template * bugfix pkgdown.yaml * add workflow_dispatch buttons to most actions * remove release_helper.yaml which we don't use * update the DEVELOPMENT.md guide with a release checklist * update pkgdown.yaml to match epidatr
1 parent fd2339d commit 9885f70

File tree

6 files changed

+165
-143
lines changed

6 files changed

+165
-143
lines changed

.github/pull_request_template.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22

33
Please:
44

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

1718
### Change explanations for reviewer
1819

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

21-
- Resolves #{issue number}
22+
- Resolves #{issue number}

.github/workflows/R-CMD-check.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches: [main, dev]
88
pull_request:
99
branches: [main, dev]
10+
workflow_dispatch:
1011

1112
name: R-CMD-check
1213

.github/workflows/pkgdown.yaml

+22-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
#
4-
# Created with usethis + edited to run on PRs to dev, use API key.
4+
# Edits from above workflow: also check pkgdown for PRs to `dev` branch, and
5+
# update the documentation web site on pushes to `dev` branch.
56
on:
67
push:
7-
branches: [dev, main]
8+
branches: [main, dev]
89
pull_request:
9-
branches: [dev, main]
10+
branches: [main, dev]
1011
release:
1112
types: [published]
1213
workflow_dispatch:
@@ -15,14 +16,14 @@ name: pkgdown
1516

1617
jobs:
1718
pkgdown:
18-
# only build docs on the main repository and not forks
1919
if: github.repository_owner == 'cmu-delphi'
2020
runs-on: ubuntu-latest
2121
# Only restrict concurrency for non-PR jobs
2222
concurrency:
2323
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
2424
env:
2525
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
26+
DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIPROCESS_GHACTIONS_DELPHI_EPIDATA_KEY }}
2627
steps:
2728
- uses: actions/checkout@v3
2829

@@ -34,19 +35,29 @@ jobs:
3435

3536
- uses: r-lib/actions/setup-r-dependencies@v2
3637
with:
37-
extra-packages: any::pkgdown, local::.
38+
extra-packages: any::pkgdown, local::., any::cli
3839
needs: website
3940

4041
- name: Build site
41-
env:
42-
DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIPROCESS_GHACTIONS_DELPHI_EPIDATA_KEY }}
4342
run: |
44-
if (startsWith("${{ github.event_name }}", "pull_request")) {
45-
mode <- ifelse("${{ github.base_ref }}" == "main", "release", "devel")
43+
override <- if (startsWith("${{ github.event_name }}", "pull_request")) {
44+
if ("${{ github.base_ref }}" == "main") {
45+
list(development = list(mode = "release", version_label = "light"))
46+
} else {
47+
list(development = list(mode = "devel", version_label = "success"))
48+
}
4649
} else {
47-
mode <- ifelse("${{ github.ref_name }}" == "main", "release", "devel")
50+
if ("${{ github.ref_name }}" == "main") {
51+
list(development = list(mode = "release", version_label = "light"))
52+
} else {
53+
list(development = list(mode = "devel", version_label = "success"))
54+
}
4855
}
49-
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, override=list(PKGDOWN_DEV_MODE=mode))
56+
pkg <- pkgdown::as_pkgdown(".", override = override)
57+
cli::cli_rule("Cleaning files from old site...")
58+
pkgdown::clean_site(pkg)
59+
pkgdown::build_site(pkg, preview = FALSE, install = FALSE, new_process = FALSE)
60+
pkgdown:::build_github_pages(pkg)
5061
shell: Rscript {0}
5162

5263
- name: Deploy to GitHub pages 🚀

.github/workflows/release-helper.yaml

-23
This file was deleted.

DEVELOPMENT.md

+42-18
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,62 @@ devtools::check() # check package for errors
1919

2020
## Developing the documentation site
2121

22-
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.
22+
Our CI builds two version of the documentation:
2323

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

2629
```r
30+
# Should automatically open a browser
2731
pkgdown::build_site(preview=TRUE)
2832
```
2933

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

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

3843
## Versioning
3944

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

5447
## Release process
5548

56-
TBD
49+
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")`):
50+
51+
- [ ] `git pull`
52+
- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epiprocess.html)
53+
- [ ] `devtools::check(".", manual = TRUE, env_vars = c(NOT_CRAN = "false"))`.
54+
- Aim for 10/10, no notes.
55+
- [ ] If check works well enough, merge to main. Otherwise open a PR to fix up.
56+
- [ ] [Polish NEWS](https://github.com/cmu-delphi/epiprocess/blob/dev/NEWS.md).
57+
- Some [guidelines](https://style.tidyverse.org/news.html#news-release).
58+
- [ ] `git checkout main`
59+
- [ ] `git pull`
60+
- [ ] `urlchecker::url_check()`.
61+
- This may choke on the MIT license url, and that's ok.
62+
- [ ] `devtools::build_readme()`
63+
- [ ] `devtools::check_win_devel()`
64+
- [ ] Check email for problems
65+
- [ ] `revdepcheck::revdep_check(num_workers = 4)`.
66+
- 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.
67+
- [ ] Update `cran-comments.md`
68+
- [ ] PR with any changes
69+
70+
Submit to CRAN:
71+
72+
- [ ] `devtools::submit_cran()`
73+
- [ ] Approve email
74+
75+
Wait for CRAN...
76+
77+
- [ ] Accepted :tada:
78+
- [ ] `dev`
79+
- [ ] `usethis::use_github_release(publish = FALSE)` (publish off, otherwise it won't push).
80+
- [ ] check the release notes and publish the branch on github

_pkgdown.yml

+87-79
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,100 @@
1-
template:
2-
bootstrap: 5
1+
# Colors should stay consistent across epipredict, epiprocess, and epidatr,
2+
# using Carnegie Red
3+
# https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html
4+
5+
# This is to give a default value to the `mode` parameter in the
6+
# `pkgdown::build_site` function. This is useful when building the site locally,
7+
# as it will default to `devel` mode. In practice, this should all be handled
8+
# dynamically by the CI/CD pipeline.
9+
development:
10+
mode: devel
11+
version_label: success
312

13+
template:
14+
bootstrap: 5
15+
bootswatch: cosmo
16+
bslib:
17+
font_scale: 1.0
18+
primary: "#C41230"
19+
link-color: "#C41230"
420

5-
# Colors from epipredict & epidatr, including Carnegie Red https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html
621
navbar:
7-
bg: "#C41230"
8-
fg: "#f8f8f8"
9-
bootswatch: cosmo
10-
bslib:
11-
font_scale: 1.0
12-
primary: "#C41230"
13-
link-color: "#C41230"
14-
navbar-bg: "#C41230"
15-
navbar-fg: "#f8f8f8"
22+
bg: primary
23+
type: dark
1624

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

1927
home:
20-
links:
21-
- text: Introduction to Delphi's Tooling Work
22-
href: https://cmu-delphi.github.io/delphi-tooling-book/
23-
- text: Get the epipredict R package
24-
href: https://cmu-delphi.github.io/epipredict/
25-
- text: Get the epidatr R package
26-
href: https://github.com/cmu-delphi/epidatr
27-
- text: Get the epidatasets R package
28-
href: https://cmu-delphi.github.io/epidatasets/
28+
links:
29+
- text: Introduction to Delphi's Tooling Work
30+
href: https://cmu-delphi.github.io/delphi-tooling-book/
31+
- text: Get the epipredict R package
32+
href: https://cmu-delphi.github.io/epipredict/
33+
- text: Get the epidatr R package
34+
href: https://github.com/cmu-delphi/epidatr
35+
- text: Get the epidatasets R package
36+
href: https://cmu-delphi.github.io/epidatasets/
2937

3038
articles:
31-
- title: Using the package
32-
desc: Basic usage and examples.
33-
navbar: ~
34-
contents:
35-
- epiprocess
36-
- slide
37-
- growth_rate
38-
- correlation
39-
- aggregation
40-
- outliers
41-
- archive
42-
- advanced
43-
- compactify
39+
- title: Using the package
40+
desc: Basic usage and examples.
41+
navbar: ~
42+
contents:
43+
- epiprocess
44+
- slide
45+
- growth_rate
46+
- correlation
47+
- aggregation
48+
- outliers
49+
- archive
50+
- advanced
51+
- compactify
4452

4553
repo:
46-
url:
47-
home: https://github.com/cmu-delphi/epiprocess/tree/main/
48-
source: https://github.com/cmu-delphi/epiprocess/blob/main/
49-
issue: https://github.com/cmu-delphi/epiprocess/issues
50-
user: https://github.com/
54+
url:
55+
home: https://github.com/cmu-delphi/epiprocess/tree/main/
56+
source: https://github.com/cmu-delphi/epiprocess/blob/main/
57+
issue: https://github.com/cmu-delphi/epiprocess/issues
58+
user: https://github.com/
5159

5260
reference:
53-
- title: "`epi_df` basics"
54-
desc: Details on `epi_df` format, and basic functionality.
55-
- contents:
56-
- matches("epi_df")
57-
- title: "`epi_*()` functions"
58-
desc: Functions that act on `epi_df` objects.
59-
- contents:
60-
- epi_slide
61-
- epi_cor
62-
- title: Vector functions
63-
desc: Functions that act directly on signal variables.
64-
- contents:
65-
- growth_rate
66-
- detect_outlr
67-
- detect_outlr_rm
68-
- detect_outlr_stl
69-
- title: "`epi_archive` basics"
70-
desc: Details on `epi_archive`, and basic functionality.
71-
- contents:
72-
- matches("archive")
73-
- title: "`epix_*()` functions"
74-
desc: Functions that act on an `epi_archive` and/or `grouped_epi_archive` object.
75-
- contents:
76-
- starts_with("epix")
77-
- group_by.epi_archive
78-
- title: Example data
79-
- contents:
80-
- archive_cases_dv_subset
81-
- incidence_num_outlier_example
82-
- contains("jhu_csse")
83-
- title: Basic automatic plotting
84-
- contents:
85-
- autoplot.epi_df
86-
- title: internal
87-
- contents:
88-
- epiprocess
89-
- max_version_with_row_in
90-
- next_after
91-
- guess_period
92-
- key_colnames
61+
- title: "`epi_df` basics"
62+
desc: Details on `epi_df` format, and basic functionality.
63+
- contents:
64+
- matches("epi_df")
65+
- title: "`epi_*()` functions"
66+
desc: Functions that act on `epi_df` objects.
67+
- contents:
68+
- epi_slide
69+
- epi_cor
70+
- title: Vector functions
71+
desc: Functions that act directly on signal variables.
72+
- contents:
73+
- growth_rate
74+
- detect_outlr
75+
- detect_outlr_rm
76+
- detect_outlr_stl
77+
- title: "`epi_archive` basics"
78+
desc: Details on `epi_archive`, and basic functionality.
79+
- contents:
80+
- matches("archive")
81+
- title: "`epix_*()` functions"
82+
desc: Functions that act on an `epi_archive` and/or `grouped_epi_archive` object.
83+
- contents:
84+
- starts_with("epix")
85+
- group_by.epi_archive
86+
- title: Example data
87+
- contents:
88+
- archive_cases_dv_subset
89+
- incidence_num_outlier_example
90+
- contains("jhu_csse")
91+
- title: Basic automatic plotting
92+
- contents:
93+
- autoplot.epi_df
94+
- title: internal
95+
- contents:
96+
- epiprocess
97+
- max_version_with_row_in
98+
- next_after
99+
- guess_period
100+
- key_colnames

0 commit comments

Comments
 (0)