Skip to content

Examplary Workflow

smartie2076 edited this page Nov 25, 2019 · 4 revisions

This guide is aimed at developers that do not have their programming workflow in place yet. Still, it is also interesting for developers interested in the workflows of their co-contributors.

1. Identify the feature you want to include

Developing the code further should always be based on an existing issue (a task). If that does not exist, create a new issue describing the feature that you want to integrate. This will give you a platform to discuss your changes with others. Assign yourself (your github account) to the issue.

A new feature is always based on an open issue

2. Generate your code

Solve your issue in-code. Don't forget commenting and avoid addressing too many issues at once, as to keep the readability of the code high. Ideally, you also write tests (pytests) to test the feature that you are adding. Edit the code

You should often re-run the tool or smaller batches of your code to track it's performance. Often re-run the tool or test smaller batches of code

3. Write commit messages

Write commit messages (compare CONTRIBUTING.md) for small, working batches of your code. This will make it easier for reviewers to assess the code you provide to the project. A good tool to write commit messages is [GitCola](https://git-cola.github.io/]. Create commit messages (imperative) to make the review process easier

4. Run pytest to check your feature locally

To check if existing tests Run tests of your feature locally

5. Push your tested code to the dev branch

When your feature is ready and all test run through, extend the CHANGELOG.mg:

[Future release 0.0.x] Added:

  • [Your added feature and added files] Changed:
  • [Your changes of existing code] Removed:
  • [Your removed files or features]

Then, push your feature to github. Always push to the developer branch (dev) and name the feature using following scheme: 'feature_name_description'. Describe what you did.

Push your tested code to the dev branch

Your feature now appears as a branch on github: Your feature now appears as a branch on github

6. Write a pull request

Create a pull request to merge your feature into the dev branch. In the description you can copy the above added changes that apply to your feature. Also add the issue that your feature closes.

Write a pull request

Automatically, the included tests will be run to check if the new feature messes up the dev branch. Check that the tests run through in travis

This is an error message that can occur: Example of travis error

You can also check which of the tests failed for your code. You then have to address the tests and change your code. Simply push to your branch 'feature_name_description' and the pull request will be updated. Find out the error that occurred in travis

Here is an example of travis running through successfully: Example of travis exiting successfully

7. Review loop

Now, another developer can review the code and either accept it or enquire edits. Another developer reviews code and comments

8. Another developer merges your feature

At the and, the other developer will merge your feature into the dev branch. Another developer merges feature into dev branch

9. You delete the branch of your feature

After the pull request is closed, you should delete the branch 'feature_name_description' to keep the github repro clean. Branch of specific feature is deleted