Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace String concatenation with Log4j ParameterizedMessage for readability #943

Merged
merged 11 commits into from
Nov 11, 2024

Conversation

KirrTap
Copy link
Contributor

@KirrTap KirrTap commented Nov 4, 2024

Description

I have replaced string concatenation with Log4j ParameterizedMessage in 40 files.

Related Issues

Resolves #905

Check List

  • Commits are signed per the DCO using --signoff.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 42.77457% with 99 lines in your changes missing coverage. Please review.

Project coverage is 77.57%. Comparing base (9b9ebb2) to head (91fd142).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...framework/indices/FlowFrameworkIndicesHandler.java 38.09% 26 Missing ⚠️
...ework/transport/CreateWorkflowTransportAction.java 52.38% 10 Missing ⚠️
...rk/transport/ProvisionWorkflowTransportAction.java 18.18% 9 Missing ⚠️
.../transport/ReprovisionWorkflowTransportAction.java 30.76% 9 Missing ⚠️
...ch/flowframework/workflow/WorkflowStepFactory.java 0.00% 8 Missing ⚠️
...ramework/transport/GetWorkflowTransportAction.java 33.33% 4 Missing ⚠️
.../org/opensearch/flowframework/util/ParseUtils.java 0.00% 4 Missing ⚠️
...search/flowframework/workflow/UpdateIndexStep.java 33.33% 4 Missing ⚠️
...ework/workflow/AbstractRegisterLocalModelStep.java 50.00% 2 Missing and 1 partial ⚠️
...mework/workflow/AbstractRetryableWorkflowStep.java 50.00% 3 Missing ⚠️
... and 14 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #943      +/-   ##
============================================
- Coverage     78.07%   77.57%   -0.51%     
  Complexity      996      996              
============================================
  Files            99       99              
  Lines          4625     4722      +97     
  Branches        431      431              
============================================
+ Hits           3611     3663      +52     
- Misses          834      879      +45     
  Partials        180      180              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this PR!

Appreciate all the work -- one thing to note is that you don't need to do anything with values that are already just plain strings with nothing to insert into them. Just leave those alone.

Except, as indicated, when there are a lot of strings with similar text except for a few words, you might consider making a log message constant in the CommonValue class and using it in those places.

I stopped after several files, will let you submit an update before a more complete review.

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

One last request, please add an entry in CHANGELOG.md under the "Refactoring" header linking to this PR. After that it should be ready to merge.

Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KirrTap for the change

@owaiskazi19 owaiskazi19 merged commit 35b171e into opensearch-project:main Nov 11, 2024
19 of 20 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/flow-framework/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/flow-framework/backport-2.x
# Create a new branch
git switch --create backport/backport-943-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 35b171e34e3f3a003d4305694c7e4fdae0679860
# Push it to GitHub
git push --set-upstream origin backport/backport-943-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/flow-framework/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-943-to-2.x.

@opensearch-trigger-bot opensearch-trigger-bot bot added the backport-failed Applied to PRs when the automatic backport fails label Nov 11, 2024
@owaiskazi19
Copy link
Member

@KirrTap can you do a manual backport to 2.x change and raise a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport PRs to 2.x branch backport-failed Applied to PRs when the automatic backport fails
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace String concatenation with Log4j ParameterizedMessage for readability
3 participants