Skip to content

Conversation

novalagung
Copy link
Contributor

@novalagung novalagung commented Feb 21, 2020

What this PR does / why we need it:
Upgrade xorm to 0.8.1.

The required dependency xorm is moved into gitea and the module name is changed. this causing go get on grafana generate an error

$ go get -u github.com/grafana/grafana/pkg/tsdb
go: finding github.com/grafana/grafana v6.1.6+incompatible
go: downloading github.com/grafana/grafana v6.1.6+incompatible
...
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: extracting github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
go: extracting golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: github.com/grafana/grafana/pkg/tsdb imports
        github.com/go-xorm/core: github.com/go-xorm/core@v0.6.3: parsing go.mod:
        module declares its path as: xorm.io/core
                but was required as: github.com/go-xorm/core

@aknuds1 aknuds1 self-requested a review February 21, 2020 15:41
@aknuds1 aknuds1 added area/backend pr/external This PR is from external contributor labels Feb 21, 2020
@aknuds1
Copy link
Contributor

aknuds1 commented Feb 24, 2020

Thanks, I will have a look at it.

@aknuds1 aknuds1 self-assigned this Feb 24, 2020
@aknuds1
Copy link
Contributor

aknuds1 commented Feb 25, 2020

@novalagung Would you be able to fix the failing tests?

@novalagung
Copy link
Contributor Author

@aknuds1 sure

@novalagung
Copy link
Contributor Author

novalagung commented Feb 25, 2020

@aknuds1 I just pushed some updates. all tests are passed now

@aknuds1
Copy link
Contributor

aknuds1 commented Feb 25, 2020

@novalagung Great, how did you fix the tests? I can't tell from the diff.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@novalagung
Copy link
Contributor Author

novalagung commented Feb 25, 2020

@aknuds1 actually my changes did not touch the test codes at all. I only modified the go dotfiles and import paths. but somehow it causes the test to fail.

Then I performed the go mod tidy && go mod vendor again, push it and the test result back to normal (all passed). I believe the version of the xorm is the one causing the problem

@aknuds1
Copy link
Contributor

aknuds1 commented Feb 25, 2020

@novalagung I found that the very last version of xorm (0.8.2) causes tests to fail. I am able to upgrade to 0.8.1 though, while your PR is on 0.8.0. I'm going to push my changes to your branch.

@novalagung
Copy link
Contributor Author

@aknuds1 sure, thank you

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@aknuds1 aknuds1 requested review from bergquist, papagian and marefr and removed request for oddlittlebird February 25, 2020 15:55
@aknuds1 aknuds1 changed the title BUGFIX: update the xorm dependency path Chore: Update the xorm dependency Feb 25, 2020
@aknuds1
Copy link
Contributor

aknuds1 commented Feb 25, 2020

I'd like to hear from my team mates before merging it, hopefully they can chime in.

@aknuds1
Copy link
Contributor

aknuds1 commented Feb 25, 2020

@novalagung I'm unable to reproduce your issue BTW:

➜  ~ go get -u github.com/grafana/grafana/pkg/tsdb 
➜  ~ 

It doesn't seem right to me either that an old version of github.com/go-xorm/core should change its module path?

@novalagung
Copy link
Contributor Author

the error only occur when go get performed inside go module.

~ mkdir app
➜  ~ cd app
➜  ~ go mod init app
➜  ~ go get -u github.com/grafana/grafana/pkg/tsdb

go: finding github.com/grafana/grafana/pkg latest
go: finding github.com/grafana/grafana/pkg/tsdb latest
...
go: github.com/grafana/grafana/pkg/tsdb imports
        github.com/go-xorm/core: github.com/go-xorm/core@v0.6.3: parsing go.mod:
        module declares its path as: xorm.io/core
                but was required as: github.com/go-xorm/core

@aknuds1
Copy link
Contributor

aknuds1 commented Feb 26, 2020

@marefr What's your take on this, since you said there have been troubles upgrading xorm in the past. Would you want for this PR to upgrade only to the first xorm version (0.8.0) after their module path changed (to xorm.io/xorm)?

@marefr
Copy link
Contributor

marefr commented Feb 28, 2020

@aknuds1 I'm a bit skeptic accepting this for the sake of supporting using tsdb package as dependency since there's not a problem currently for Grafana . We have had a lot of problems related to upgrading xorm historically with hidden breaking changes and upgrading needs detailed comparison/review of all their changes. If you still want to upgrade I agree that upgrading to the lowest version first is the way to go, but still detailed comparison/review of all their changes (all xorm packages that Grafana uses) is needed.

@marefr
Copy link
Contributor

marefr commented Feb 28, 2020

@novalagung out of curiosity what are you using Grafana's tsdb package for?

@aknuds1
Copy link
Contributor

aknuds1 commented Feb 28, 2020

@marefr Thanks for the clarification! I guess we should make it a future task for ourselves to go through the paces of upgrading xorm, including reviewing and testing. At the time being, I figure it's not enough of a priority.

@novalagung
Copy link
Contributor Author

@marefr actually I didn't use tdsb package exclusively on my work. I found out about the issue when I was stumble upon in stackoverflow, looking for recent unanswered questions. I found the issue and then decide to test it.

@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

@stale
Copy link

stale bot commented Mar 18, 2020

This pull request has been automatically marked as stale because it has not had activity in the last 2 weeks. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale Issue with no recent activity label Mar 18, 2020
@marefr marefr mentioned this pull request Mar 18, 2020
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM

@stale stale bot removed the stale Issue with no recent activity label Apr 1, 2020
@novalagung novalagung requested a review from a team as a code owner April 1, 2020 12:51
@aknuds1
Copy link
Contributor

aknuds1 commented Apr 1, 2020

I merged with latest Grafana master and pushed to your repo. Will merge it once the checks finish :)

Copy link
Contributor

@marefr marefr left a comment

Choose a reason for hiding this comment

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

LGTM

@aknuds1 aknuds1 merged commit ea35ae4 into grafana:master Apr 1, 2020
@novalagung
Copy link
Contributor Author

@marefr @aknuds1 thank you

@marefr
Copy link
Contributor

marefr commented Apr 2, 2020

@novalagung Thank you for contributing to Grafana!

@marefr marefr added this to the 7.0 milestone Apr 2, 2020
@marefr marefr changed the title Chore: Update the xorm dependency Database: Update the xorm dependency Apr 2, 2020
@marefr marefr changed the title Database: Update the xorm dependency Database: Update the xorm dependency to v0.8.1 Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants