-
Notifications
You must be signed in to change notification settings - Fork 150
Code development with multiple repositories
Often, CAM development begins in a CAM external (e.g., PUMAS, chemistry, NCAR CCPP Atmospheric Physics). This development is a bit more complicated than working directly in CAM because multiple pull requests (and sometimes, multiple repositories) are required. There are two basic workflows for handling these situations, make a change in an external and update CAM with a new tag, and make a change both in an external and CAM. The workflow is similar for these two cases. You need the following items:
- A branch of the external(s) in your fork of the external(s) repository
- A branch of CAM in your fork of CAM
- An edit to the Externals_CAM.cfg file in your CAM branch.
The basic procedure for making the changes is:
- Open a CAM issue describing the change to be made
- Open an issue for the external (if part of that repository's workflow)
- Set up the sandbox
- Make needed changes to the external(s)
- Make related changes to CAM (if needed)
- Test changes
- Following the workflow for the external repository, submit a PR back to the correct external branch
- Once the external change is merged and tagged, update Externals_CAM.cfg to point to the tag
- Run some CAM tests to make sure the changes are working
- Open a PR back to CAM
For the example below, we will make a change to the Popeye external by updating the spinach process. The ID for the GitHub fork will be OliveOyl. Before you begin, make sure you have a personal fork of both CAM and the external. If the external does not use forks or is not on GitHub, modify those steps as needed. These steps will create a sandbox:
git clone -o OliveOyl https://github.com/OliveOyl/CAM
cd CAM
git remote add ESCOMP https://github.com/ESCOMP/CAM
git fetch --tags ESCOMP
git branch update_Popeye ESCOMP/cam_development
git checkout update_Popeye
./manage_externals/checkout_externals
cd src/physics/Popeye
git remote add OliveOyl https://github.com/OliveOyl/Popeye
git fetch OliveOyl
git branch update_spinach origin/development
git checkout update_spinach
git push OliveOyl update_spinach
cd ../../..
Next, edit Externals_CAM.cfg to update the Popeye external to point to the new branch, update_spinach
CAM wiki
CAM Documentation
CAM Model Development