Skip to content

jankatins/pr-workflow-example

Repository files navigation

PR Workflow Example

This repo allows someone to practice PRs like they would happen with open source projects. It assumes someone knows basic git but wants to learn how to interact with an open source repo.

See README_code.md for the regular readme.

Features

  • Multiple changes possible: python code, python tests, markdown docs
  • CI/CD pipeline (via Github actions) which runs linters and tests for python and linters for markdown files
    • Some errors get annotations: black, isort, and flake8 violations for python and any spelling errors
  • Aims at scaled trunk based development workflow with a main branch and short-lived feature branches
  • MIT licensed

Instruction

  1. Fork the repo
  2. Clone the repo from your personal fork (using ssh!)
  3. Add upstream to your local repo to enable pulling the latest changes from it: git remote add upstream https://github.com/jankatins/pr-workflow-example.git
  4. Create a new branch: git checkout -b 'new_feature'
  5. Initialize the virtualenv: poetry install and run the code: poetry run python -m calculator '1 + 1'
  6. Do changes in the code/text. See the README.md for Python code and docs
    • Coordinate with others to create merge conflicts by changing the same lines in the code in different ways
    • Add a changelog
  7. Check your code: first add your changes to the git index git add -u -p and then run poetry run pre-commit run --all-files (fix and repeat until all is fine)
  8. Commit git commit -m "Add new feature" and push to your fork: git push origin
  9. Create the PR in the github web ui: https://github.com/jankatins/pr-workflow-example
  10. Add additional changes by either additional commits or changing commits/rebases and force pushes
    • Fix CI/CD failures
    • Fix merge conflicts
  11. Wait for the maintainer to get it merged

Details


This project was generated using the wolt-python-package-cookiecutter template.