diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6ee3ec6..3f4254a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,10 +1,4 @@ -# List of source code paths and code owners -# For more information on the CODEOWNERS file go to: -# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax - -# Uncomment line 10 and add the correct owners's usernames. -# These owners will be the default owners for everything in -# the repo. Unless a later match takes precedence, -# @global-owner1 and @global-owner2 will be requested for -# review when someone opens a pull request. -* @global-owner1 @global-owner2 +# MAINTAINERS: +# Raghav Agarwal (@raghav-agarwal) +# Aditi Aggarwal (@aditi2205) +# Sonam Shenoy (@sonamkshenoy) \ No newline at end of file diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..da6298e --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,12 @@ +# Security Policy + +## Supported Versions + + +| Version | Supported | +| ------- | ------------------ | +| 11 | JAVA | + +## Reporting a Vulnerability + +To report a vulnerability, please raise an issue on this repo under the issues tab. diff --git a/.github/badges/branches.json b/.github/badges/branches.json new file mode 100644 index 0000000..7fe5ff2 --- /dev/null +++ b/.github/badges/branches.json @@ -0,0 +1 @@ +{"color": "#97ca00", "label": "branches", "message": "95.4%", "schemaVersion": 1} \ No newline at end of file diff --git a/.github/badges/branches.svg b/.github/badges/branches.svg new file mode 100644 index 0000000..f5def75 --- /dev/null +++ b/.github/badges/branches.svg @@ -0,0 +1 @@ +branches95.4% \ No newline at end of file diff --git a/.github/badges/jacoco.json b/.github/badges/jacoco.json new file mode 100644 index 0000000..396c159 --- /dev/null +++ b/.github/badges/jacoco.json @@ -0,0 +1 @@ +{"color": "#97ca00", "label": "coverage", "message": "99.2%", "schemaVersion": 1} \ No newline at end of file diff --git a/.github/badges/jacoco.svg b/.github/badges/jacoco.svg new file mode 100644 index 0000000..a1f1afb --- /dev/null +++ b/.github/badges/jacoco.svg @@ -0,0 +1 @@ +coverage99.2% \ No newline at end of file diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..3435ce7 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,11 @@ +Documentation: +- any: ['**/*.txt', '**/*.md, docs/**'] + +Actions: +- '.github/workflows/*' + +Tests: +- all: ['src/test/**', '**/*.java'] + +Code: +- all: ['src/main/**', '**/*.java'] diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml new file mode 100644 index 0000000..87171c9 --- /dev/null +++ b/.github/workflows/maven-build.yml @@ -0,0 +1,64 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Java CI with Maven + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 for x64 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + architecture: x64 + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Update dependency graph + uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 + + - name: Generate JaCoCo Badge + id: jacoco + uses: cicirello/jacoco-badge-generator@v2 + with: + generate-coverage-badge: true + generate-coverage-endpoint: true + generate-branches-endpoint: true + generate-branches-badge: true + + - name: Log coverage percentage + run: | + echo "coverage = ${{ steps.jacoco.outputs.coverage }}" + echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" + + - name: Commit the badge (if it changed) + run: | + if [[ `git status --porcelain` ]]; then + git config --global user.name 'Raghav Agarwal' + git config --global user.email 'bly.raghav@gmail.com' + git add -A + git commit -m "Autogenerated JaCoCo coverage badge" + git push + fi + + - name: Upload JaCoCo coverage report + uses: actions/upload-artifact@v2 + with: + name: jacoco-report + path: target/site/jacoco/ diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml new file mode 100644 index 0000000..fca5005 --- /dev/null +++ b/.github/workflows/pr-labeler.yml @@ -0,0 +1,24 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: [pull_request] + +jobs: + label: + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.RWPULSE_ACCESS_TOKEN }}" + sync-labels: true + dot: true diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml new file mode 100644 index 0000000..54828f1 --- /dev/null +++ b/.github/workflows/publish-central.yml @@ -0,0 +1,40 @@ +name: Publish package to the Maven Central Repository + +on: + release: + types: [ published ] + +jobs: + release: + name: Release on Sonatype OSS + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: 11 + distribution: 'adopt' + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Set up Apache Maven Central + uses: actions/setup-java@v2 + with: # running setup-java again overwrites the settings.xml + java-version: 11 + distribution: 'adopt' + server-id: ossrh + server-username: OSSRH_USERNAME + server-password: OSSRH_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Publish to Apache Maven Central + run: mvn -Prelease deploy + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 0000000..45396b7 --- /dev/null +++ b/.github/workflows/release-build.yml @@ -0,0 +1,19 @@ +# If the PR has the label release:major, release:minor, or release:patch, this will override bump_version_scheme. +# https://github.com/marketplace/actions/release-tag-new-action +on: + push: + branches: + - master + +jobs: + release-on-push: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.RWPULSE_ACCESS_TOKEN }} + steps: + - id: release + name: Release Tag + uses: rymndhng/release-on-push-action@master + with: + bump_version_scheme: minor + tag_prefix: v diff --git a/.github/workflows/stale-pr-issues.yml b/.github/workflows/stale-pr-issues.yml new file mode 100644 index 0000000..9ca006c --- /dev/null +++ b/.github/workflows/stale-pr-issues.yml @@ -0,0 +1,29 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '0 10 * * *' + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v5 + with: + repo-token: ${{ secrets.RWPULSE_ACCESS_TOKEN }} + stale-issue-message: 'Stale issue message' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' + days-before-issue-stale: 180 + days-before-pr-stale: 10 diff --git a/README.md b/README.md index 8f1ddf5..250c6da 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +[![Build Status](https://github.com/intuit/chain-z/actions/workflows/maven-build.yml/badge.svg)](https://github.com/intuit/chain-z/actions/workflows/maven-build.yml) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.intuit.async/chain-z/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.intuit.async/chain-z) +![coverage](.github/badges/jacoco.svg) +![branches coverage](.github/badges/branches.svg) + + # RWebPulse RWebPulse is a ready to consume JAR library to easily integrate your springboot project with the latest reactive web-client offered by the spring. It is a one stop solution with config based initialisations, exception and retry handling. @@ -75,4 +81,4 @@ protected ClientHttpResponse executeRequest(final Map body) ## Local Development -[Local Development](./LOCAL_DEVELOPMENT.md) +[Local Development](./GETTING_STARTED.md)