Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PAHFIT HackDay Open-Dev Model

Avatar for Karl Gordon Karl Gordon
January 08, 2021

PAHFIT HackDay Open-Dev Model

Intro for PAHFIT code development model (11 Jan 2021)

Avatar for Karl Gordon

Karl Gordon

January 08, 2021
Tweet

More Decks by Karl Gordon

Other Decks in Science

Transcript

  1. Open-Development Techniques PAHFIT HackDay 11 Jan 2021 Karl D. Gordon

    Astronomer at STScI [email protected] @karllark2000 karllark@github “Have Dust – Will Study” Image source: https://github.blog/2015-07-29-git-2-5-including-multiple-worktrees-and-triangular-workflows/
  2. Github • Social coding • Provides an easy to use

    user interface to git – Git = version control for tracking changes • Manage development via issues • Fork-Clone-Pull model
  3. Issues • Centralized location for code management • Allows for

    anyone anywhere to keep up-to-date • Anyone can raise an issue • Anyone can comment on an issue • All work should be tracked via an issue – Avoids multiple people working on the same thing • Issues assigned to specific people – Others can contact and coordinate
  4. Fork-Clone-Pull Model • Everyone forks the master repository • When

    updated code/docs/etc ready, issue a pull request to master repository – Identify the issue(s) this pull request addresses • Review and discussion of pull request • Pull request approved → code merged
  5. Work needed - Issues • All work this week needs

    an issue – Gets us into the habit – Central organization – Allows remote participation – Keeps track of work • Major Areas – Code, cleanup and enhancements – Documentation, more and setup with readthedocs – Testing, more and setup with travis – Build, setup and test – Logo?
  6. How to Fork • https://help.github.com/articles/fork-a-repo/ • On github, got to

    the master PAHFIT repository – Find the fork button – Makes a copy of the repository in your github area
  7. Clone the fork to your computer (& setup sync to

    master) • In your github area, find the code button • On command line in the directory you want the copy – git clone [email protected]:YOURGITNAME/pahfit.git • Configure your clone version to sync with master BEAST version – In the github master BEAST respository – Find the clone button – Goto the directory with your clone version – git remote add upstream [email protected]:PAHFIT/pahfit.git
  8. Clone the fork to your computer (& setup sync to

    master) • In your github area, find the code button • On command line in the directory you want the copy – git clone [email protected]:YOURGITNAME/pahfit.git • Configure your clone version to sync with master PAHFIT version – In the github master PAHFIT respository – Find the clone button – Goto the directory with your clone version – git remote add upstream [email protected]:PAHFIT/pahfit.git
  9. Syncing your fork • https://help.github.com/articles/syncing-a-fork/ • Get updated files from

    the pahfit master – Do this when when appropriate (e.g., starting new branch) • In directory of clone on your computer – git fetch upstream – git checkout master – git merge upstream/master • If you only update your master this way, life will be easier
  10. Branch your fork • https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-bra nch-with-git-and-manage-branches • Branches make it

    easy to manage work – Can have multiple branches and switch between them – New branch for a new issue • In directory of clone on your computer – git checkout -b new_branch_name – git push origin branch_name → send to github – git branch → show branches on computer – git checkout branch_name → switch to that branch
  11. Work on your branch • Make changes, commit, repeat •

    Test! – >>> tox -e test • Build the docs – >>> tox -e build_docs • Push to github