Skip to content

Merge the latest coyote into the latest dogfish#493

Merged
yingbull merged 4 commits intodevelop/dogfishfrom
coyote-dogfish-merge
Sep 6, 2025
Merged

Merge the latest coyote into the latest dogfish#493
yingbull merged 4 commits intodevelop/dogfishfrom
coyote-dogfish-merge

Conversation

@kateyang1998
Copy link
Copy Markdown

@kateyang1998 kateyang1998 commented Aug 31, 2025

  1. Created a branch based off the latest develop/coyote, named coyote-backup
  2. Created a branch based off the latest develop/dogfish, named coyote-dogfish-merge
  3. Merged coyote-backup into coyote-dogfish-merge, and resolved the conflicts
  4. Now merging the up-to-date coyote-dogfish-merge into the latest develop/dogfish.

Summary by Sourcery

Merge the latest coyote develop branch into dogfish and clean up the CaseManagementEntry2Action class by streamlining request-to-session parameter handling and removing dead/commented-out code

Enhancements:

  • Streamline session attribute management for note_sort, filter_roles, filter_providers, and issues by only setting or removing based on actual parameter presence
  • Remove large blocks of commented-out legacy code and unused statements to tidy up the action class

@kateyang1998 kateyang1998 requested a review from yingbull August 31, 2025 13:49
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Aug 31, 2025

Reviewer's Guide

This PR integrates the latest ‘coyote’ branch into ‘develop/dogfish’ by resolving merge conflicts in CaseManagementEntry2Action.java, removing obsolete commented code, standardizing session parameter handling, and cleaning up logging and formatting.

Class diagram for updated session parameter handling in CaseManagementEntry2Action

classDiagram
    class CaseManagementEntry2Action {
        +edit()
        +issueNoteSaveJson()
        +issueNoteSave()
        +save()
        ...
    }
    CaseManagementEntry2Action : -session.setAttribute("note_sort", request.getParameter("note_sort"))
    CaseManagementEntry2Action : -session.setAttribute("filter_roles", request.getParameterValues("filter_roles"))
    CaseManagementEntry2Action : -session.setAttribute("filter_provider", request.getParameterValues("filter_providers"))
    CaseManagementEntry2Action : -session.setAttribute("issues", request.getParameterValues("issues"))
    CaseManagementEntry2Action : +if (noteSort != null) session.setAttribute("note_sort", noteSort)
    CaseManagementEntry2Action : +if (filterRoles != null) { if (filterRoles.length > 0) session.setAttribute("filter_roles", filterRoles) else session.removeAttribute("filter_roles") }
    CaseManagementEntry2Action : +if (filterProviders != null) { if (filterProviders.length > 0) session.setAttribute("filter_provider", filterProviders) else session.removeAttribute("filter_provider") }
    CaseManagementEntry2Action : +if (issues != null) { if (issues.length > 0) session.setAttribute("issues", issues) else session.removeAttribute("issues") }
Loading

Class diagram for removed attributes and methods in CaseManagementEntry2Action

classDiagram
    class CaseManagementEntry2Action {
        -OscarMsgType : Integer
        -OscarMsgTypeLink : Integer
        -getOscarMsgType() : Integer
        -setOscarMsgType(Integer)
        -getOscarMsgTypeLink() : Integer
        -setOscarMsgTypeLink(Integer)
    }
    %% These attributes and methods were removed in the merge cleanup.
Loading

File-Level Changes

Change Details Files
Removed legacy commented-out code blocks
  • Deleted multiple large /* ... */ sections throughout methods
  • Stripped out obsolete single-line comments and unused variables
src/main/java/ca/openosp/openo/casemgmt/web/CaseManagementEntry2Action.java
Refactored session attribute handling for request parameters
  • Guarded setAttribute calls with null checks for note_sort, filter_roles, filter_providers, and issues
  • Removed direct unconditional session.setAttribute calls and replaced with conditional set/remove logic
src/main/java/ca/openosp/openo/casemgmt/web/CaseManagementEntry2Action.java
Cleaned up logging and formatting
  • Removed commented-out logger.debug lines and unused imports
  • Eliminated extra blank lines and aligned indentation
src/main/java/ca/openosp/openo/casemgmt/web/CaseManagementEntry2Action.java
Minor code adjustments and modernization
  • Replaced manual String trim with org.apache.commons.lang.StringUtils.trimToNull
  • Removed redundant local variable declarations and unused method calls
src/main/java/ca/openosp/openo/casemgmt/web/CaseManagementEntry2Action.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • CaseManagementEntry2Action is extremely large with many long methods—consider refactoring common logic (especially session‐param handling and issue management) into smaller helper classes or methods to improve readability and maintainability.
  • The new request‐to‐session parameter blocks for note_sort, filter_roles, filter_providers, and issues are repetitive—extract a reusable helper to reduce duplication and enforce consistent behavior.
  • Verify that the session attribute keys (e.g. "filter_provider" vs. "filter_providers") exactly match your request parameter names to prevent subtle inconsistencies.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- CaseManagementEntry2Action is extremely large with many long methods—consider refactoring common logic (especially session‐param handling and issue management) into smaller helper classes or methods to improve readability and maintainability.
- The new request‐to‐session parameter blocks for note_sort, filter_roles, filter_providers, and issues are repetitive—extract a reusable helper to reduce duplication and enforce consistent behavior.
- Verify that the session attribute keys (e.g. "filter_provider" vs. "filter_providers") exactly match your request parameter names to prevent subtle inconsistencies.

## Individual Comments

### Comment 1
<location> `src/main/java/ca/openosp/openo/casemgmt/web/CaseManagementEntry2Action.java:490` </location>
<code_context>
-        session.setAttribute("filter_roles", request.getParameterValues("filter_roles"));
-        session.setAttribute("filter_provider", request.getParameterValues("filter_providers"));
-        session.setAttribute("issues", request.getParameterValues("issues"));
+        String noteSort = request.getParameter("note_sort");
+        if (noteSort != null) {
+            session.setAttribute("note_sort", noteSort);
</code_context>

<issue_to_address>
Consider refactoring the repeated parameter synchronization logic into helper methods to reduce code duplication and improve clarity.

Consider extracting the repeated if/else into one or two small helpers. For example, add to your action class:

```java
private void syncParamSingle(HttpSession session,
                             HttpServletRequest request,
                             String paramName,
                             String sessionKey) {
  String val = request.getParameter(paramName);
  if (val != null) {
    session.setAttribute(sessionKey, val);
  }
}

private void syncParamArray(HttpSession session,
                            HttpServletRequest request,
                            String paramName,
                            String sessionKey) {
  String[] vals = request.getParameterValues(paramName);
  if (vals != null && vals.length > 0) {
    session.setAttribute(sessionKey, vals);
  } else {
    session.removeAttribute(sessionKey);
  }
}
```

Then replace your four blocks with just:

```java
syncParamSingle(session, request, "note_sort",       "note_sort");
syncParamArray( session, request, "filter_roles",    "filter_roles");
syncParamArray( session, request, "filter_providers","filter_provider");
syncParamArray( session, request, "issues",          "issues");
```

This preserves all current behavior (including removal on empty) while collapsing the nested if/elses into a concise loop-like pattern.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@yingbull
Copy link
Copy Markdown

yingbull commented Sep 2, 2025

Liam, could you test/audit this? I believe this brings something forward from coyote Kate fixed that is not in dogfish. @LiamStanziani

@LiamStanziani
Copy link
Copy Markdown
Collaborator

Sounds good I will look into this and fix up the merge conflict as well

@LiamStanziani
Copy link
Copy Markdown
Collaborator

LiamStanziani commented Sep 2, 2025

For the most part these changes pushed up with this PR: #494

The only original changes are removal of some commented out code and whitespace, so we should be good for review at any time now. We could see how the build goes but i'm sure it will pass with these changes.

@yingbull

@LiamStanziani
Copy link
Copy Markdown
Collaborator

LiamStanziani commented Sep 4, 2025

Re-running build because of a dependency fail

@yingbull yingbull merged commit 2b00e20 into develop/dogfish Sep 6, 2025
12 of 13 checks passed
@yingbull yingbull deleted the coyote-dogfish-merge branch January 8, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants