Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kavi-egov authored Dec 13, 2024
2 parents 7d3c4cb + 8072220 commit 4c2631f
Show file tree
Hide file tree
Showing 359 changed files with 15,721 additions and 43,559 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/branch-name-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Enforce Branch Naming Convention

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
branch-name-check:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Enforce branch naming convention
run: |
# Get the branch name
branch_name=$(echo "${GITHUB_REF#refs/heads/}")
# Define the branch name pattern
branch_regex="^(master|develop|(HCMPRE|HCMPOST|HCMSUB)-[0-9]{3,}-[a-zA-Z0-9-]+)$"
# Check if the branch name matches the pattern
if [[ ! "$branch_name" =~ $branch_regex ]]; then
echo "Branch name '$branch_name' does not follow the required naming convention."
echo "Branch names must follow the pattern: (HCMPRE|HCMPOST|HCMSUB)-123-description"
exit 1
fi
- name: Success message
run: |
branch_name=$(echo "${GITHUB_REF#refs/heads/}")
echo "Branch name '$branch_name' follows the required naming convention: 'master', 'develop', or (HCMPRE|HCMPOST|HCMSUB)-123-description"
64 changes: 0 additions & 64 deletions .github/workflows/buildWorkbenchUI.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/publishAllPackages.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/publishAllPackagesRelease.yml

This file was deleted.

115 changes: 55 additions & 60 deletions .github/workflows/publishProjectFactory.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,72 @@
name: project factory service docker Image CI
name: Project Factory Service Test Builder

on:
push:
branches: [ "campaign" ]
branches:
- "console"
- "master"
paths:
- 'utilities/project-factory/**'
- 'health-services/project-factory/**'
pull_request:
branches: [ "campaign" ]
branches:
- "console"
- "master"

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for tags and branches
# Step 1: Checkout the repository
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for tags and branches

- name: Set up environment variables
id: env
run: |
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "ACTION_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "COMMIT_ID=${GITHUB_SHA: -8}" >> $GITHUB_ENV # Extract last 8 characters of SHA
# Step 2: Set up environment variables
- name: Set up environment variables
id: env
run: |
echo "ACTION_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: Build the service Docker image
id: docker_build
working-directory: ./utilities/project-factory
run: |
IMAGE_TAG=egovio/project-factory:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }}
docker build . \
--file Dockerfile \
--tag $IMAGE_TAG
echo "::set-output name=image_name::$IMAGE_TAG"
# Step 3: Build the service Docker image
- name: Build the service Docker image
id: docker_build
working-directory: ./health-services/project-factory
run: |
IMAGE_TAG=egovio/project-factory:${{ env.ACTION_NUMBER }}
docker build . \
--file Dockerfile \
--tag $IMAGE_TAG
echo "::set-output name=image_name::$IMAGE_TAG"
echo "Service Docker image built successfully"
# Step 4: Build the database migration Docker image
- name: Build the DB migration Docker image
id: docker_db_build
working-directory: ./health-services/project-factory/migration
run: |
IMAGE_TAG=egovio/project-factory-db:${{ env.ACTION_NUMBER }}
docker build . \
--file Dockerfile \
--tag $IMAGE_TAG
echo "::set-output name=db_image_name::$IMAGE_TAG"
echo "DB migration Docker image built successfully"
- name: Build the db migration Docker image
id: docker_db_build
working-directory: ./utilities/project-factory/migration
run: |
IMAGE_TAG=egovio/project-factory-db:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }}
docker build . \
--file Dockerfile \
--tag $IMAGE_TAG
echo "::set-output name=db_image_name::$IMAGE_TAG"
node_build:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- uses: actions/checkout@v3

# Step 2: Set up Node.js environment
- uses: actions/setup-node@v2
with:
node-version: 20

