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

The onSqlOutput attribute does not work for preconditions in formatted SQL changelogs. #3436

Merged
merged 7 commits into from
Nov 8, 2022

Conversation

diadiushko
Copy link
Contributor

@diadiushko diadiushko commented Nov 3, 2022

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

The attribute to control the behavior of update-sql when using preconditions is onUpdateSQL for formatted SQL changelogs. For all other changelog formats, the attribute is onSqlOutput. We should be consistent so that the same attribute works for all changelog formats. That is, users of formatted sql changelogs should be able to use onSqlOutput.

Things to be aware of

  • None

Things to worry about

  • None

@diadiushko diadiushko self-assigned this Nov 3, 2022
@github-actions
Copy link

github-actions bot commented Nov 3, 2022

Unit Test Results

  4 668 files  ±  0    4 668 suites  ±0   34m 27s ⏱️ +50s
  4 626 tests  - 16    4 397 ✔️  - 19     229 💤 +3  0 ±0 
54 720 runs  +12  49 596 ✔️ +  7  5 124 💤 +5  0 ±0 

Results for commit 7e22577. ± Comparison against base commit 8305293.

♻️ This comment has been updated with latest results.

@diadiushko diadiushko marked this pull request as ready for review November 3, 2022 13:27

PreconditionContainer pc = new PreconditionContainer();
pc.setOnFail(StringUtil.trimToNull(parseString(onFailMatcher)));
pc.setOnError(StringUtil.trimToNull(parseString(onErrorMatcher)));
pc.setOnSqlOutput(StringUtil.trimToNull(parseString(onUpdateSqlMatcher)));
if (onSqlOutputMatcher.matches()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@dyadyushko Can you handle the condition that if changelog contains both onUpdateSql and onSqloutput in which case, we should throw an error, "Please modify the changelog to have preconditions set with either "onUpdateSql" or "onSqlOutput"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good solution

@suryaaki2 suryaaki2 changed the title DAT-11294 The onSqlOutput attribute does not work for preconditions in formatted SQL changelogs. The onSqlOutput attribute does not work for preconditions in formatted SQL changelogs. Nov 4, 2022
@suryaaki2 suryaaki2 merged commit b88ce92 into master Nov 8, 2022
@suryaaki2 suryaaki2 deleted the DAT-11294 branch November 8, 2022 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants