diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 829126e1a..a17b59ec5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ find explanation about most of the development workflows for LibreTime. - [Suggesting enhancements](#suggesting-enhancements) - [Financially](https://libretime.org/contribute#financial) - [Contributing to documentation](https://libretime.org/contribute#write-documentation) -- [Contributing to code](https://libretime.org/contribute#code) +- [Contributing to code](#code) ## Reporting bugs @@ -62,8 +62,68 @@ as possible. Fill in [the template](https://github.com/libretime/libretime/issue including the steps that you imagine you would take if the feature you're requesting existed. -## Code, documentation and financial contributions +## Code -More information about how to contribute code, documentation or financially +Are you familiar with coding in PHP or Python? Have you made projects in +Liquidsoap and some of the other services we use? Take a look at the +[list of bugs and feature requests](https://github.com/LibreTime/libretime/issues), +and then fork our repo and have a go! Just use the **Fork** button at the top of +our [GitHub page](https://github.com/LibreTime/libretime), clone the forked repo +to your desktop, open up a favorite editor and make some changes, and then +commit, push, and open a pull request. + +Knowledge on how to use [Github](https://guides.github.com/activities/hello-world/) +and [Git](https://git-scm.com/docs/gittutorial) will suit you well, use the +links for a quick 101. + +LibreTime uses the [black](https://github.com/psf/black) coding style for Python +and you must ensure that your code follows it. If not, the CI will fail and your +Pull Request will not be merged. Similarly, the Python import statements are +sorted with [isort](https://github.com/pycqa/isort). There is configuration +provided for [pre-commit](https://pre-commit.com/), which will ensure that code +matches the expected style and conventions when you commit changes. It is set up +by running: + +```bash +sudo apt install pre-commit +pre-commit install +``` + +You can also run it anytime using: + +```bash +pre-commit run --all-files +``` + +## Testing and CI/CD + +Before submitting code to the project, it's a good idea to test it first. To do +this, it's easiest to install LibreTime in a virtual machine on your local +system or in a cloud VM. We have instructions for setting up a virtual instance +of LibreTime with [Vagrant](/docs/vagrant) and [Multipass](/docs/multipass). + +If you would like to try LibreTime in a Docker image, Odclive has instructions +[here](https://github.com/kessibi/libretime-docker) for setting up a test image +and a more persistent install. + +## Modifying the Database + +LibreTime is designed to work with a [PostgreSQL](https://www.postgresql.org/) +database server running locally. LibreTime uses [PropelORM](http://propelorm.org) +to interact with the ZendPHP components and create the database. The version 2 +API uses Django to interact with the same database. + +If you are a developer seeking to add new columns to the database here are the steps. + +1. Modify `airtime_mvc/build/schema.xml` with any changes. +2. Run `dev_tools/propel_generate.sh` +3. Update the upgrade.sql under `airtime_mvc/application/controllers/upgrade_sql/VERSION` for example + `ALTER TABLE imported_podcast ADD COLUMN album_override boolean default 'f' NOT NULL;` +4. Update the models under `api/libretimeapi/models/` to reflect the new + changes. + +## Documentation and financial contributions + +More information about how to contribute documentation or financially through our [OpenCollective](https://opencollective.com/libretime) can be found on our [website](https://libretime.org/contribute). diff --git a/docs/_docs/contribute.md b/docs/_docs/contribute.md index f1cf30ee7..7aa3d07c6 100644 --- a/docs/_docs/contribute.md +++ b/docs/_docs/contribute.md @@ -95,63 +95,3 @@ directory and run bundle install jekyll serve ``` - -## Code - -Are you familiar with coding in PHP or Python? Have you made projects in -Liquidsoap and some of the other services we use? Take a look at the -[list of bugs and feature requests](https://github.com/LibreTime/libretime/issues), -and then fork our repo and have a go! Just use the **Fork** button at the top of -our [GitHub page](https://github.com/LibreTime/libretime), clone the forked repo -to your desktop, open up a favorite editor and make some changes, and then -commit, push, and open a pull request. - -Knowledge on how to use [Github](https://guides.github.com/activities/hello-world/) -and [Git](https://git-scm.com/docs/gittutorial) will suit you well, use the -links for a quick 101. - -LibreTime uses the [black](https://github.com/psf/black) coding style for Python -and you must ensure that your code follows it. If not, the CI will fail and your -Pull Request will not be merged. Similarly, the Python import statements are -sorted with [isort](https://github.com/pycqa/isort). There is configuration -provided for [pre-commit](https://pre-commit.com/), which will ensure that code -matches the expected style and conventions when you commit changes. It is set up -by running: - -```bash -sudo apt install pre-commit -pre-commit install -``` - -You can also run it anytime using: - -```bash -pre-commit run --all-files -``` - -## Testing and CI/CD - -Before submitting code to the project, it's a good idea to test it first. To do -this, it's easiest to install LibreTime in a virtual machine on your local -system or in a cloud VM. We have instructions for setting up a virtual instance -of LibreTime with [Vagrant](/docs/vagrant) and [Multipass](/docs/multipass). - -If you would like to try LibreTime in a Docker image, Odclive has instructions -[here](https://github.com/kessibi/libretime-docker) for setting up a test image -and a more persistent install. - -## Modifying the Database - -LibreTime is designed to work with a [PostgreSQL](https://www.postgresql.org/) -database server running locally. LibreTime uses [PropelORM](http://propelorm.org) -to interact with the ZendPHP components and create the database. The version 2 -API uses Django to interact with the same database. - -If you are a developer seeking to add new columns to the database here are the steps. - -1. Modify `airtime_mvc/build/schema.xml` with any changes. -2. Run `dev_tools/propel_generate.sh` -3. Update the upgrade.sql under `airtime_mvc/application/controllers/upgrade_sql/VERSION` for example - `ALTER TABLE imported_podcast ADD COLUMN album_override boolean default 'f' NOT NULL;` -4. Update the models under `api/libretimeapi/models/` to reflect the new - changes.