Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add database test fixture to insert non-unique linked_ids#12111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 7 commits intomainfromstevenmasley/linked_id_bug
Feb 13, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedFeb 12, 2024
edited
Loading

Related to#11861

I am working on a solution to the issue above. Adding test fixtures to ensure any added constraints handle these cases.

Before I even do that, I want to make sure our test fixtures accurately represent real database possibilities.

@EmyrkGraphite App
Copy link
MemberAuthor

Emyrk commentedFeb 12, 2024
edited
Loading

@@ -0,0 +1,19 @@
-- This is a deleted user that shares the same username and linked_id as the existing user below.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@coadler Is this ok to name this fixture different then the last migration?

Should I make this fixture to an earlier migration number?

Copy link
Member

@johnstcnjohnstcnFeb 13, 2024
edited
Loading

Choose a reason for hiding this comment

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

I wonder if you could also just add it in the base fixture 🤔 or wherever the linked_ids were introduced

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I was wondering that too. Was not sure what the protocol is on the immutability of test fixtures.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably add it as the same migration id thatuser_links was added, but I'm not super familiar with these. Maybe@mafredri can weight in

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'll move it to an older one. I guess just migrations are immutable.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, since the fixtures should never make their way into a customer deployment I think this should be fine.

Emyrk reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I moved it to000048_userdelete.up.sql. That is when deleting users was supported. Which is what this really is, adding a deleted user.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah definitely, always feel free to go wild with the fixtures, and use them to place in wrong-use traps for the code. 😄

@EmyrkEmyrkforce-pushed thestevenmasley/linked_id_bug branch from78e90d6 to90e7164CompareFebruary 13, 2024 15:48
@EmyrkEmyrk requested a review frommafredriFebruary 13, 2024 17:01
Added to the migration that added the delete field to users
@EmyrkEmyrk requested a review fromjohnstcnFebruary 13, 2024 17:07
VALUES ('a0061a8e-7db7-4585-838c-3116a003dd21', 'githubuser@coder.com', 'githubuser', '\x', '2022-11-02 13:05:21.445455+02', '2022-11-02 13:05:21.445455+02', 'active', '{}', true) ON CONFLICT DO NOTHING;
INSERT INTO public.organization_members VALUES ('a0061a8e-7db7-4585-838c-3116a003dd21', 'bb640d07-ca8a-4869-b6bc-ae61ebb2fda1', '2022-11-02 13:05:21.447595+02', '2022-11-02 13:05:21.447595+02', '{}') ON CONFLICT DO NOTHING;
INSERT INTO public.user_links(user_id, login_type, linked_id, oauth_access_token)
VALUES('a0061a8e-7db7-4585-838c-3116a003dd21', 'github', '100', '');
Copy link
Member

Choose a reason for hiding this comment

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

Will this trigger potential issues even with an empty token?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Nah. If it does, that would be quite interesting.

It's in a fixture, so this never touches anything in a production environment.

@EmyrkEmyrk merged commit06f3ab1 intomainFeb 13, 2024
@EmyrkEmyrk deleted the stevenmasley/linked_id_bug branchFebruary 13, 2024 18:06
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 13, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

@coadlercoadlerAwaiting requested review from coadler

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@Emyrk@mafredri@johnstcn@coadler

[8]ページ先頭

©2009-2025 Movatter.jp