Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tarek360/koshry
Run on CI, Apply Rules on the Build and Get the Result back to the Pull Request.
https://github.com/tarek360/koshry
automation ci-pipeline ci-tools circleci codereview continuous-integration kotlin pull-request teamcity test-coverage travis-ci
Last synced: 2 months ago
JSON representation
Run on CI, Apply Rules on the Build and Get the Result back to the Pull Request.
- Host: GitHub
- URL: https://github.com/tarek360/koshry
- Owner: tarek360
- Created: 2018-09-07T18:12:57.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2019-08-09T10:39:39.000Z (over 5 years ago)
- Last Synced: 2024-04-16T12:30:52.067Z (9 months ago)
- Topics: automation, ci-pipeline, ci-tools, circleci, codereview, continuous-integration, kotlin, pull-request, teamcity, test-coverage, travis-ci
- Language: Kotlin
- Homepage:
- Size: 173 KB
- Stars: 58
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Koshry
## What's Koshry?
**Koshry**:
- is a dev tool, runs during your **CI Build** or on your **Local Machine Build**.
- gives your team the ability to monitor **pull requests** and take automatic **actions** depend on your rules result.
- create a report of the result of applying your rules on the pull request and post it back as a comment on the pull request.
- is written in **Kotlin** and runs on JVM.
- has some of the [ready rules](https://github.com/tarek360/koshry/wiki) for common use cases.
- is **customizable**, you can [write your own **Custom Rule**](https://medium.com/@Tarek360/your-first-koshry-rule-c6648ac34ca2), everything is a **Rule** in Koshry.
- works on any project whatever the programming language you use in your project## Run Koshry in 3 steps:
**1-** Add Koshry to your build process:
Gradle:
```gradle
implementation "io.github.tarek360.koshry:koshry:0.0.4"
```**2-** Invoke Koshry with one rule at least.
```kotlin
val koshryConfig = koshry {
rules {
rule = rule1
rule = rule2
}
}Koshry.run(koshryConfig)
```**3-** Add one environment variable to your CI.
Add your git host (Github for example) token as an environment variable to allow Koshry post a comment and update the commit status.
Use `KOSHRY_GIT_HOST_TOKEN` as a key of the environment variable.## Koshry Rules:
Each Koshry **Rule** does some work then returns a **Report** (or not) as a result of that work.While you can [create your own custom rule](https://medium.com/@Tarek360/your-first-koshry-rule-c6648ac34ca2), Koshry has some of the ready rules, you can make use of them directly.
These rules are applied to the **git diff** of the **pull request**.
- **LineRule**: Apply a **condition** to all of the **added** and **modified lines** in the pull request.
- **FileRule**: Apply a **condition** to all of the **added** and **modified files** in the pull request.
- **ProtectedFilesRule**: Protect a list of files to be changed by someone hasn't permission to make a change.**Check the [Wiki](https://github.com/tarek360/koshry/wiki) to know How to write Koshry Rules**
## Koshry works automatically with:
- CI
- [Travis CI](https://travis-ci.com)
- [circle ci](https://circleci.com)
- [TeamCity](https://www.jetbrains.com/teamcity)
- Git host:
- Github
## Contribution
- Feel free to fork and open a pull request.
- Open an issue if you found a bug or you need help.
## How does Kosrhy work?
In a brief, when you call `Koshry.run(koshryConfig)`, Koshry applies all the rules you have set and it aggregates all of the reports returned from the rules to one report, then it posts that report as a comment on the pull request.**Note**: Kosrhy applies all of the rules sequentially.
## I use Koshry in Koshry
I use Koshry here in this repository to apply some rules like **JaCoCo Test Coverage** rule to set the minimum percentage of test coverage of PRs, check Koshry report on one of my PRs [here](https://github.com/tarek360/koshry/pull/18)