Skip to content

GitHub Workflow

Raven edited this page May 13, 2022 · 2 revisions

View the demo video here

Creating an Issue

The first step to changing the code is to create an issue. Issues represent tasks like adding a new feature or fixing a bug. Navigate to the repository that you will be changing (ex: github.com/radiasoft/repo name) and select the Issues tab. Select the green New Issue button and describe the issue in the title/description.

You can see all of your created/assigned/mentioned issues here.

Creating a Branch

Next, you can create a branch for changes relating to the issue. From the command line, navigate to your local copy of the repo and ensure that you are on master/main with git branch and pull any recent changes with git pull. Create a branch with the issue number and description with git checkout -b <branch name>. Example branch names include 4312-class-based-api and 3654-moderate-jupyterhub-user-creations. If you are creating a branch in a different repo from the issue, include the repo name that contains the issue within the branch name (for example, raydata-11-select-catalog).

Committing Changes

Create your changes to the code. You can use git status to see files with unstaged changes, and stage the changes with git add. You can link the commit to the issue by referencing the issue in the commit message, for example, git commit -m 'fix #3654: add moderation for jupyterhub user creations'. Push the commit to GitHub with git push. The issue page will show the linked commit, and when the commit is merged to master/main, the issue will be closed out automatically. For more information on linking to issues, see this page in the Github docs.

Pull Requests

When you are ready to add your changes to master/main, open a pull request for the branch. On GitHub, navigate to the Code tab for the repo (ex: github.com/radiasoft/repo name). Click on the link to all the repo's branches (it will have the number of branches, for example 122 Branches). Find your branch and click the New Pull Request button. You can request someone to review the pull request. The reviewer can add comments to the changed code, and approve or request additional changes. When the reviewer approves all the changes, they can merge the pull request.

You can see all of your created/assigned/mentioned/review requested pull requests here.

Sirepo Release Cycle

Changes to Sirepo are released on a weekly basis. Changes to the sirepo and pykern repos are automatically included in this release. For changes to other repos, you will need to request that that the changes be added to the release. Open an issue in the Sirepo repo with your request.

For more information about the release cycle, see this wiki page.