From f120f6f777e14d3e45ecc31f89914ae3b1331e2d Mon Sep 17 00:00:00 2001 From: m-kolomanski Date: Fri, 24 Jan 2025 14:13:22 +0100 Subject: [PATCH 1/5] docs: updated instructions on package versioning --- .github/PULL_REQUEST_TEMPLATE.md | 1 + CONTRIBUTING.md | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f8d177d5..31f7c735 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -19,6 +19,7 @@ How to test features not covered by unit tests. - [ ] Code passes all unit tests - [ ] New logic covered by unit tests - [ ] New logic is documented +- [ ] Package version is incremented ## Notes to reviewer diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 114dd273..5f0ce079 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,14 +60,24 @@ This part is here as a reminder to perform basic tasks and checks before the cod - Code passes all unit tests - New logic covered is by unit tests - New logic is documented +- Package version is bumped The above rules will help keep our work organized, as well as allow for quick information flow between related issues, branches and pull requests. #### Notes to reviewer If there is anything that the reviewer should know before tackling the pull request, please provide it here. This could include things like pointing to specific parts of the code that require special attention, explaining decisions behind unusual implementations or providing logic behind changing the scope of the task. +### Bumping package version +Package versioning must use the semantic versioning schema, with developement extension: **X.Y.Z.9NNN** + +#### Developement version +In each PR that introduces changes to the code, dependencies or the function documentation, it is required that the developement package version is incremented by 1 (this is the .9NNN number, the last part of the versioning schema). As the current feature branch might be outdated, before merging please cross-check with the **main** branch that the version you are submitting is correct. + +#### Semantic versioning +The versioning schema for major / minor / patch releases must adhere to [semantic versioning](https://semver.org/) guidelines. + ## Code review -Each pull request must be accepted by at least one reviewer before it can be merged to the main branch. +Each pull request must be accepted by at least two reviewers before it can be merged to the main branch. #### For reviewee When the change is done, pull request is open and the description is filled, please move your issue from **In Progress** to **Needs review** status, so it can be picked up by a reviewer. From this point it is up to the contributor and the person validating the change to work out any kinks and lead to merging the changes. From 7e9de45ab6a8fb9de17295254ddc3b3fbd1a61fb Mon Sep 17 00:00:00 2001 From: m-kolomanski Date: Thu, 30 Jan 2025 08:19:07 +0100 Subject: [PATCH 2/5] build: add workflow for automatic page deployment --- .github/workflows/pkgdown.yml | 47 +++++++++++++++++++++++++++++++++++ DESCRIPTION | 1 + _pkgdown.yml | 3 +++ 3 files changed, 51 insertions(+) create mode 100644 .github/workflows/pkgdown.yml create mode 100644 _pkgdown.yml diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml new file mode 100644 index 00000000..a3de62a7 --- /dev/null +++ b/.github/workflows/pkgdown.yml @@ -0,0 +1,47 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +on: + push: + branches: main + pull_request: + branches: main + workflow_dispatch: + +name: Deploy website + +permissions: read-all + +jobs: + pkgdown: + 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 }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, dest_dir = "page") + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: page \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 4f8e0e89..093c27af 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -75,3 +75,4 @@ Suggests: testthat (>= 3.0.0) Config/testthat/edition: 3 Language: en-US +URL: https://pharmaverse.github.io/aNCA/ diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 00000000..7eb512b8 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,3 @@ +template: + bootstrap: 5 +url: "https://pharmaverse.github.io/aNCA/" From 21eb81c296e313d86bbffebbd82080a8d7287fff Mon Sep 17 00:00:00 2001 From: m-kolomanski Date: Fri, 31 Jan 2025 12:42:59 +0100 Subject: [PATCH 3/5] refactor: simplify global imports --- inst/shiny/global.R | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/inst/shiny/global.R b/inst/shiny/global.R index bc9bc5e7..3889c2dc 100644 --- a/inst/shiny/global.R +++ b/inst/shiny/global.R @@ -1,16 +1,4 @@ -source("modules/tab_data.R") -#Load labels -LABELS <- read.csv(system.file("shiny/data/adnca_labels.csv", package = "aNCA")) +lapply(list.files("modules", pattern = "\\.R$", full.names = TRUE), source) +lapply(list.files("functions", pattern = "\\.R$", full.names = TRUE), source) -source("modules/slope_selector.R") - -source("modules/units_table.R") - -source("functions/partial_auc_input.R") - -source("modules/tlg_plot.R") - -source("modules/tab_visuals.R") - -source("functions/mapping_selectize_inputs.R") -source("functions/generate_col_defs.R") +LABELS <- read.csv(system.file("shiny/data/adnca_labels.csv", package = "aNCA")) \ No newline at end of file From 722581002b97e5e4a2e394ae7d774db50d614bda Mon Sep 17 00:00:00 2001 From: m-kolomanski Date: Fri, 31 Jan 2025 12:57:59 +0100 Subject: [PATCH 4/5] chore: bump package version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 093c27af..89b1322c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: aNCA Title: (Pre-)Clinical NCA in a Dynamic Shiny App -Version: 0.0.0.9001 +Version: 0.0.0.9002 Authors@R: c( person("Ercan", "Suekuer", , "ercan.suekuer@roche.com", role = c("aut", "cre"), comment = c(ORCID = "0009-0001-1626-1526")), From a67b54095d6d102e7022f9bcfd90d4dc9a5393c7 Mon Sep 17 00:00:00 2001 From: m-kolomanski Date: Fri, 31 Jan 2025 13:24:15 +0100 Subject: [PATCH 5/5] style: trailing blank line --- inst/shiny/global.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/shiny/global.R b/inst/shiny/global.R index 3889c2dc..0fb7a024 100644 --- a/inst/shiny/global.R +++ b/inst/shiny/global.R @@ -1,4 +1,4 @@ lapply(list.files("modules", pattern = "\\.R$", full.names = TRUE), source) lapply(list.files("functions", pattern = "\\.R$", full.names = TRUE), source) -LABELS <- read.csv(system.file("shiny/data/adnca_labels.csv", package = "aNCA")) \ No newline at end of file +LABELS <- read.csv(system.file("shiny/data/adnca_labels.csv", package = "aNCA"))