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

Update command sends "Database is up to date, no changesets to execute" to console when show-summary-output is set to log #5892

Open
1 of 2 tasks
jpallas opened this issue May 8, 2024 · 1 comment

Comments

@jpallas
Copy link

jpallas commented May 8, 2024

Search first

  • I searched and no similar issues were found

Description

The message "Database is up to date, no changesets to execute" appears on the console when the update command has no work to do. Sample output (this is using our custom JSON logger):

{"timestamp":"2024-05-08T08:43:59.944-0700","thread":"main","logger":"liquibase.database.core.PostgresDatabase","message":"Set default schema name to public","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:00.251-0700","thread":"main","logger":"liquibase.changelog.StandardChangeLogHistoryService","message":"Reading from public.databasechangelog","severity":"INFO"}
Database is up to date, no changesets to execute
{"timestamp":"2024-05-08T08:44:00.791-0700","thread":"main","logger":"liquibase.changelog.StandardChangeLogHistoryService","message":"Reading from public.databasechangelog","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:00.840-0700","thread":"main","logger":"liquibase.util.ShowSummaryUtil","message":"UPDATE SUMMARY","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:00.840-0700","thread":"main","logger":"liquibase.util.ShowSummaryUtil","message":"Run:                          0","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:00.840-0700","thread":"main","logger":"liquibase.util.ShowSummaryUtil","message":"Previously run:              19","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:00.840-0700","thread":"main","logger":"liquibase.util.ShowSummaryUtil","message":"Filtered out:                 0","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:00.840-0700","thread":"main","logger":"liquibase.util.ShowSummaryUtil","message":"-------------------------------","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:00.840-0700","thread":"main","logger":"liquibase.util.ShowSummaryUtil","message":"Total change sets:           19","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:00.841-0700","thread":"main","logger":"liquibase.util.ShowSummaryUtil","message":"Update summary generated","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:01.189-0700","thread":"main","logger":"liquibase.lockservice.StandardLockService","message":"Successfully released change log lock","severity":"INFO"}
{"timestamp":"2024-05-08T08:44:01.237-0700","thread":"main","logger":"liquibase.command.CommandScope","message":"Command execution complete","severity":"INFO"}

Steps To Reproduce

The code we are running looks like this:

            Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connection));
            CommandScope updateCommand = new CommandScope(UpdateCommandStep.COMMAND_NAME);
            updateCommand.addArgumentValue(UpdateCommandStep.CHANGELOG_FILE_ARG, "db/migration/changelog.yaml");
            updateCommand.addArgumentValue(DbUrlConnectionCommandStep.DATABASE_ARG, database);
            updateCommand.addArgumentValue(ShowSummaryArgument.SHOW_SUMMARY_OUTPUT, UpdateSummaryOutputEnum.LOG);
            var results = updateCommand.execute();

Expected/Desired Behavior

If show-summary-output is set to log, all output from the command should be through the logging system.

Liquibase Version

4.27.0

Database Vendor & Version

PostgreSQL 12

Liquibase Integration

No response

Liquibase Extensions

No response

OS and/or Infrastructure Type/Provider

macOS and Linux

Additional Context

This message is DATABASE_UP_TO_DATE_MESSAGE in AbstractUpdateCommandStep. It appears in two places. I'm suspicious of this one in isUpToDate

            Scope.getCurrentScope().getUI().sendMessage(DATABASE_UP_TO_DATE_MESSAGE);

just because getUI sounds like something that might bypass the log system.

Forum discussion

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
@tati-qalified
Copy link
Contributor

Hi @jpallas, thank you for reporting this issue.
I agree that the message shouldn't be showing up on the console, and that the getUI() method might be directing it there instead of the configured logging system.

Would you be willing to submit a PR? Our development team will be available to provide guidance if necessary.

Thank you,
Tatiana

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

No branches or pull requests

3 participants