Skip to content

[CSM Portal] Proxy saved list filters through the BFF - #1885

Open
2003dinijay wants to merge 2 commits into
wso2-open-operations:dev-app-csm-portalfrom
2003dinijay:dinijay/feat/csm-user-filter-bff
Open

2003dinijay wants to merge 2 commits into
wso2-open-operations:dev-app-csm-portalfrom
2003dinijay:dinijay/feat/csm-user-filter-bff

Conversation

@2003dinijay

@2003dinijay 2003dinijay commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Authenticates /users/me/saved-filter-views (list / save / delete / reorder) on the CSM BFF and forwards to entity-service.
  • Save is PATCH (same as entity-service and the rest of this BFF), not PUT.
  • Merge after [Entity-Service] Persist CSM portal list filters #1884 so entity-service has the routes. This PR is only BFF files.

Test plan

  • Merge or checkout [Entity-Service] Persist CSM portal list filters #1884 first so entity-service has the routes
  • GET /users/me/saved-filter-views?listKey=cases through the BFF after login returns 200
  • PATCH then DELETE a named view; BFF status matches entity-service
  • Unauthenticated request is 401

Copilot AI lite review requested due to automatic review settings September 21, 2026 12:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: wso2-open-operations/cs-tools/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f02d05ff-30b7-4353-b421-d965c824720d

📥 Commits

Reviewing files that changed from the base of the PR and between 216c067 and 87dfb26.

📒 Files selected for processing (6)
  • apps/csm-portal/backend/cmd/server/main.go
  • apps/csm-portal/backend/internal/entity/customer.go
  • apps/csm-portal/backend/internal/handler/helpers_test.go
  • apps/csm-portal/backend/internal/handler/users.go
  • apps/csm-portal/backend/internal/handler/users_test.go
  • apps/csm-portal/backend/openapi.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Saved filter views

Layer / File(s) Summary
Saved filter view API contract
apps/csm-portal/backend/openapi.yaml
The OpenAPI specification adds list, save, delete, and reorder endpoints with saved-view schemas and validation constraints.
Authenticated handler flow
apps/csm-portal/backend/internal/handler/users.go, apps/csm-portal/backend/cmd/server/main.go, apps/csm-portal/backend/internal/handler/helpers_test.go, apps/csm-portal/backend/internal/handler/users_test.go
Authenticated routes validate query parameters or JSON bodies, delegate to the entity client, map upstream errors, and include handler tests and mock support.
Entity service transport
apps/csm-portal/backend/internal/entity/customer.go
The entity client sends list, save, delete, and reorder requests with the defined paths, query parameters, and request bodies.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant UsersHandler
  participant CustomerEntityClient
  Client->>UsersHandler: Send authenticated saved-filter-view request
  UsersHandler->>UsersHandler: Validate query parameters or JSON body
  UsersHandler->>CustomerEntityClient: Delegate operation
  CustomerEntityClient-->>UsersHandler: Return entity response or error
  UsersHandler-->>Client: Return response or mapped error
Loading

Suggested reviewers: rashmika998

Merge Risk: ⚪ Minimal · up to 87dfb

This change adds authenticated saved-filter-view operations through the BFF, including listing, saving, deleting, and reordering. The supplied implementation and tests show the expected validation, authentication, forwarding, and error handling, so it is mergeable.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the BFF proxy changes and lists a test plan, but it omits most required template sections, including purpose, goals, release note, documentation, security checks, test environ… Complete the repository template. Add the missing sections and provide the required security, testing, documentation, and release information.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The description links the dependent entity-service pull request #1884, and the objectives reference related pull request #1885.
Out of Scope Changes check ✅ Passed The changes match the stated objective. They add BFF routes, entity-service proxy methods, tests, and OpenAPI definitions for saved filter views.
Title check ✅ Passed The title clearly identifies the primary change: proxying saved list filters through the CSM Portal BFF.
Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description explains the BFF proxy changes and lists a test plan, but it omits most required template sections, including purpose, goals, release note, documentation, security checks, test environment, and learning.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Rashmika998

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Passthrough GET/PUT/DELETE/reorder on /users/me/saved-filter-views so the
webapp never talks to entity-service directly.
@2003dinijay
2003dinijay force-pushed the dinijay/feat/csm-user-filter-bff branch from e7dfec9 to 2134932 Compare September 21, 2026 17:20
route("GET /users/me", handler.PermAuthenticated, usersHandler.GetMe)
route("PATCH /users/me", handler.PermAuthenticated, usersHandler.PatchMe)
route("GET /users/me/saved-filter-views", handler.PermAuthenticated, usersHandler.ListSavedFilterViews)
route("PUT /users/me/saved-filter-views", handler.PermAuthenticated, usersHandler.SaveSavedFilterView)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't we have a PATCH instead of a PUT in here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes — switched this to PATCH to match the rest of the BFF (and entity-service). Save is now PATCH /users/me/saved-filter-views on the BFF route, the entity client, OpenAPI, and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants