Skip to content

fix(auth): default public_profile_allow_chat_with_me to true for new users - #157

Merged
smarcet merged 1 commit into
mainfrom
fix/public-profile-chat-default-true
Sep 16, 2026
Merged

smarcet merged 1 commit into
mainfrom
fix/public-profile-chat-default-true

Conversation

@smarcet

@smarcet smarcet commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

ref: https://app.clickup.com/t/9014802374/86bbdxzt6

Summary

Resolves the openstackid-side default mismatch flagged in ClickUp 86bbdxzt6: the User entity constructor set public_profile_allow_chat_with_me to false, while a 2023 migration (Version20230601162315) had already moved the DB column default to 1. Per JP's recommendation on the ticket, the default should be on, so this aligns the constructor and the Doctrine column mapping with the existing DB default instead of the other way around.

Changes

  • app/libs/Auth/Models/User.php: constructor now sets public_profile_allow_chat_with_me = true; the #[ORM\Column(...)] mapping's options: ['default' => ...] updated from 0 to 1 to match.
  • tests/unit/UserMappingTest.php: added testDefaultPublicProfileAllowChatWithMeIsTrue, asserting a freshly constructed User defaults to chat-allowed true.

Impact

New accounts created via registration, social login, OTP, or CreateSuperAdmin (none of which pass this flag explicitly) now default to chat-allowed true, matching the DB default and closing the code/DB disagreement called out on the ticket.

Testing

  • vendor/bin/phpunit tests/unit/UserMappingTest.php — 2 passed, 8 assertions (run inside the idp-app container).
  • Red-green verified: reverted the constructor default to false, confirmed the new test fails (Failed asserting that false is true.), restored the fix, confirmed it passes again.

Summary by CodeRabbit

  • New Features

    • New user profiles now allow others to chat with them by default.
  • Tests

    • Added coverage to verify the default chat-permission setting for newly created user profiles.

…users

Aligns the User entity constructor and Doctrine column mapping so both
agree with the 2023 migration's DB-level default (1/true), closing the
code/DB contradiction flagged in ClickUp 86bbdxzt6. Previously the
constructor set false while the DB default was already 1, so new
accounts silently diverged from the intended on-by-default chat
setting once any code path relied on the DB default instead of the
explicit ORM insert.

Adds a unit test asserting a freshly constructed User defaults to
chat-allowed true.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e8724b3c-21f6-4654-9edb-958f86e7f3ed

📥 Commits

Reviewing files that changed from the base of the PR and between c1e2ba0 and 552a556.

📒 Files selected for processing (2)
  • app/libs/Auth/Models/User.php
  • tests/unit/UserMappingTest.php

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


📝 Walkthrough

Walkthrough

The user profile chat setting now defaults to enabled in both the ORM column mapping and new User instances. A unit test verifies the constructor default.

Changes

User profile chat default

Layer / File(s) Summary
Enable the default chat setting
app/libs/Auth/Models/User.php, tests/unit/UserMappingTest.php
The ORM column default changed from 0 to 1. The User constructor now sets the setting to true. A unit test verifies the default value.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 552a5

The intended chat-default change is consistently implemented and has focused test coverage, with no concrete merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: setting public_profile_allow_chat_with_me to true by default for new users.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/public-profile-chat-default-true

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.

@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/openstackid/openapi/pr-157/

This page is automatically updated on each push to this PR.

@smarcet smarcet self-assigned this Sep 16, 2026
@smarcet
smarcet requested review from romanetar and a lite review from Copilot and removed request for romanetar September 16, 2026 18:34

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.

🟢 Approval recommended

No unresolved review issues were identified, and the new default is covered by a unit test.

Pull request overview

Updates new-user chat permissions to default to enabled, aligning the entity and database defaults.

Changes:

  • Sets public_profile_allow_chat_with_me to true.
  • Updates the Doctrine mapping default to 1.
  • Adds regression coverage for the constructor default.
File summaries
File Description
tests/unit/UserMappingTest.php Verifies new users allow chat by default.
app/libs/Auth/Models/User.php Aligns entity and database defaults.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@romanetar romanetar 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.

LGTM

@smarcet
smarcet merged commit 16d80a8 into main Sep 16, 2026
10 checks passed
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