Home Code Smell Series: Naming smells - Part 2
Post
Cancel

Code Smell Series: Naming smells - Part 2

…Ahem…Why I still see non-sense naming?

I recall encountering a few naming smells in the legacy system, during migration activity. There I saw three files with similar name in the production infrastructure code.

Context

As per new business requirement, I had to make some enhancements to the existing service to use different authorization tokens based on environments. Config/Code level changes were pretty straight forward.

I encountered an actual problem when I wanted to deploy my changes to a non-dev environment (like release assurance and Prod). There, I needed to add some additional changes to Jenkins credentials, deployment pipeline code, and helm chart.

The Problem

1
2
3
Prod.yaml
Prod-new.yaml
Prod-new-new.yaml

I saw the above three files for both release assurance and production environment. In that legacy system, no active development was happening. When I checked git logs for the latest changes, I failed to figure out which file I needed to change. Only one of those configurations is in use in the deployment pipeline.

Which one is it?

funny image

After checking the commit, I saw all three was updated same time. It is weird. Why does someone updated all three files when only one is in used?

You may say, It could be to have a backup of the configuration. As git is been used for a long time, I don’t see any reason for the backup. If you want to revert to 1 month older configurations, you can easily do it.

Ok, I already spent more than 20 mins, and I was thinking prod.yaml should be the one, but to double confirm, I checked with the infra folks for what file I have to update, and there I came to know I have to update prod-new-new.yaml.
funny image

What? Why this weird naming format?

I don’t understand this naming convention. This naming is adding confusion instead of bringing clarity.

I asked the same question, but they were saying, Pravin that been there for a long time, and what can we do? I don’t understand How come that change at that time got approved.

 

You have something to share, go ahead and add in comments 😉 » Happy Learning!!

This post is licensed under CC BY 4.0 by the author.

Code Smell Series: Naming smells - Part 1

Code Smell Series: Shh…something is happening there

Comments powered by Disqus.