Skip to content

Dev#512

Merged
dbarzin merged 2 commits intomainfrom
dev
Aug 20, 2025
Merged

Dev#512
dbarzin merged 2 commits intomainfrom
dev

Conversation

@dbarzin
Copy link
Copy Markdown
Owner

@dbarzin dbarzin commented Aug 20, 2025

Summary by CodeRabbit

  • New Features

    • Added configurable LDAP base DN.
    • Auto-provisioned LDAP users now receive a securely generated random password.
  • Bug Fixes

    • Improved report generation reliability by correctly loading related measures before display.
  • Refactor

    • Standardized controller method naming to camelCase and aligned role mapping to numeric values.
    • Minor parameter rename in export styling to clarify intent.
    • Removed unused imports.
  • Style

    • Consistent logging string style and minor formatting cleanups.

@dbarzin dbarzin merged commit 26f8cfe into main Aug 20, 2025
1 check was pending
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Renamed a method parameter in AttributesExport. Adjusted LDAP config usage and defaults in LoginController and added ldap_users_base_dn to config. Updated ReportController to load relations before implode. Refactored SocialiteController method names, return types, role mapping, and config keys. Removed an unused import in Control model.

Changes

Cohort / File(s) Summary
LDAP config and usage
config/app.php, app/Http/Controllers/Auth/LoginController.php
Added config key ldap_users_base_dn (env-driven). LoginController now reads base DN from config only, updates logs/strings, uses null-coalescing for name/email defaults, and sets a random password on auto-provisioned users.
Social auth refactor
app/Http/Controllers/SocialiteController.php
Renamed methods to camelCase: createUser, updateUser, getUserLogin. Updated signatures/return types (createUser may return null). Switched ROLES_MAP values to integers and adjusted get_user_role to return int
Reports relation loading
app/Http/Controllers/ReportController.php
Uses $control->measures()->get()->implode('clause', ', ') to ensure collection-based implode.
Export styles signature tweak
app/Exports/AttributesExport.php
Renamed styles method parameter to $_sheet and removed unused assignment; behavior unchanged.
Model import cleanup
app/Models/Control.php
Removed unused BelongsTo import; no functional changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant A as App (SocialiteController)
  participant P as Social Provider
  participant DB as Database

  U->>A: Start OAuth callback
  A->>P: Fetch user profile
  P-->>A: SocialiteUser

  A->>A: login = getUserLogin()
  A->>A: roleId = get_user_role()

  alt Existing user
    A->>DB: Find user by provider/id or email
    DB-->>A: User
    A->>A: updateUser(user, socialiteUser, ...)
    A-->>U: Sign in
  else New user and allowed
    A->>A: createUser(socialiteUser, ...)
    alt Created
      A->>DB: Persist user
      DB-->>A: User
      A-->>U: Sign in
    else Creation failed (null)
      A-->>U: Error/denied
    end
  else Creation not allowed
    A-->>U: Error/denied
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

Thump-thump! I nudge the configs neat,
New DNs sprout where logins meet.
Social hops with roles that fit,
CamelCase carrots—perfect kit.
Reports now gather clauses tight,
Exports trimmed just right.
I twitch—another merge takes flight! 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0ad97ac and 2de68ca.

📒 Files selected for processing (6)
  • app/Exports/AttributesExport.php (1 hunks)
  • app/Http/Controllers/Auth/LoginController.php (3 hunks)
  • app/Http/Controllers/ReportController.php (1 hunks)
  • app/Http/Controllers/SocialiteController.php (8 hunks)
  • app/Models/Control.php (1 hunks)
  • config/app.php (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

1 participant