Skip to content

Commit ddfb1d0

Browse files
committed
Development Process and Issues documentation written
1 parent ec7b3b2 commit ddfb1d0

File tree

5 files changed

+222
-21
lines changed

5 files changed

+222
-21
lines changed

docs/contribute/code.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,23 @@ Use these instructions to setup a new development environment for modifying Teth
2929
Development Process
3030
===================
3131

32-
This document provides an overview of the development process for Tethys Platform. It covers topics such as branching strategies, code reviews, and submitting pull requests to ensure a consistent and efficient development process.
32+
This section describes the development process used for managing code contributions to Tethys Platform. It provides a a high-level description on common development activities like creating a fork of the repository, making changes on a feature branch, and submitting a pull request for review.
3333

3434
.. toctree::
3535
:maxdepth: 1
3636

3737
development_process
3838

39+
Managing Issues
40+
===============
41+
42+
This section explains how Issues are used to track bugs, feature requests, and other tasks for the Tethys Platform, and how they facilitate discussion, planning, and task assignment. It also highlights the need to reference relevant issues in pull requests and the importance of labeling issues for better categorization and prioritization.
43+
44+
.. toctree::
45+
:maxdepth: 1
46+
47+
issues
48+
3949
Coding Principles
4050
=================
4151

docs/contribute/community.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Supporting the Community
88

99
Issues and Discussions and Security
1010

11+
.. _contribute_community_discussions:
12+
1113
Discussions
1214
===========
1315

docs/contribute/dev_environment.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The manual setup process involves cloning a copy of the Tethys Platform source c
4141
4242
.. note::
4343

44-
If you do not have permission to push changes to the Tethys Platform repository, you should fork the repository on GitHub and clone your fork instead (see: :ref:`contribute_forking_and_branching`).
44+
If you do not have permission to push changes to the Tethys Platform repository, you should fork the repository on GitHub and clone your fork instead (see: :ref:`contribute_forking`).
4545

4646
2. Create a New Conda Environment
4747
---------------------------------

docs/contribute/development_process.rst

Lines changed: 131 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,154 @@ Development Process
66

77
**Last Updated:** December 2024
88

9+
.. _contribute_github_flow:
10+
911
GitHub Flow
1012
===========
1113

12-
.. _contribute_forking_and_branching:
14+
Tethys Platform uses the `GitHub Flow <https://docs.github.com/en/get-started/using-github/github-flow>`_ workflow for managing code contributions. GitHub Flow is a branch-based workflow that allows many developers to work on the same codebase simultaneously. It leverages the features of Git version control system and GitHub to provide a simple and flexible workflow, allowing developers to collaborate and make changes to the codebase efficiently.
15+
16+
.. _contribute_github_flow_summary:
17+
18+
Here is a summary of the GitHub Flow process:
19+
20+
1. :ref:`contribute_forking`: Create a fork of the Tethys Platform repository under your GitHub account.
21+
2. :ref:`contribute_feature_branch`: Create a new branch from the `main` branch to work on your changes.
22+
3. :ref:`contribute_make_changes`: Make your changes on the feature branch, following the project's coding standards and best practices.
23+
4. :ref:`contribute_pull_request`: Push your branch to GitHub and open a Pull Request to merge your changes into the `main` branch.
24+
5. :ref:`contribute_code_review`: Have your changes reviewed by other contributors to ensure they meet the project's standards.
25+
6. :ref:`contribute_checks`: Ensure that your changes pass all automated checks, such as code style, testing, and documentation.
26+
7. :ref:`contribute_merge`: Once the Pull Request has been approved, merge your changes back into the `main` branch.
1327

14-
Forking and Branching
15-
---------------------
28+
.. _contribute_forking:
1629

30+
Create a Fork
31+
=============
1732

33+
Most GitHub repositories, including Tethys Platform, restrict who can push changes directly to the repository. However, anyone can still contribute changes to Tethys Platform by creating a `Fork <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo>`_ of the repository. A fork is a copy of the repository under your GitHub account, allowing you to make and push changes to it.
1834

19-
Maintaining Issues
20-
==================
35+
To create a fork, navigate to the `Tethys Platform repository on GitHub <https://github.com/tethysplatform/tethys>`_ and click the "Fork" button in the top right corner. This will create a copy of the repository under your account, which you can clone to your local machine and make changes.
36+
37+
.. _contribute_feature_branch:
38+
39+
Create a Feature Branch
40+
=======================
2141

22-
Commenting
23-
Referencing in PRs
24-
Tags
25-
Assigning
42+
The process begins with creating a new branch from the `main` branch, often referred to as a "feature branch". This branch is where you will make your changes, whether it's adding a new feature, fixing a bug, or updating documentation. Naming the branch descriptively helps others understand the purpose of the changes. Examples of good feature branch names include: `add-user-authentication`, `fix-404-error`, or `issue-987`.
2643

44+
.. _contribute_make_changes:
2745

46+
Make Changes
47+
============
2848

29-
Testing
30-
=======
49+
Once you have created a feature branch, you can start making your changes. This may involve adding new code, modifying existing code, fixing bugs, writing tests and/or updating documentation. It's important to follow the project's coding standards, best practices, and documentation guidelines to ensure that your changes are consistent with the rest of the codebase. Refer to the :ref:`contribute_checks` section below for a list of specific requirements. This helps maintain a clean and organized codebase and makes it easier for others to understand and contribute to the project.
50+
51+
Refer to the following documentation for help with writing tests and documentation:
3152

3253
.. toctree::
3354
:maxdepth: 1
3455

3556
testing
57+
documentation
3658

37-
Submitting Pull Request
38-
=======================
59+
.. _contribute_pull_request:
60+
61+
Open a Pull Requests
62+
====================
63+
64+
Once your changes are complete, you should push the branch to GitHub and open a `Pull Request (PR) <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests>`_. A Pull Request allows others to review your changes, discuss potential improvements, and ensure that the code meets the project's standards. It's also an opportunity to run automated tests to catch any issues before merging.
65+
66+
When creating a Pull Request, it's important to include a clear and concise description of the changes, including the motivation behind the changes, any relevant context, and any potential side effects. This helps reviewers understand the purpose of the changes and provide meaningful feedback. You should also reference related Issues, Pull Requests, or Discussions in the description to provide additional context.
67+
68+
Assign yourself and any other contributors that worked on the changes as Assignees on the pull request.
69+
70+
Assign at least one of the following `Labels <https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels>`_ to the Pull Request. The labels are used to group and summarize the changes in the release notes when a new version of Tethys Platform is released.
71+
72+
* `experimental` - For experimental features or changes that are not yet stable.
73+
* `enhancement` - For improvements to existing features.
74+
* `minor feature` - For small feature additions.
75+
* `major feature` - For significant new features or changes.
76+
* `bugfix` - For bug fixes or issues that need to be resolved.
77+
* `docs` - For documentation updates.
78+
* `security` - For security-related changes or updates.
79+
80+
.. _contribute_code_review:
81+
82+
Code Review
83+
===========
84+
85+
Once the Pull Request has been opened, it will be reviewed by other one or more of the project maintainers as per the requirements in the `Project By-Laws <https://www.tethysplatform.org/project-steering-committee>`_. Code reviews are an essential part of the development process, providing an opportunity to ensure that the code meets the project's standards, follows best practices, and is well-documented. Reviewers will provide feedback, suggest improvements, and ask questions to help improve the quality of the code. Please respond to the feedback in a timely manner and make any necessary changes to address the comments.
86+
87+
Code reviewers should follow these guide lines when providing feedback on Pull Requests:
88+
89+
1. **Be Respectful and Inclusive**: Ensure your feedback is respectful and inclusive. Acknowledge the effort put into the changes and encourage a positive and collaborative atmosphere.
90+
91+
2. **Be Constructive**: Provide feedback that is helpful and aimed at improving the code. Avoid personal comments that target the author and focus on the code itself.
92+
93+
3. **Provide Specific Feedback**: Offer clear and specific feedback. Add comments to exact lines of code that need improvement and explain why. Provide examples or code suggestions when possible.
94+
95+
4. **Ask Questions**: If something is unclear, ask questions to gain a better understanding of the changes. This can help clarify ambiguities and ensure that the code meets the project's requirements.
96+
97+
5. **Consider the Context**: Take into account the context of the changes, the project's goals, and the needs of the users. Ensure that the changes align with the overall direction of the project.
98+
99+
6. **Check for Consistency**: Ensure that the code follows the project's coding style standards and is constistent with the surrounding code. Consistent code is easier to read, maintain, and reduces the likelihood of errors.
100+
101+
7. **Test the Changes**: If possible, test the changes locally to verify that they work as expected. Look for any potential issues or edge cases that may not have been considered.
102+
103+
8. **Check for Tests and Documentation**: Most changes should include tests to verify the functionality and documentation to explain how to use the new feature or fix. Ensure that the tests are comprehensive and the documentation is clear and accurate.
104+
105+
9. **Be Timely**: Provide feedback in a timely manner to keep the development process moving forward. Delays in code reviews can slow down the entire project.
106+
107+
.. _contribute_checks:
108+
109+
Checks
110+
======
111+
112+
Tethys Platform makes use of GitHub Actions to automate various checks on Pull Requests. These checks help ensure that the code meets the project's standards, is well-tested, and is properly documented. When opening a Pull Request, the following checks will be run automatically:
113+
114+
Code Style
115+
----------
116+
117+
The code style check ensures that the code follows the project's coding standards and best practices. This includes formatting, naming conventions, and code structure. The code style check helps maintain consistency across the codebase and makes the code easier to read and maintain. The following code style checks are run:
118+
119+
* **Formatting** - `Black <https://black.readthedocs.io/en/stable/>`_ is a code formatter that automatically formats the code to adhere to the project's coding standards. If running Black identifies any format changes that need to be made, the check will fail.
120+
121+
* **Linting** - The `Flake8 <https://flake8.pycqa.org/en/latest/>`_ linter is used to verify the code style conforms to Python best practices. If Flake8 identifies any code style issues, referred to as "lint", the check will fail.
122+
123+
Testing and Coverage
124+
--------------------
125+
126+
The tests suite will be run everytime a new pull request is made or new changes are pushed to an branch associated with an open pull request. In addition, a coverage tool is used to analyze the code coverage of the tests. The coverage tool will generate a report that shows which parts of the code are covered by the tests and which parts are not. The following checks are run:
127+
128+
* **Python Tests** - The Python test suite is run run once for each combination of supported Python version x Django version x operating system to ensure compatibility across different environments. If any of the Python tests fail, this check will fail.
129+
130+
* **Python Test Coverage** - The `coverage <https://coverage.readthedocs.io/en/6.0.1/>`_ tool is used to measure the code coverage of the tests and then it is published to `Coveralls <https://coveralls.io/github/tethysplatform/tethys>`_. This check will fail if the code coverage reports less than 100% test coverage on Python code.
131+
132+
Docker Build and Start-up Test
133+
------------------------------
134+
135+
The Docker build check ensures that the Docker image can be built successfully. Upon successful build, the image is run to verify that it will start up with out issue. These checks helps ensure that the Docker image can be deployed and run without issues. The following checks are run:
136+
137+
* **Docker Build** - The Docker image is built using the Dockerfile in the repository. It is built once for each combination of supported Python version x Django version. If the build fails, this check will fail.
138+
* **Docker Start-up Test** - Each Docker image built is run to verify that it starts up successfully. If any of the Salt steps fail during start-up, this check will fail.
139+
140+
Condor Build
141+
------------
142+
143+
The Condor build check ensures that the Condor package can be built successfully. The following checks are run:
144+
145+
* **Condor Build** - The Condor package is built using a Conda recipe that is automatically generated. If the build fails, this check will fail.
146+
147+
Docs Build
148+
----------
149+
150+
The docs build check ensures that the documentation can be built successfully. The updated documentation can be previewed on Read the Docs by clicking on the link on the check. The following checks are run:
151+
152+
* **Docs Build** - The documentation is built using `Sphinx <https://www.sphinx-doc.org/en/master/>`_. If the build fails, this check will fail.
39153

40-
* Tags
41-
* Assignees
42-
* Checks
43-
* Code Review
44-
* Merging
45-
* Referencing related issues
154+
.. _contribute_merge:
46155

156+
Merge into `main` Branch
157+
========================
47158

159+
After the Pull Request has been reviewed and approved, it can be merged into the `main` branch. This ensures that the main branch always contains stable and tested code. Following the merge, the feature branch *should be deleted*, and the process can start again for the next set of changes. This iterative approach helps maintain a clean and organized codebase while facilitating continuous integration and delivery.

0 commit comments

Comments
 (0)