Skip to content
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

Remove migrations and all tests for compatibility with v0.23.12 #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CanGonenc
Copy link

Removes migrations and all tests, this is needed for compatibility with new version v0.23.12 since the migrations import from github.com/pocketbase/pocketbase/models and github.com/pocketbase/pocketbase/daos which do not exist in v0.23.12. The current state breaks builds so I created this PR for you to quickly do a temporary fix, obviously the migrations and tests should be restored later once it is compatible.

@pluja
Copy link
Owner

pluja commented Dec 31, 2024

@benallfree could you please check this out? I am a bit out of time for this currently and since you did the v23 migration PR maybe you can confirm to merge :)

@benallfree
Copy link
Collaborator

@CanGonenc Do you mean there is something special about v0.23.12 exactly, or just v0.23.x?

Can you provide more information please? We already have v23 compat with passing tests, don't we?

@CanGonenc
Copy link
Author

Sorry the description wasn't clear, I encountered the problem and struggled to debug and fix it for 3 hours so I was frustrated so I hastily created the PR so that other people having the same issue dont have to figure it out themselves. The problem is not with v0.23.12 specifically, the problem is with the tests not being compatible with the v0.23.x version (they are importing github.com/pocketbase/pocketbase/daos and github.com/pocketbase/pocketbase/models which are removed in v0.23). Which results in an error when go get -t "github.com/pluja/pocketbase" (which gets and builds the tests, so no problem only breaks when trying to build tests) and more importantly when go mod tidy is run with the go.mod package including both pluja/pocketbase and pocketbase/pocketbase (because go mod tidy apparently tries to build the tests in this scenario?? idk why exactly):

sample go.mod which errors with go mod tidy:

module main

go 1.23.4

require github.com/pluja/pocketbase v0.1.0

require github.com/pocketbase/pocketbase v0.23.12

Error message after go mod tidy with go.mod file including both pluja/pocketbase and pocketbase/pocketbase:

go: finding module for package github.com/pocketbase/pocketbase/daos
go: finding module for package github.com/pocketbase/pocketbase/models
go: test imports
github.com/pluja/pocketbase tested by
github.com/pluja/pocketbase.test imports
github.com/pluja/pocketbase/migrations imports
github.com/pocketbase/pocketbase/daos: module github.com/pocketbase/pocketbase@latest found (v0.23.12), but does not contain package github.com/pocketbase/pocketbase/daos
go: test imports
github.com/pluja/pocketbase tested by
github.com/pluja/pocketbase.test imports
github.com/pluja/pocketbase/migrations imports
github.com/pocketbase/pocketbase/models: module github.com/pocketbase/pocketbase@latest found (v0.23.12), but does not contain package github.com/pocketbase/pocketbase/models

I have a project with a go module which has both these packages imported and it took me hours to figure out what was happening, I managed to fix the problem by removing all the tests and decided to create a PR for a temporary fix for other people depending on both packages, since currently a project with both packages cannot be upgraded to github.com/pocketbase/pocketbase v0.23.x

@benallfree
Copy link
Collaborator

@CanGonenc The tests in master are passing when make test runs.

If I'm understanding you correctly, the issues you're reporting are:

  1. This lib fails to install when go get -t is used
  2. This lib breaks go mod tidy

Is that right?

If you have time, please open an issue and provide a minimal repo that reproduces the issue.

Meanwhile, I'll leave this PR open so people can see your solution but it won't be merged because disabling all the tests is not the solution :)

@prasanthkrishnan
Copy link

For others who run into this issue, here is the solution.

v0.1.0 of github.com/pluja/pocketbase points to a older commit which does not have 0.23 support. Simple pinning github.com/pluja/pocketbase to latest commit SHA in your go.mod file would solve this issue.

❯ go get github.com/pluja/pocketbase@adc8ee954bd6e2c95e9b969c4595db89f24a2417

@CanGonenc
Copy link
Author

For others who run into this issue, here is the solution.

v0.1.0 of github.com/pluja/pocketbase points to a older commit which does not have 0.23 support. Simple pinning github.com/pluja/pocketbase to latest commit SHA in your go.mod file would solve this issue.

❯ go get github.com/pluja/pocketbase@adc8ee954bd6e2c95e9b969c4595db89f24a2417

This is the correct and easiest fix for people having the issue. The true fix is bumping version number to v0.1.1 obviously, i will keep the PR open for people to see the quoted comment until version is bumped to v0.1.1.

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