Skip to content

NM-146: Port CatalogController to @RequestMapping(/catalog) with CRUD actions#160

Open
devin-ai-integration[bot] wants to merge 1 commit into
migration/in-progressfrom
NM-146/port-catalog-controller
Open

NM-146: Port CatalogController to @RequestMapping(/catalog) with CRUD actions#160
devin-ai-integration[bot] wants to merge 1 commit into
migration/in-progressfrom
NM-146/port-catalog-controller

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented May 27, 2026

Copy link
Copy Markdown

Summary

Ports the ASP.NET MVC CatalogController to a Spring @Controller mapped to /catalog, aligning route paths with the acceptance criteria in NM-146.

Key changes:

  • Routing: Changed class-level @RequestMapping from / to /catalog; simplified sub-route annotations to relative paths (/details/{id}, /create, /edit/{id}, /delete/{id})
  • Root redirect: Added ViewControllerRegistry redirect from //catalog in WebMvcConfig for backward compatibility
  • Redirect hygiene: Added RedirectAttributes parameter to POST handlers to prevent @ControllerAdvice/interceptor model attributes from leaking as query params on redirects; fixed SessionInfoInterceptor to skip redirect views
  • Templates: Updated all Thymeleaf templates (index, details, create, edit, delete, error, layout) to use /catalog base URLs
  • Tests: Updated CatalogControllerTest (15 tests) to use /catalog URLs and verify exact redirect targets; updated SmokeTest to verify root redirect and /catalog 200 response; spotless removed unused imports in PicControllerTest and CatalogServiceImplTest

All 82 tests pass. Spotless check passes.

Review & Testing Checklist for Human

  • Verify all CRUD pages load at /catalog, /catalog/details/{id}, /catalog/create, /catalog/edit/{id}, /catalog/delete/{id}
  • Verify root / redirects to /catalog
  • Test create/edit/delete flows end-to-end — confirm form submissions redirect cleanly to /catalog without stray query params
  • Check that brand logo link in the header navigates to /catalog

Notes

  • The SessionInfoInterceptor was adding machineName and sessionStartTime as query parameters on redirect URLs because it modified the ModelAndView model for all views including redirects. The fix skips model modification when the view is a redirect.
  • Spotless auto-fixed unused imports in two unrelated test files (PicControllerTest, CatalogServiceImplTest)

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/99dc603f5fd349e8963dc51876cec218


Open in Devin Review

… actions

- Change @RequestMapping from / to /catalog per AC
- Simplify sub-route paths (relative to class-level mapping)
- Add root / redirect to /catalog via WebMvcConfig
- Use RedirectAttributes to prevent model attribute leakage on redirects
- Fix SessionInfoInterceptor to skip redirect views
- Update all Thymeleaf templates to use /catalog base URLs
- Update tests to verify /catalog routing and exact redirect URLs
- Remove unused imports (spotless)
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

0 participants