Skip to content

refactor: rename service user variables#1802

Open
RushikeshBhavsar3605 wants to merge 1 commit into
raystack:mainfrom
RushikeshBhavsar3605:fix/service-user-variable-naming
Open

refactor: rename service user variables#1802
RushikeshBhavsar3605 wants to merge 1 commit into
raystack:mainfrom
RushikeshBhavsar3605:fix/service-user-variable-naming

Conversation

@RushikeshBhavsar3605

@RushikeshBhavsar3605 RushikeshBhavsar3605 commented Jul 24, 2026

Copy link
Copy Markdown

Summary

Renames variables that hold service users to use explicit service user naming, avoiding confusion with human users.

Closes #1726

Changes

  • Renamed user, users, and currentUser variables that represent service users.
  • Used serviceUser/serviceUsers naming and su in short loops.
  • Updated additional occurrences found during the repo-wide sweep.
  • No behavior changes.

Technical Details

This is a naming-only refactor. No application logic or SQL queries were changed.

Test Plan

  • Manual testing completed

  • Build and type checking passes

  • Verified the repo-wide sweep for remaining service-user naming occurrences.

SQL Safety (if your PR touches *_repository.go or goqu.*)

No SQL/query logic was changed.

  • Values flow through ? placeholders, goqu.Ex{}, or goqu.Record{} — never fmt.Sprintf or + building a query that gets executed.
  • ToSQL() callers capture and forward params (query, params, err := stmt.ToSQL(); db.…Context(ctx, …, query, params...)). Never query, _, err := ….
  • No ? placeholders inside single-quoted SQL literals in goqu.L (use make_interval(hours => ?)-style functions instead).
  • Any //nolint:forbidigo or // #nosec G20x annotation has a one-line justification on the same line that a reviewer can verify.

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

@RushikeshBhavsar3605 is attempting to deploy a commit to the Raystack Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b9ee8837-b7aa-4d95-b6ed-317cf077c5ce

📥 Commits

Reviewing files that changed from the base of the PR and between ae5e60a and b6871a1.

📒 Files selected for processing (5)
  • core/serviceuser/service.go
  • internal/api/v1beta1connect/project.go
  • internal/api/v1beta1connect/serviceuser.go
  • internal/store/postgres/serviceuser_repository.go
  • test/e2e/regression/serviceusers_test.go

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Improved internal consistency when handling service-user listings, impersonation actions, and platform relations.
    • Clarified error context when service-user data cannot be transformed.
  • Tests
    • Updated service-user listing assertions to use clearer naming without changing test behavior.

Walkthrough

Changes

Service-user naming cleanup

Layer / File(s) Summary
Core service-user flow
core/serviceuser/service.go
Renames service-user identifiers in organization listing and sudo/unsudo operations while preserving logic.
API response transformations
internal/api/v1beta1connect/project.go, internal/api/v1beta1connect/serviceuser.go
Renames service-user collection and loop variables in listing handlers without changing response shapes or error handling.
Repository and regression alignment
internal/store/postgres/serviceuser_repository.go, test/e2e/regression/serviceusers_test.go
Clarifies the repository transform error and service-user predicate parameter names.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: amangit07

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR matches issue #1726 by renaming service-user variables only, with no reported behavior or schema changes.
Out of Scope Changes check ✅ Passed The changes stay within the naming-only cleanup described by the issue, with no unrelated code paths or features added.

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.

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.

refactor: rename user/users variables that actually hold service users

1 participant