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

Machine-readable Flyway Info #2254

Closed
esauser opened this issue Jan 9, 2019 · 9 comments

Comments

@esauser
Copy link

@esauser esauser commented Jan 9, 2019

It would be nice to be able to specify a format for Flyway Info (i.e JSON).

@axelfontaine

This comment has been minimized.

Copy link
Member

@axelfontaine axelfontaine commented Jan 9, 2019

What exactly is your usecase for this? Please describe in detail.

@esauser

This comment has been minimized.

Copy link
Author

@esauser esauser commented Jan 9, 2019

We currently use the output for two purposes in our pipelines:

  1. During the Pull Request Verify job of our pipeline we execute Flyway Info and parse the output to post a message back to GitHub indicating the current schema version and which migrations will ultimately be executed (those pending) upon merge of the Pull Request. Here is an example.
    image

  2. We also use the same to execute a query back to the flyway_schema_history table to determine the path of the pending migrations so that we can do other work with them. If Flyway Info returned the path, we wouldn't need to do that.

We have both cases working, but it's a bit fragile parsing the text output. There were significant breaking changes to it when moving to 5. Hence, it would be nice to have the option for formatted output that we can rely upon and more easily parse.

@axelfontaine axelfontaine changed the title Formatted Flyway Info Machine-readable Flyway Info Jan 9, 2019
@axelfontaine axelfontaine added this to the Someday-Maybe milestone Jan 9, 2019
@molexx

This comment has been minimized.

Copy link

@molexx molexx commented Apr 16, 2019

We'd like to find out the currently deployed version in a gradle build, please consider a specific field for that to save looping/parsing.

It might also be useful to know the latest version available, I appreciate we could work this out by listing a directory and applying a regex and sorting but I'd rather defer to flyway's algorithm on that.

@juliahayward

This comment has been minimized.

Copy link
Member

@juliahayward juliahayward commented Jun 20, 2019

Would you be open to a pull request for JSON-formatting the output of info ?

@axelfontaine

This comment has been minimized.

Copy link
Member

@axelfontaine axelfontaine commented Jun 20, 2019

@juliahayward Not at this time. This is a feature we want to revisit after the 6.0 release and analyse how it could be generalised to all commands instead of making it specific to info.

@MikielAgutu

This comment has been minimized.

Copy link
Member

@MikielAgutu MikielAgutu commented Aug 22, 2019

At the moment Info doesn't give all the information in the schema history table. As part of this work exposing all the information in the table might be valuable for some users.

@juliahayward

This comment has been minimized.

Copy link
Member

@juliahayward juliahayward commented Sep 12, 2019

Just as a reminder - please make sure any new dependency (eg. Gson) is restricted to the command-line, not core...

@juliahayward

This comment has been minimized.

Copy link
Member

@juliahayward juliahayward commented Nov 26, 2019

Implemented for flyway info in 6.1.0. Please open new issues for any extensions to other commands.

@esauser

This comment has been minimized.

Copy link
Author

@esauser esauser commented Nov 26, 2019

@juliahayward can you reference and pull requests, commits, or documentation for how this will be implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.