Auxiliary Data - Version Control
Release branch management
Rossana Tatulli
managing_release_branches.Rmd
The {pipaux} package manages auxiliary data used across PIP. It
includes functions like aux_ppp()
for PPP data and
aux_gdp()
for GDP data (formerly pip_*()), which allow
users to update or load specific auxiliary data. For example, calling
aux_gdp()
will update or load GDP data depending on user
specification. When updating data, these functions push the changes to
the DEV branch of the respective auxiliary data repository. The DEV
branch of each auxiliary data repository is therefore updated with
changes.
To ensure that the version of auxiliary data used for each release is properly tracked, 2 steps are necessary:
- Each auxiliary data repository should have a dedicated release branch.
- The release branch must be periodically updated with changes from the DEV branch. To facilitate the management of release branches and synchronization with the DEV branch, the {pipfun} package provides functions designed for this purpose.
Specifically,
1. Check if release branch is there, and if not, create it
# Get branches in repo
# Example 1: TEST repo
repo_branches <- pipfun::get_repo_branches(repo = "aux_test",
owner = getOption("pipfun.ghowner"))
repo_branches
# Example 2: PPP repo
pipfun::get_repo_branches(repo = "aux_ppp",
owner = getOption("pipfun.ghowner"))
# As no release branch is found, create it from DEV
# create_new_branch(new_branch = "20241005",
# ref_branch = "DEV",
# repo = "aux_ppp")
2. Check that release branch is updated with DEV
pipfun::compare_branch_content(repo = "aux_test",
branch1 = "DEV",
branch2 = "main")
3. Update release branch if needed
In this case, given that the release branch has just been created, it
is up to date with DEV. However, had “same_content” been
FALSE
, we need to update release branch accordingly as
follows:
# Option 1: Make release branch point to the latest commit as in DEV
# pipfun::update_branches(repo = "aux_test",
# branch1 = "DEV",
# branch2 = "20241005")
# Option 2: Merge DEV into release branch
# pipfun::merge_branch_into(repo = "aux_test",
# source_branch = "DEV",
# target_branch = "20241005")