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

Bump github.com/gobuffalo/pop/v6 from 6.0.6 to 6.0.8 #9390

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Oct 18, 2022

Bumps github.com/gobuffalo/pop/v6 from 6.0.6 to 6.0.8.

Release notes

Sourced from github.com/gobuffalo/pop/v6's releases.

v6.0.8

What's Changed

Full Changelog: gobuffalo/pop@v6.0.7...v6.0.8

v6.0.7

What's Changed

New Contributors

Full Changelog: gobuffalo/pop@v6.0.6...v6.0.7

Commits
  • 482c695 upgraded module dependencies
  • 8919b88 added or replaced stale issue closer with standard version
  • 5a179e7 updated README, SHOULDERS, and module dependencies
  • 9efb85f prevent empty query to be executed
  • d71c504 fixed concurrent map write issue on ConnectionDetails.Options (#577)
  • 902a7d1 fixed delete + where in issue on mysql (#699)
  • 9a26827 made 'version' colume as primary key to fix #659
  • df9e1b2 made default logger to print output to stderr instead of stdout
  • b0c857d fix Connection.Close() to reset the store
  • 98751a9 removed mysqldump option --column-statistics to make it compatible
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Oct 18, 2022
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch from f47861b to fb619dc Compare October 19, 2022 14:51
@ghost
Copy link

ghost commented Oct 19, 2022

@dependabot rebase

@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch from fb619dc to 377fc15 Compare October 19, 2022 16:27
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch from 377fc15 to 6badb4c Compare October 19, 2022 21:24
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch from 6badb4c to bd2ee59 Compare October 20, 2022 13:17
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch from bd2ee59 to d78e907 Compare October 21, 2022 13:28
@scottmries
Copy link
Contributor

@dependabot rebase

@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch from d78e907 to 9f5d857 Compare October 25, 2022 18:40
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch 2 times, most recently from 9c3c0a0 to 85900b2 Compare November 1, 2022 14:26
@reggieriser
Copy link
Contributor

@dependabot rebase

Bumps [github.com/gobuffalo/pop/v6](https://github.com/gobuffalo/pop) from 6.0.6 to 6.0.8.
- [Release notes](https://github.com/gobuffalo/pop/releases)
- [Changelog](https://github.com/gobuffalo/pop/blob/main/.goreleaser.yml)
- [Commits](gobuffalo/pop@v6.0.6...v6.0.8)

---
updated-dependencies:
- dependency-name: github.com/gobuffalo/pop/v6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch from 85900b2 to c68f931 Compare November 2, 2022 20:20
@reggieriser
Copy link
Contributor

It looks like our failing tests are due to this change in Pop 6.0.7. In a nutshell, in some tests, we were calling the Close method multiple times for a connection in a couple of cases and that caused a panic since the referenced Pop PR now sets the connection's Store to nil on a close. So, the second time calling Close, Pop was attempting to use the Store when it was already nil, thus leading to the panic.

I've added changes that hopefully prevent our second calls to Close.

err := popConn.Close()
if err != nil {
log.Panic(err)
if popConn.Store != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since I don't know what may have happened leading up this Cleanup call, I didn't see a way to prevent the panic here other than introspecting the Store to see if it was nil. If it's nil, I'm assuming the connection has already been closed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've reworked this to handle it in a different way that involves changes to the offending test and closing a connection that leads to a panic. Hopefully a little cleaner.

@@ -687,7 +689,7 @@ func (suite *PopTestSuite) TearDown() {
log.Panic(err)
}
}
if suite.highPrivConn != nil {
if suite.highPrivConn != nil && suite.highPrivConn != suite.lowPrivConn {
Copy link
Contributor

Choose a reason for hiding this comment

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

The problem here seemed to be that we had cases where the low and high privileged connections were the same. If that's the case, closing both would lead to two Close calls on the same connection and therefore a panic in Pop 6.0.8.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure the problem is that per test transactions cleanup themselves via a Cleanup callback. So I think the right fix is something like

	// Remove the package DB if this isn't a per test transaction
	if !suite.usePerTestTransaction {
		if err := dropDB(suite.pgConn, (*suite.lowPrivConnDetails).Database); err != nil {
			log.Panic(err)
		}
		// suite.pgConn will be closed by a suite.T().Cleanup function
		// for per test transaction tests, so we only need to clean it
		// up here for non transaction tests
		err := suite.pgConn.Close()
		if err != nil {
			log.Panic(err)
		}
	}

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused about the above change/comment. Isn't the Cleanup function cleaning up a different connection (popConn that's created on a DB() call?) vs. the pgConn here that's created on a NewPopTestSuite call? Or are those actually the same connection?

Copy link
Contributor

@ahobson ahobson left a comment

Choose a reason for hiding this comment

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

This is SUCH GOOD WORK. Thank you

@mergify mergify bot merged commit fe47014 into master Nov 4, 2022
@mergify mergify bot deleted the dependabot/go_modules/github.com/gobuffalo/pop/v6-6.0.8 branch November 4, 2022 16:31
reggieriser added a commit that referenced this pull request Nov 4, 2022
…github.com/gobuffalo/pop/v6-6.0.8"

This reverts commit fe47014, reversing
changes made to 6a4034d.
ahobson pushed a commit that referenced this pull request Nov 7, 2022
…github.com/gobuffalo/pop/v6-6.0.8"

This reverts commit fe47014, reversing
changes made to 6a4034d.
reggieriser added a commit that referenced this pull request Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file ready-to-merge
Development

Successfully merging this pull request may close these issues.

None yet

3 participants