mohd-faraz

_blogs

// blogs / 20260629.md

Dev Log: June 29 Wrap-up

2026-06-29
#Java21#DevOps#Refactoring#BugFixing

Overview

Today was largely about closing the loop on a few days of heavy 'plumbing' and infrastructure work. I finally feel like the tech stack is in a stable place after the Java 21 jump, though I spent more time than I'd like to admit wrestling with deployment environment variables and protocol mismatches.

What I Worked On

The Java 21 Migration & Aftermath

I finally committed the migration to Java 21. It sounds like a simple version bump in the pom.xml and Dockerfile, but it’s never just that. I had to spend some time troubleshooting annotation processors—specifically getting Lombok to play nice with the new bytecode. It’s one of those 'invisible' tasks; the app looks the same to the user, but the developer experience feels much snappier and we're officially on a modern LTS version.

Wrangling Database Connections

I hit a frustrating snag while getting the production environment to talk to the database. The hosting platform provides a single connection string using the postgres:// protocol, but the JDBC driver is stubborn and specifically requires jdbc:postgresql://.

Instead of writing a complex string parser in the app code, I decided to break the connection parameters down into individual environment variables in my deployment config. It’s a bit more manual overhead in the yaml file, but it’s way more robust than trying to regex a URI on the fly.

# Breaking down the connection string for the JDBC driver
env:
  - name: DB_HOST
    valueFrom: { secretKeyRef: { name: db-spec, key: host } }
  - name: DB_NAME
    valueFrom: { secretKeyRef: { name: db-spec, key: database } }

Context-Aware Components

On the frontend, I spent some time refactoring how our core modules handle data. We had a few components that were strictly tied to one specific data type (like 'orders'), which made them useless for other parts of the app.

I updated the routing logic to pass a target_resource flag through the route data. Now, the component just checks its context on initialization and fetches the correct data schema accordingly. It’s much cleaner and saves me from the 'copy-paste' trap when building out new sections for distributors or vendors.

The 'Silent Failure' Bug

I also lost about twenty minutes to a classic 'derp' moment: a naming mismatch. The frontend was expecting contactPerson while the backend was sending name. No errors, no crashes—just a blank form and a very confused developer. I took the opportunity to go through the data decorators and standardize the field mapping across the board so this doesn't bite me again.

Wrapping Up

To make my life easier going forward, I wrote a quick Python helper script to handle database bootstrapping. It automates all the manual SQL I was running to set up new test environments. With the infra settled, I’m looking forward to getting back into pure feature work tomorrow.