Update Contributing to Gryphon authored by Allen, Bruce (CIV)'s avatar Allen, Bruce (CIV)
Everyone is encouraged to contribute to Gryphon! Everyone is encouraged to contribute to Gryphon!
* If you would like to suggest improvements and new capabilities for Gryphon please go to https://gitlab.nps.edu/monterey-phoenix/user-interfaces/gryphon/-/issues and click on the blue "New issue" button". * If you would like to suggest improvements and new capabilities for Gryphon please go to https://gitlab.nps.edu/monterey-phoenix/user-interfaces/gryphon/-/issues and click the blue "New issue" button.
* If you would like to contribute code, please read on. * If you would like to contribute code, please read on:
# Contributing code to Gryphon # Contributing code to Gryphon
Please submit code using pull requests. Here is the basic workflow: Please submit code using pull requests. Here is the basic workflow:
...@@ -9,23 +9,24 @@ Please submit code using pull requests. Here is the basic workflow: ...@@ -9,23 +9,24 @@ Please submit code using pull requests. Here is the basic workflow:
* Add your code. * Add your code.
* Submit a pull request. * Submit a pull request.
Gryphon version control and code management is performed using Git. For references on using Git please see https://git-scm.com/doc. In our examples we describe working with Git from a Linux command prompt. We will use basic Linux file and directory commands. Gryphon version control and code management is performed using Git. For references on using Git please see https://git-scm.com/doc. In our examples we describe working with Git from a Linux command prompt. We will use Linux file and directory commands.
We access NPS GitLab using Git commands. To enable key-managed SSH authentication with NPS GitLab please install your RSA Public key, please see https://gitlab.nps.edu/-/profile/keys. We access NPS GitLab using Git commands. To enable key-managed SSH authentication with the NPS GitLab Server please install your RSA Public key, see https://gitlab.nps.edu/-/profile/keys.
In these examples we will work with a clone of the Gryphon repository that we will install under folder `gitlab`. We create this work folder in our home directory by typing: For demonstration, we will work with a clone of the Gryphon repository that we will install under folder `gitlab`. We create this work folder in our home directory by typing:
mkdir ~/gitlab mkdir ~/gitlab
## Clone the Gryphon repository. ## Clone the Gryphon repository.
Please set up GitLab with your SSH RSA key and please set up a working directory on your local machine as described above, and then clone the Gryphon repository: Please set up GitLab with your SSH RSA key and please set up a working directory on your local machine as described above, and then clone the Gryphon repository:
cd ~/gitlab
git clone git@gitlab.nps.edu:monterey-phoenix/user-interfaces/gryphon.git git clone git@gitlab.nps.edu:monterey-phoenix/user-interfaces/gryphon.git
## Create your branch ## Create your branch
When you clone a repository it places you on the "master" branch. Create a branch to work on. Once you have made changes and added code, those changes can be merged via a pull request. When you clone a repository, it places you on the "master" branch. Rather than working directly on the master branch, create a new branch and do your work there. For example to start work on new branch "my fix", type:
Create a branch name for your work. For example to start work on new branch "my fix" type:
cd ~/gitlab/gryphon
git checkout -b "my fix" git checkout -b "my fix"
## Add code ## Add code
...@@ -37,11 +38,11 @@ Here you may see files indicated as changed or new. To see specific changes, ty ...@@ -37,11 +38,11 @@ Here you may see files indicated as changed or new. To see specific changes, ty
git diff git diff
When ready, stage these changes for inclusion into your "my fix" branch. For example add file "my_new_file.py": When ready, stage these changes for inclusion into your "my fix" branch. For example stage file "my_new_file.py":
git add my_new_file.py git add my_new_file.py
Now typing `git status` will show that files are staged. Commit these changes to the "my fix" branch, including a present-tense statement about the change, written as an action: Now typing `git status` will show that files are staged on the "my_fix" branch. Commit these changes to the "my fix" branch. Include a statement about the change:
git commit -m "fix misleading wording" git commit -m "fix misleading wording"
...@@ -53,10 +54,10 @@ This commits your change to your clone of the repository, but it does not push y ...@@ -53,10 +54,10 @@ This commits your change to your clone of the repository, but it does not push y
Once your branch is uploaded, create a pull request on GitLab (GitLab calls this a merge request). For detail please see https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html. Once your branch is uploaded, create a pull request on GitLab (GitLab calls this a merge request). For detail please see https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html.
* From your browser, open the NPS GitLab repository at https://gitlab.nps.edu/monterey-phoenix/user-interfaces/gryphon/-/tree/master * From your browser, open the NPS GitLab repository at https://gitlab.nps.edu/monterey-phoenix/user-interfaces/gryphon/-/tree/master
* Verify that your branch is there: near the upper-left, click the drop-down, likely indicating "master", to reveal the branches and tags. You should see your "my fix" branch. * Verify that your branch is there: near the upper-left, click the drop-down indicating "master" to reveal the branches and tags. You should see your "my fix" branch.
* At the left, click on "Merge requests". A new merge request page opens. Select your source branch. The target branch is "master". Click "Compare branches and continue". A "New merge request" page opens. * At the left, click on "Merge requests" to initiate your merge request. Here, select your source branch; the target branch is "master". Click "Compare branches and continue". A "New merge request" page opens.
* Fill in the form. For Description, please include details to help us understand any specific details about the request. Please also provide steps for testing to help with validating expected behavior. Then click "Create merge request". * Fill in the form. For Description, please include details to help us understand any specific details about the request. Please also provide steps for testing to help with validating expected behavior. Then click "Create merge request".
* At this point, the request is submitted and it shows up in the merge list under "Merge requests". * At this point, your merge request is submitted and shows up in the merge list under "Merge requests" in the GitLab repository's home at https://gitlab.nps.edu/monterey-phoenix/user-interfaces/gryphon/-/tree/master.
## Merging pull requests into master ## Merging pull requests into master
* An assigned developer reviews your pull request and may ask questions or request changes. * An assigned developer reviews your pull request and may ask questions or request changes.
... ...
......