Proposed Sinopia & GitHub Workflow - LD4P/sinopia_sample_profiles GitHub Wiki
NB: This is not required for someone to work with Profiles & Resource Templates (or any other type of resources) within the Sinopia ecosystem. This is just a proposal for a workflow that gives some more structure to specification review by metadata and cataloging librarians, and has a technical skeleton that we can easily extend with existing software engineering tools & processes for more automated integration down the road.
Profile & Template Flow
This is a proposal for editing and adding new profiles and resource templates on your local machine, pushing to a hosted review space in GitHub, and having your colleagues review and merge your additions / changes to the 'master' copy of your shared profiles & resource templates. That 'master' copy is then what is updated within Sinopia by whomever in your team reviewed & merged the changes, ensuring that authorized users are ensuring the quality of profiles in both places.
In this setup, you would not support adding changes directly to profiles pushed to Sinopia (not going through GitHub review). Those changes would be overwritten upon any new release of the 'master' copy from your team's GitHub repository.
Overview of the Process:
- Pull all the remote (GitHub) work locally
- Make a new Branch
- Add your changes to your Branch
- Commit your changes to your Branch
- Push your Branch up to a Branch in GitHub
- Create Pull Request in GitHub to merge your Branch to the Master Branch
- Have other people review & merge (or request changes)
- Merge (or Close) Pull Requests to Master
- Member of team then updates their team's Sinopia profiles with files in Master
- Start again at bullet point 1
Shell (CLI / Terminal) Commands:
- On local machine, change into my Git repository:
cd cmharlow/github/ld4p/sinopia_sample_profiles
- Have local files that mirror timestamp + branch upstream in GitHub
- Have appropriate connection to GitHub repository via checking
git remote show origin
- On master branch (you can check by entering
git checkout master
), rungit pull origin master
- Pull all changes down (you always want to do this before starting your own branch to add changes)
- Open in editor, eyeball, add whatever. This adds your changes however on your local machine.
git checkout -b my-new-branch
- Create your working branch
git status
- Check what is new in that branch
git add example.json
- Add the items you want to check in
git commit -m 'adding my new json profile'
- Commit them to your branch with a commit message
git status
- Check now what is new in that branch
git push origin my-new-branch
- Push your committed changes up to your branch in the GitHub repository
- Go to GitHub & create a PR. Have other people review & decide to merge (or not) that PR.
- Create a Pull Request by which someone reviews and approves your changes and merges them into master
- For Sinopia, after the above, a credential team member might then re-submit any updated or new profiles & resource templates to Sinopia through the UI (or, eventually, programmatically)
git checkout master | git pull origin master
- Start the process all over again.