Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Plugin updates #113

Merged
merged 4 commits into from
Jun 27, 2019
Merged

Plugin updates #113

merged 4 commits into from
Jun 27, 2019

Conversation

rmulhol
Copy link
Contributor

@rmulhol rmulhol commented Jun 27, 2019

  • Emit specific errors with custom errors when execution fails
  • Put tmp directories inside vdb directory (so we don't need permissions outside of it for execution)
  • Call goose via library rather than binary (so we don't need the binary in the execution environment)

cmd/root.go Outdated
fmt.Println("Error: ", invalidConfigError)
log.Fatal(invalidConfigError)
formattedError := fmt.Sprintf("%s: %s", invalidConfigError, err.Error())
log.Fatal(formattedError)
os.Exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big deal, but log.Fatal calls os.Exit(1) so you can lose this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll just rebase on your PR :D

rmulhol added 4 commits June 27, 2019 13:58
- include actual error to highlight the specific issue
- enable separator between home and migrations dir
- Removes dependency on goose binary existing in plugin execution
  environment
Copy link
Contributor

@elizabethengelman elizabethengelman left a comment

Choose a reason for hiding this comment

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

:shipit:

@rmulhol rmulhol merged commit af6190e into staging Jun 27, 2019
@rmulhol rmulhol deleted the plugin-updates branch June 27, 2019 19:11
mkdirErr := os.Mkdir(m.tmpMigDir, os.FileMode(os.ModePerm))
if mkdirErr != nil {
mkdirErrString := "unable to create temporary migration directory %s: %s"
return errors.New(fmt.Sprintf(mkdirErrString, m.tmpMigDir, mkdirErr.Error()))
Copy link
Contributor

@m0ar m0ar Jun 28, 2019

Choose a reason for hiding this comment

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

fmt.Errorf fyi, saves you a trip to the Sprintf :)

@m0ar
Copy link
Contributor

m0ar commented Jun 28, 2019

@rmulhol Late to the party, but great fixes! Especially nice with more expressive error messages 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants