Warning, /tutorial-setting-up-environment/episodes/03-github.md is written in an unsupported language. File is not indexed.
0001 ---
0002 title: "Using GitHub with EIC Software"
0003 teaching: 10
0004 exercises: 5
0005 ---
0006
0007 ::::::::::::::::::::::::::::::::::::::::::: questions
0008
0009 - How do we use GitHub within the EIC community?
0010
0011 :::::::::::::::::::::::::::::::::::::::::::
0012
0013 ::::::::::::::::::::::::::::::::::::::::::: objectives
0014
0015 - Several repositories contain the key geometry, simulation, reconstruction, and analysis software.
0016 - Working with repositories requires membership of the EIC organization on GitHub.
0017 - Issue reports and pull requests are ways to collaborate virtually on collaboration software tools.
0018
0019 :::::::::::::::::::::::::::::::::::::::::::
0020
0021 ## How do I get added to @eic organization on GitHub?
0022
0023 In order to contribute, you need your GitHub account to be a member of the [EIC organization](https://github.com/eic) on GitHub. If it is not, follow the [getting-started instructions](https://eic.github.io/documentation/getstarted).
0024
0025 ## Where are repositories located?
0026
0027 The main repositories are located on two locations:
0028
0029 - the GitHub service contains most user-facing repositories: <https://github.com/eic>.
0030 - the eicweb GitLab server contains mainly continuous integration infrastructure: <https://eicweb.phy.anl.gov/EIC>.
0031
0032 We will use GitHub as the main code repository tool. The top of the [github.com/eic](https://github.com/eic) page has several 'pinned' repositories that are most important. You can also see where most activity is happening based on the ordering of the repositories in the list.
0033
0034 You can 'watch' repositories to be notified of activity. This is helpful if you wish to remain up-to-date on the activity. You can 'star' repositories as another way to find them easily.
0035
0036 ::::::::::::::::::::::::::::::::::::::::::: challenge
0037
0038 ## Exercise 1
0039
0040 - Verify that you are a member of the EIC organization on GitHub: Do you see the members-only page with the grid of software meetings? If not, see previous section.
0041 - Check which teams you are in: Enter the search terms "members:me" into the search box in the Teams tab to see only the teams you are a member of. If you are not in ePIC Devs, request to be added at <https://github.com/orgs/eic/teams/epic-devs>.
0042 - Choose one repository to subscribe to, at some level of activity.
0043
0044 ::::::::::::::: solution
0045
0046 If you can see the members-only page you are in the organization. The Teams tab with the
0047 `members:me` filter shows your teams; if `ePIC Devs` is missing, request to join. Use the
0048 "Watch" / "Star" buttons on a repository to subscribe.
0049
0050 :::::::::::::::
0051
0052 :::::::::::::::::::::::::::::::::::::::::::
0053
0054 ## What is the proper way to work with these repositories?
0055
0056 Duplication of work is avoided when everyone knows what is going on.
0057
0058 1. A typical workflow starts from the creation of an **issue** with a feature request or a bug report. This happens in the browser on the github repository site. When creating the issue, feel free to tag people you want to notify.
0059 1. Create a branch that includes the issue number in the name. This can be done from the browser or command line as `git checkout -b issue123`
0060 1. Edit and work on your branch. When you are ready, you can commit your changes to the branch.
0061 1. If you are ready to merge your branch into the main repository, you can generate a **pull request** from the browser. You can assign a reviewer at this stage and add information in the Write box that explains the changes made. If your work is not yet completed, you can utilize the Draft PR.
0062 1. Once you've generated a pull request, continuous integration tests are run to ensure compatibility. The reviewer will approve the changes, merging your code into the main branch.
0063 1. After the pull request is approved and the code is merged, you can delete your branch using the browser or via the command line.
0064
0065 A good example of the above workflow is shown in detail in the [JANA2 contributing tutorial](https://eic.github.io/tutorial-jana2/05-contributing.html) for the EICrecon repository.
0066
0067 ::::::::::::::::::::::::::::::::::::::::::: challenge
0068
0069 ## Exercise 2
0070
0071 - Think of one issue that is related to the analysis or detector you are mainly working on.
0072 - Think of a good title that summarizes what the issue is.
0073 - Open an issue in the relevant repository and fill out the provided template.
0074 - Tag one person (who is not the instructor) whose input you would like on this issue.
0075 - Advanced users: Create a branch from the issue using the 'Development' section in the right side bar of the issue.
0076
0077 ::::::::::::::: solution
0078
0079 A good issue has a specific, searchable title and a filled-in template describing the problem and
0080 expected behaviour. Tagging a relevant person with `@username` notifies them. The issue's
0081 "Development" sidebar can create a linked branch you can then check out locally.
0082
0083 :::::::::::::::
0084
0085 :::::::::::::::::::::::::::::::::::::::::::
0086
0087 ## How can you use eic-shell with the repositories that you are working on?
0088
0089 `eic-shell` already contains all of the compilers and dependencies (ROOT, DD4hep, Geant4, ACTS, podio, and more) that the EIC repositories build against, so you do not have to install any of them yourself. Because your home directory and the current working directory are shared between the host and the container, the typical development loop is:
0090
0091 1. Clone the repository on your host system, e.g. `git clone https://github.com/eic/EICrecon`.
0092 2. Start `eic-shell` from a directory that contains your clone, so the source tree is visible inside the container.
0093 3. Configure and build **inside** `eic-shell` with the repository's build instructions (usually `cmake` followed by `cmake --build`). Because the build uses the container's dependencies, your result matches the standard environment used for productions and continuous integration.
0094 4. Edit the code with your usual editor on the host, then rebuild inside `eic-shell` — no need to copy files back and forth.
0095
0096 The [Reconstruction framework tutorial](https://eic.github.io/tutorial-jana2/) walks through building and running EICrecon inside `eic-shell` in detail.
0097
0098 ## What are the checks that are run on pull requests?
0099
0100 When you open a pull request, continuous-integration (CI) jobs run automatically, and the PR must pass them and receive at least one review from a collaborator before it can be merged. The recommended workflow and the full set of requirements for EICrecon are documented in the [EICrecon contribution guidelines](https://github.com/eic/EICrecon/blob/main/CONTRIBUTING.md). A pull request is ready to be reviewed when:
0101
0102 - a detailed description of the change is provided,
0103 - all CI jobs pass (build and tests),
0104 - `clang-format` and `clang-tidy` have been run locally (code style and static checks),
0105 - the commit history is legible (small, self-contained commits with descriptive messages),
0106 - the code is appropriately documented.
0107
0108 The reviewer then checks that the code is maintainable and scalable, that it is correct with respect to physics requirements, and that any changes in physics or computing performance (the benchmarks) are understood.
0109
0110 ::::::::::::::::::::::::::::::::::::::::::: keypoints
0111
0112 - We use several tools on GitHub to ensure we keep the overview of who does what work.
0113 - `eic-shell` provides the dependencies to build the EIC repositories; clone on the host and build inside the container.
0114 - Every pull request must pass CI (build, tests, `clang-format`/`clang-tidy`) and receive a review before merging — see the [EICrecon contribution guidelines](https://github.com/eic/EICrecon/blob/main/CONTRIBUTING.md).
0115
0116 :::::::::::::::::::::::::::::::::::::::::::