- name: Login to Docker Hub and Push Docker Image
working-directory: ./utilities/project-factory
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
IMAGE_NAME: ${{ steps.docker_build.outputs.image_name }}
run: |
# Authenticate with Docker Hub
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Push the image to Docker Hub
docker push $IMAGE_NAME
echo "Docker image pushed: $IMAGE_NAME"
- name: Login to Docker Hub and Push DB Migration Docker Image
working-directory: ./utilities/project-factory/migration
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DB_IMAGE_NAME: ${{ steps.docker_db_build.outputs.db_image_name }}
run: |
# Authenticate with Docker Hub
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Push the image to Docker Hub
docker push $DB_IMAGE_NAME
echo "Docker image pushed: $DB_IMAGE_NAME"
# Step 3: Install dependencies and build for production
- name: Install dependencies and build
working-directory: ./health-services/project-factory
run: |
yarn install
yarn build
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "localhost",
"port": 9229,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.inlineSuggest.showToolbar": "onHover"
}
4 changes: 3 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* @kavi-egov @sathishp-eGov @shashwat-egov
* @kavi-egov @sathishp-eGov

health-services/project-factory/ @jagankumar-egov
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ public HRMSUtil(ServiceRequestRepository serviceRequestRepository, PGRConfigurat

/**
* Gets the list of department for the given list of uuids of employees
* @param uuids
*
* @param uuids user uuids
* @param employeeUuids employee uuids
* @param requestInfo
* @return
*/
public List<String> getDepartment(List<String> uuids, RequestInfo requestInfo){
public List<String> getDepartment(List<String> uuids, List<String> employeeUuids, RequestInfo requestInfo){

StringBuilder url = getHRMSURI(uuids);
StringBuilder url = getHRMSURI(employeeUuids);

RequestInfoWrapper requestInfoWrapper = RequestInfoWrapper.builder().requestInfo(requestInfo).build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,12 @@ private void validateDepartment(ServiceRequest request, Object mdmsData){
String serviceCode = request.getService().getServiceCode();
List<String> assignes = request.getWorkflow().getAssignes();

List<String> hrmsAssignes = request.getWorkflow().getHrmsAssignees();

if(CollectionUtils.isEmpty(assignes))
return;

List<String> departments = hrmsUtil.getDepartment(assignes, request.getRequestInfo());
List<String> departments = hrmsUtil.getDepartment(assignes, hrmsAssignes, request.getRequestInfo());

String jsonPath = MDMS_DEPARTMENT_SEARCH.replace("{SERVICEDEF}",serviceCode);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public ResponseEntity<String> requestsUpdatePost() throws IOException {
public ResponseEntity<List<String>> requestsTest(@RequestBody RequestInfoWrapper requestInfoWrapper,
@RequestParam String tenantId, @RequestParam List<String> uuids) {

List<String> department = hrmsUtil.getDepartment(uuids, requestInfoWrapper.getRequestInfo());
List<String> department = hrmsUtil.getDepartment(uuids, uuids, requestInfoWrapper.getRequestInfo());

return new ResponseEntity<>(department, HttpStatus.OK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public class Workflow {
@Valid
private List<String> assignes = null;

@JsonProperty("hrmsAssignes")
@Valid
private List<String> hrmsAssignees = null;

@SafeHtml
@JsonProperty("comments")
private String comments = null;
Expand Down
4 changes: 4 additions & 0 deletions core-services/service-request/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
All notable changes to this module will be documented in this file.

## 1.0.1 - 2024-08-29

- Added `BOOLEAN` DataType in `AttributeDefinition`

## 1.0.0

- Base version
2 changes: 1 addition & 1 deletion core-services/service-request/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<artifactId>service-request</artifactId>
<packaging>jar</packaging>
<name>service-request</name>
<version>1.0.0</version>
<version>1.0.1</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public enum DataTypeEnum {

MULTIVALUELIST("MultiValueList"),

FILE("File");
FILE("File"),

BOOLEAN("Boolean");

private String value;

Expand Down
Loading

0 comments on commit 4c2631f

Please sign in to comment.