Skip to content

fix: remove userid from db#223

Open
jmpTeixeira02 wants to merge 3 commits intomainfrom
fix/remove-userid-from-db
Open

fix: remove userid from db#223
jmpTeixeira02 wants to merge 3 commits intomainfrom
fix/remove-userid-from-db

Conversation

@jmpTeixeira02
Copy link
Copy Markdown
Contributor

@jmpTeixeira02 jmpTeixeira02 commented Apr 1, 2026

Requires openkcm/plugin-sdk#144

Summary by CodeRabbit

  • Refactor

    • Removed stored user name fields from key configurations, workflows, and workflow approvers; these fields are no longer persisted or managed by the database.
    • Updated models to treat these name fields as non-persistent.
  • Tests

    • Added schema migration tests to validate the removal and upgrade/downgrade behavior.
  • Chores

    • Added a migration to drop the corresponding database columns.

@bkieling
Copy link
Copy Markdown
Contributor

bkieling commented Apr 1, 2026

@coderabbitai summary

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

✅ Actions performed

Summary regeneration triggered.

@bkieling
Copy link
Copy Markdown
Contributor

bkieling commented Apr 1, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb8a40f2-c482-4e3c-840e-e9517ed48437

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The pull request removes three user name fields from the data model and database schema. GORM tags for CreatorName, InitiatorName, and UserName are changed to gorm:"-:all" to exclude them from ORM operations. A new migration drops creator_name, initiator_name, and user_name columns from key_configurations, workflows, and workflow_approvers. Test cases were added to validate migrating up to and down from version 5.

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'fix: remove userid from db' is vague and misleading—it doesn't accurately describe the changeset, which removes three user-related name fields (CreatorName, InitiatorName, UserName) from the database schema, not a generic 'userid'. Revise the title to accurately reflect the specific changes, such as 'fix: remove user name fields from database schema' or 'refactor: exclude user name fields from persistence'.

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


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 and usage tips.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

✅ Actions performed

Review triggered.

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.

@jmpTeixeira02 jmpTeixeira02 self-assigned this Apr 1, 2026
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: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 90ef3351-2e5e-4e60-abe5-3ae7153d0436

📥 Commits

Reviewing files that changed from the base of the PR and between 3d8e084 and 18cd535.

📒 Files selected for processing (4)
  • internal/model/keyconfiguration.go
  • internal/model/workflow.go
  • migrations/tenant/schema/00005_delete_user_names.sql
  • test/db-migration/migration_test.go

@bkieling bkieling requested a review from anettlippert April 2, 2026 08:25
@jmpTeixeira02 jmpTeixeira02 force-pushed the fix/remove-userid-from-db branch from 18cd535 to f181be3 Compare April 2, 2026 11:34
@jmpTeixeira02 jmpTeixeira02 force-pushed the fix/remove-userid-from-db branch 2 times, most recently from d4c2686 to b343f6c Compare April 7, 2026 09:42
@jmpTeixeira02 jmpTeixeira02 force-pushed the fix/remove-userid-from-db branch from b343f6c to 82c1dbe Compare April 7, 2026 10:07
return ""
}

func (w *Workflow) GetInitiatorName(
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.

GetInitiatorName and GetUserName have nearly the same code, can we maybe extra this into a helper?
Same helper can maybe also reused for GetCreatorName in KeyConfiguration

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants