Skip to content

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

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

Merged
merged 12 commits into from
Oct 18, 2018
Merged

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

merged 12 commits into from
Oct 18, 2018

Conversation

k1ng440
Copy link

@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 mentioned this pull request Oct 16, 2018
@bcomnes
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

k1ng440 commented Oct 17, 2018

@bcomnes Please review

@bcomnes
Copy link
Contributor

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
Copy link
Author

k1ng440 commented Oct 18, 2018

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

@k1ng440
Copy link
Author

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
Copy link
Contributor

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
@bandirsen
Copy link

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
	}

...

@bandirsen bandirsen mentioned this pull request Dec 19, 2018
@edevil edevil mentioned this pull request Jan 8, 2019
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.

4 participants