Skip to content

Create initial migration, model, factory, and test for suspending wikis - #1294

Draft
outdooracorn wants to merge 1 commit into
mainfrom
wiki-suspensions
Draft

outdooracorn wants to merge 1 commit into
mainfrom
wiki-suspensions

Conversation

@outdooracorn

Copy link
Copy Markdown
Member

Bug: T440875


Stack created with GitHub Stacks CLI • Give Feedback 💬

@outdooracorn outdooracorn self-assigned this Oct 12, 2026
@outdooracorn
outdooracorn requested a review from tarrow October 12, 2026 15:16
Comment thread tests/Feature/Models/WikiSuspensionActionTest.php
The relationship between the `review_submission_actions` and `wiki_suspension_actions` tables could be represented as a foreign key column on either table.

Bug: T440875

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

Looks fine to me. 2 comments and I guess two "nudges" for how I would handle your todos

namespace App\Enums;

enum WikiSuspensionActionReason: string {
case DEFAULT_EXPIRY = 'default_expiry';

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.

I know we were originally not keen but I think keeping this here and inserting it is expedient

namespace App\Enums;

enum WikiSuspensionActionType: string {
case SUSPEND = 'suspend';

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.

good idea to also make this an enum

->restrictOnUpdate()
->restrictOnDelete();

$table->dateTime('active_from');

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.

My current thinking is that this should either be nullable or we add a field to the enum like indefinitely_allowed.

my preference is we add indefinitely_allowed.

This does annoyingly nudge me to thinking that the layout is still a bit ugly and keeping suspensions right next to unsuspensions isn't that elegant. I think we should go ahead anyway though.

// relationship on this table will mean it doesn't need to be updated once the WikiSuspensionAction exits.
//
// TODO: is this a one-to-one or a one-to-many relationship?
// - if it is a one-to-one relationship then the foreign key column can be added to either column

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.

I think I favour a one-to-one model for now. Adding uniqueness does seem wise so we are explicit if we change it in future.

Trying not to get philosophical: a second suspension action added later doesn't seem strongly connecting to a reviewsubmissionaction

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