diff --git a/_pkgdown.yml b/_pkgdown.yml index ae578ee54..169276c39 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -8,6 +8,7 @@ articles: contents: - project_structure - using_github + - github_branches - package_development - data_table diff --git a/vignettes/data_table.Rmd b/vignettes/data_table.Rmd index 092758d97..bacd2dcdf 100644 --- a/vignettes/data_table.Rmd +++ b/vignettes/data_table.Rmd @@ -1,8 +1,8 @@ --- -title: "04 Improve efficiency with `data.table`" +title: "05 Improve efficiency with `data.table`" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{04 Improve efficiency with `data.table`} + %\VignetteIndexEntry{05 Improve efficiency with `data.table`} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/github_branches.Rmd b/vignettes/github_branches.Rmd new file mode 100644 index 000000000..994733ff4 --- /dev/null +++ b/vignettes/github_branches.Rmd @@ -0,0 +1,72 @@ +--- +title: "03 Github Branches" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{03 Github Branches} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>" +) +``` + +## Overview +This article provides a description of the Git branching workflow used to maintain the `createslf` package in line with NSS BI BYOC infrastructure. It explains how branches are structured, how code moves from one environment to another, and what protection rules apply. It is intended for all PHS analysts contributing to this project and serves as a reference for day‑to‑day Git usage. + +## Acronyms Reference +* BI – Business Intelligence (NSS) +* BYOC – Bring Your Own Code +* PR – Pull Request +* SLF – Source Linkage Files +* UAT – User Acceptance Testing + +## Branching Structure +The project uses a three‑tier protected branching model: + +`master` → `main-byoc` → `UAT` → `development` + +### Branching Workflow: +**master (production)** – Represents the code currently deployed in production + +* Must be protected: No direct pushes and PRs must be approved by 1 SLF team member + 1 NSS BI member. +* Ensures: A stable, production environment and that all production code has been peer‑reviewed. + +**main-byoc (infrastructure integration)** – Acts as the integration layer between SLF R code and NSS BI BYOC-specific configurations + +* Holds the BYOC artefacts including the wrapper and utility scripts. +* Owned primarily by NSS BI. + +**UAT (User Acceptance Testing)** – Used for end‑user testing after changes are validated in development + +* PRs must be reviewed by one PHS member and one NSS BI member. +* Code here is deployed into the UAT environment. +* When UAT is successful, code moves to main-byoc → then to master. + +**development** – Represents the current state of code under active development + +* PRs must be reviewed by one PHS member. +* All feature branches must be created from this branch. + +**Feature branches (working branches)** – Created when working on issues + +* Always created from development +* After testing locally, raise a PR → merge into development + +### Merge Visual Workflow: + +```{r, echo=FALSE, out.width="85%"} +knitr::include_graphics("images/git_flow.png") +``` + +### Workflow Summary +| Branch | Purpose | Approval Required | +|----------------------|--------------------------|-----------------------| +| `master` | Production Code | PHS + NSS BI | +| `main-byoc` | BYOC Integration | PHS + NSS BI | +| `UAT` | User Testing | PHS + NSS BI | +| `development` | Integration of Features | PHS | +| `feature` | Individual Work | N/A (Local Testing) | diff --git a/vignettes/images/git_flow.png b/vignettes/images/git_flow.png new file mode 100644 index 000000000..d6428c0c8 Binary files /dev/null and b/vignettes/images/git_flow.png differ diff --git a/vignettes/package_development.Rmd b/vignettes/package_development.Rmd index 594f57561..e2520254a 100644 --- a/vignettes/package_development.Rmd +++ b/vignettes/package_development.Rmd @@ -1,8 +1,8 @@ --- -title: "03 Package Development" +title: "04 Package Development" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{03 Package Development} + %\VignetteIndexEntry{04 Package Development} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} ---