Skip to content

feat: ignore data from suspended user#848

Open
alexey-yarmosh wants to merge 1 commit into
username-changefrom
suspend-banned-users
Open

feat: ignore data from suspended user#848
alexey-yarmosh wants to merge 1 commit into
username-changefrom
suspend-banned-users

Conversation

@alexey-yarmosh
Copy link
Copy Markdown
Member

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

Walkthrough

This PR implements user status filtering for dashboard probe adoption by adding a status column to the directus_users table, filtering active users in the fetchDProbes() query, and updating integration tests to verify the behavior. The migration establishes the schema, the query implementation filters adopted probes to only active users, and the test suite confirms both active user adoption and suspended user exclusion from probe customization.

Suggested reviewers

  • MartinKolarik
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: ignoring data from suspended users, which is reflected across the database schema, query logic, and test coverage.
Description check ✅ Passed The description references the related issue and indicates the PR implements a feature to ignore data from suspended users, which aligns with the changeset modifications.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch suspend-banned-users

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/lib/override/adopted-probes.ts

Oops! Something went wrong! :(

ESLint: 10.4.0

SyntaxError: Unexpected token ':'
at compileSourceTextModule (node:internal/modules/esm/utils:318:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:90:18)
at #translate (node:internal/modules/esm/loader:451:20)
at afterLoad (node:internal/modules/esm/loader:507:29)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:512:12)
at #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:555:36)
at afterResolve (node:internal/modules/esm/loader:603:52)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:609:12)
at node:internal/modules/esm/loader:628:32
at TracingChannel.tracePromise (node:diagnostics_channel:362:14)

test/tests/integration/measurement/create-measurement.test.ts

Oops! Something went wrong! :(

ESLint: 10.4.0

SyntaxError: Unexpected token ':'
at compileSourceTextModule (node:internal/modules/esm/utils:318:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:90:18)
at #translate (node:internal/modules/esm/loader:451:20)
at afterLoad (node:internal/modules/esm/loader:507:29)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:512:12)
at #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:555:36)
at afterResolve (node:internal/modules/esm/loader:603:52)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:609:12)
at node:internal/modules/esm/loader:628:32
at TracingChannel.tracePromise (node:diagnostics_channel:362:14)

test/tests/integration/probes/get-probes.test.ts

Oops! Something went wrong! :(

ESLint: 10.4.0

SyntaxError: Unexpected token ':'
at compileSourceTextModule (node:internal/modules/esm/utils:318:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:90:18)
at #translate (node:internal/modules/esm/loader:451:20)
at afterLoad (node:internal/modules/esm/loader:507:29)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:512:12)
at #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:555:36)
at afterResolve (node:internal/modules/esm/loader:603:52)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:609:12)
at node:internal/modules/esm/loader:628:32
at TracingChannel.tracePromise (node:diagnostics_channel:362:14)


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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@migrations/dashboard/create-tables.js.sql`:
- Line 6: Add a new migration that alters the existing directus_users table to
add the status column for already-deployed databases: create an ALTER TABLE
migration that checks for the absence of column directus_users.status (or safely
attempts to ADD COLUMN IF NOT EXISTS) and sets it to VARCHAR(255) NOT NULL
DEFAULT 'active', and include any required rollback/transaction semantics
consistent with other migrations; reference the directus_users table and status
column in the migration name and description so it runs on upgrades alongside
the existing migrations/dashboard/create-tables.js.sql.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2b9ab88-61bf-42bd-b518-e04ebf5d5b86

📥 Commits

Reviewing files that changed from the base of the PR and between 557027e and 7c960d2.

📒 Files selected for processing (4)
  • migrations/dashboard/create-tables.js.sql
  • src/lib/override/adopted-probes.ts
  • test/tests/integration/measurement/create-measurement.test.ts
  • test/tests/integration/probes/get-probes.test.ts

Comment thread migrations/dashboard/create-tables.js.sql
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