GSoC Week 06: I opened 11 pull requests

Manojlakshan
3 min readJun 15, 2024

--

Hello everyone,

Welcome back to my Week 6 blog about my journey at Google Summer of Code 2024. This week, I mainly focused on raising the pull request for the implementation work I completed over the past weeks. Additionally, I took some time to review feedback from my mentors, refine the code, and ensure everything met the project’s standards. I’ll tell about these PR with project objective

  1. Adding java 17 support ( PR: #62 )

I did not need to make any code changes to support Java 17, as the existing code built and compiled successfully with Java 17. I added a GitHub workflow to ensure compatibility with both Java 11 and Java 17. Additionally, I rewrote the GitHub workflow script to run with these versions using Travis CI.

# this build is designed to replicate the Travis CI workflow
name: Build with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
java-8:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn clean install --file pom.xml

java-11:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn clean install --file pom.xml

java-17:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn clean install --file pom.xml

2. Upgrade openMRS version from 1.9.9 to 2.0.0 (PR: #58)

When Upgrading the openMRS version , I had to change the dependency versions in the pom.xm file.

3. Refactor code with Lambda expressions and Stream API

In here, I focused on refactoring the code using lambda expressions and Stream APIs. This modernization aimed to improve both the readability and performance of the code.

refactor dao methods with stream API : #69

refactor getFilter method with stream API : #68

refactor getFlaggedPatients method with stream API and lambda expressions: #67

refactor purgePriority method with stream API: #66

refactor getFlagsForPatient method with stream API: #65

refactor getPatientFlags method with stream API: #64

refactor getFlags method using stream API and lambda expressions: #63

Other than the opened pull request, I refactored the methods “generatePatientFlags (Patient patient, FlagService service)” by adding batch savings. The current implementation of this method saves the generated patient flags one by one. this can lead to performance issues by increasing load on the database. The batch saving involve collecting all PatientFlag objects in a list and then performing a single batch save operation. This approach increases the performance of the module. I had a performance evaluation with the batch saving.

current module without batch saving : 79.9 milliseconds

current module with batch saving : 42.4 milliseconds

According to the evaluation results, batch processing could increase the performance of the patient flag module.

One of the best practices for developers is to write unit tests for new methods to ensure they work as expected. However, when I added a new unit test, I ran into a recurring problem, the module wasn’t running the tests correctly. This challenge has set up an important task for next week. I’ll be diving into the test configuration and setup to figure out why the unit tests aren’t running properly.

Stay tuned for more updates, and thank you for following along with my GSoC journey!

Thank you for the reading, Join me on this tech adventure! Follow my profile to stay updated on the cool world of technology and innovation. Your support means a lot, and I can’t wait to share more exciting stuff with you. Let’s stay connected for more insights and fun discoveries ahead!

Github: https://github.com/ManojLL

LinkedIn : https://www.linkedin.com/in/manoj-lakshan/

--

--