Skip to content

Commit 44b8e84

Browse files
authored
Merge branch 'release-3.6.0-temp' into release-3.8.0
2 parents aa94a5a + 50e2180 commit 44b8e84

218 files changed

Lines changed: 49759 additions & 240 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/commit-lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Commit Compliance
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code with submodule
13+
uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.ref }}
16+
submodules: true
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 18
23+
24+
- name: Install dependencies
25+
run: npm ci --legacy-peer-deps
26+
27+
- name: Run commitlint on PR
28+
run: |
29+
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: TestCase Coverage Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
permissions: {}
8+
9+
jobs:
10+
build_and_check_coverage:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
25+
- name: Cache Maven dependencies
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.m2
29+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: |
31+
${{ runner.os }}-m2-
32+
33+
- name: Build with Maven
34+
run: mvn clean verify
35+
36+
- name: Run Coverage Check
37+
uses: madrapps/jacoco-report@v1.7.2
38+
with:
39+
paths: target/site/jacoco/jacoco.xml
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
min-coverage-overall: 40
42+
min-coverage-changed-files: 60
43+
title: Code Coverage Report
44+
comment-type: pr_comment

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ hs_err_pid89928.log
3636

3737
# Properties
3838
src/main/environment/common_local.properties
39+
40+
41+
node_modules

.husky/commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
npx lint-staged

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,48 @@ Prerequisites
3333
## API Guide
3434
Detailed information on API endpoints can be found in the [API Guide](https://piramal-swasthya.gitbook.io/amrit/architecture/api-guide).
3535

36+
## Setting Up Commit Hooks
37+
38+
This project uses Git hooks to enforce consistent code quality and commit message standards. Even though this is a Java project, the hooks are powered by Node.js. Follow these steps to set up the hooks locally:
39+
40+
### Prerequisites
41+
- Node.js (v18 or later)
42+
- npm (comes with Node.js)
43+
44+
### Setup Steps
45+
46+
1. **Install Node.js and npm**
47+
- Download and install from [nodejs.org](https://nodejs.org/)
48+
- Verify installation with:
49+
```
50+
node --version
51+
npm --version
52+
```
53+
2. **Install dependencies**
54+
- From the project root directory, run:
55+
```
56+
npm ci
57+
```
58+
- This will install all required dependencies including Husky and commitlint
59+
3. **Verify hooks installation**
60+
- The hooks should be automatically installed by Husky
61+
- You can verify by checking if the `.husky` directory contains executable hooks
62+
### Commit Message Convention
63+
This project follows a specific commit message format:
64+
- Format: `type(scope): subject`
65+
- Example: `feat(login): add remember me functionality`
66+
Types include:
67+
- `feat`: A new feature
68+
- `fix`: A bug fix
69+
- `docs`: Documentation changes
70+
- `style`: Code style changes (formatting, etc.)
71+
- `refactor`: Code changes that neither fix bugs nor add features
72+
- `perf`: Performance improvements
73+
- `test`: Adding or fixing tests
74+
- `build`: Changes to build process or tools
75+
- `ci`: Changes to CI configuration
76+
- `chore`: Other changes (e.g., maintenance tasks, dependencies)
77+
Your commit messages will be automatically validated when you commit, ensuring project consistency.
3678
3779
## Usage
3880
All features have been exposed as REST endpoints. Refer to the SWAGGER API specification for details.

commitlint.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'body-leading-blank': [1, 'always'],
5+
'body-max-line-length': [2, 'always', 100],
6+
'footer-leading-blank': [1, 'always'],
7+
'footer-max-line-length': [2, 'always', 100],
8+
'header-max-length': [2, 'always', 100],
9+
'subject-case': [
10+
2,
11+
'never',
12+
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
13+
],
14+
'subject-empty': [2, 'never'],
15+
'subject-full-stop': [2, 'never', '.'],
16+
'type-case': [2, 'always', 'lower-case'],
17+
'type-empty': [2, 'never'],
18+
'type-enum': [
19+
2,
20+
'always',
21+
[
22+
'build',
23+
'chore',
24+
'ci',
25+
'docs',
26+
'feat',
27+
'fix',
28+
'perf',
29+
'refactor',
30+
'revert',
31+
'style',
32+
'test',
33+
],
34+
],
35+
}
36+
};

0 commit comments

Comments
 (0)