A code review / pull request is supposed to be a discussion among professionals about how to make the code the best it can be. This includes:
- (Onboarding)
-- Making sure you use common style / naming conventions so that code is readable as different developers work on it
-- Making sure you use common design patterns / dependencies / collections / ect, so that as different developers come in and out of a module, no one needs to re-learn things that just need to be the same
[edit] -- Sometimes it's just hard for newcomers to know all the gotchas and longterm consequences. These should be patiently explained.
- Readability: Make sure that variable / class / method names make sense
- Ask questions: Sometimes a question in a code review means you need to add a comment in code
- Knowledge transfer: A reviewer may have more experience with a specific API / pattern / technique
Without knowing the specifics of your situation: It could be that your senior colleague just can't "let go" of the fact that they didn't write the code; or it could be a situation where your changes just don't fit with the overall architecture, style, ect. Most likely, one or both of you need to swallow your ego and prioritize the code over your own personal preferences.
Side note: In general, you should always follow existing style / patterns / conventions in existing code, unless there is a very clear tangible problem with it. (IE, if all variables have 1-letter names and there's no tabbing, you probably don't want to follow style.)
Anecdote:
A few years ago, I got a surprise review request from someone from another team. They completely bypassed our dependency injection pattern and did "their own thing." The way they did it was a perfectly fine pattern, but it didn't match the pattern with the rest of the product. Long-term, it would create a huge maintenance problem if there were 1-off modules that used different patterns.
I'm sure the other party thought that my review "can be summarized as his preference for doing things," but that wasn't the case: I was more concerned about long-term maintainability when other people needed to maintain their new code.
Anecdote 2:
In other cases, I sometimes block a review on confusing variable names. Yes, naming a variable "file" might make sense to a newcomer, but after working with the codebase for a long time, I know that "fileHandle", "filePath", ect, are much more readable.
[Edit 2]:
> also alters the relationship with that person for bad.
Talk to your manager about that.