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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to new pop, go module and bug fixes #188

Merged
merged 12 commits into from Oct 18, 2018

Conversation

Projects
None yet
4 participants
@k1ng440

k1ng440 commented Oct 16, 2018

- Summary
gotrue was using glide and outdated pop orm. it was causing an error on migrations and so on.

- Test plan
I have not added any new feature. therefore all existing passed

cute animal

@k1ng440 k1ng440 referenced this pull request Oct 16, 2018

Closed

Fix `gotrue migrate` #182

Show resolved Hide resolved example.env Outdated
@rybit

rybit approved these changes Oct 17, 2018

@bcomnes

This comment has been minimized.

Member

bcomnes commented Oct 17, 2018

Overall, looks like great changes! Thank you @k1ng440 ! Can you please give me context on the migration file deletion? With that I think we will be good to go!

@k1ng440

This comment has been minimized.

k1ng440 commented Oct 17, 2018

Overall, looks like great changes! Thank you @k1ng440 ! Can you please give me context on the migration file deletion? With that I think we will be good to go!

I just tested migration and the file seems to be not required at all. it was probably created before the migrations was added. however i will add it back.

@k1ng440

This comment has been minimized.

k1ng440 commented Oct 17, 2018

@bcomnes Please review

@bcomnes

This comment has been minimized.

Member

bcomnes commented Oct 17, 2018

Apologies @k1ng440 I wasn't active on the project during the switch from gorm to pop, so still playing catchup here.

I noticed https://github.com/gobuffalo/uuid is marked depreciated and suggests https://github.com/gofrs/uuid instead. Are you familiar with this situation? If possible, it seems preferable to go with that over a depreciated fork. I'm going to test that out, but if you know anything let me know. I don't necessarily want to block landing this if switching over to that will be a lot of extra work, or not work for some reason. Any insight is appreciated.

@k1ng440

This comment has been minimized.

k1ng440 commented Oct 18, 2018

Hey @bcomnes, my apologies I was not aware of that. I will try gofrs/uuid now

@k1ng440

This comment has been minimized.

k1ng440 commented Oct 18, 2018

@bcomnes,

well it's not possible to use gofrs/uuid because gobuffalo/pop is using gobuffalo/uuid

if you search uuid in pop, you will see they have used it every where
https://github.com/gobuffalo/pop/search?q=uuid&unscoped_q=uuid

panic: interface conversion: interface {} is uuid.UUID, not uuid.UUID (types from different packages)

gobuffalo/pop#188

@bcomnes

This comment has been minimized.

Member

bcomnes commented Oct 18, 2018

I think I reached the same conclusion. Let's go forward with this now, and I'll open an issue to track this tomorrow.

@bcomnes bcomnes merged commit 49e0866 into netlify:master Oct 18, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bandirsen

This comment has been minimized.

bandirsen commented Nov 4, 2018

latest https://github.com/gobuffalo/uuid already delegate all function call to https://github.com/gofrs/uuid

gobuffalo/uuid.go

package uuid

import (
	guuid "github.com/gofrs/uuid"
)

// Size of a UUID in bytes.
const Size = guuid.Size

...

However, Equal function from https://github.com/gofrs/uuid is deprecated in favor of '==' operator (gofrs/uuid#35).
GoTrue using this Equal function in /api/provider/saml.go

gotrue/api/provider/saml.go line 224

...

func (ks ConfigX509KeyStore) SaveConfig(cert []byte, key *rsa.PrivateKey) error {
	if uuid.Equal(ks.InstanceID, uuid.Nil) {
		return nil
}

...

I've been successful to build GoTrue (without testing), by changing above function to

...

func (ks ConfigX509KeyStore) SaveConfig(cert []byte, key *rsa.PrivateKey) error {
	if (ks.InstanceID == uuid.Nil) {
		return nil
	}

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