Slide 1

Slide 1 text

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/

Slide 2

Slide 2 text

Distributed Coding ● Geographically, temporally distributed ● Astropy Affiliated Package ● Github

Slide 3

Slide 3 text

Astropy Affiliated Package ● http://docs.astropy.org/en/stable/development/af filiated-packages.html ● Take advantage of the community knowledge of how to do distributed/social code development

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

https://github.blog/2015-07-29-git-2-5-including-multiple-worktrees-and-triangular-workflows/

Slide 8

Slide 8 text

https://github.com/sf-wdi-21/notes

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Who is contributing?

Slide 16

Slide 16 text

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?

Slide 17

Slide 17 text

Github Details

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

Work on your branch ● Make changes, commit, repeat ● Test! – >>> tox -e test ● Build the docs – >>> tox -e build_docs ● Push to github

Slide 24

Slide 24 text

Generate a Pull Request ● On github

Slide 25

Slide 25 text

Pull request

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content