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

Fix include/includeAll to correct track relativeToChangelog=true paths using ./ or ../ #3355

Merged
merged 11 commits into from
Nov 17, 2022

Conversation

nvoxland
Copy link
Contributor

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

Changes in 4.17.0 made a changelog like <include file="./changelog.workspace.sql" relativeToChangelogFile="true"/> incorrectly include the ./ in the databasechangelog table and status --verbose among other places.

The correct fix is in the Resource's resolveSibling() function, but this is a temporary work around until we have a better solution in there.

Things to be aware of

  • Only impacts included changesets

Things to worry about

  • Nothing

…until it is correctly handled in ResourceAccessor
@github-actions
Copy link

github-actions bot commented Oct 10, 2022

Unit Test Results

  4 740 files  ±  0    4 740 suites  ±0   37m 12s ⏱️ + 3m 3s
  4 693 tests  - 18    4 457 ✔️  - 21     236 💤 +3  0 ±0 
55 536 runs   - 12  50 228 ✔️  - 17  5 308 💤 +5  0 ±0 

Results for commit bd5a3ea. ± Comparison against base commit 665a311.

♻️ This comment has been updated with latest results.

@borjapenman
Copy link

Using ../ when relativeToChangelog=true seems quite common use case. Is thsis going to be merged for the next release?

@filipelautert filipelautert added sprint2022-37 SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Nov 9, 2022
@filipelautert filipelautert self-assigned this Nov 9, 2022
@filipelautert filipelautert added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Nov 9, 2022
@nvoxland nvoxland removed the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Nov 9, 2022
Copy link
Collaborator

@filipelautert filipelautert left a comment

Choose a reason for hiding this comment

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

Fixed tests, so there is test coverage.

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

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

PR addresses a regression in the path shown some output messages and the value stored in DATABASECHANGELOG tracking table when include or includeAll changesets specify relativeToChangelog=true.

  • Automated functional and test harness executions passing.
  • New unit test added.
  • No additional testing required.

APPROVED

@filipelautert filipelautert merged commit 351cbbc into master Nov 17, 2022
@filipelautert filipelautert deleted the simple-include-path-fix branch November 17, 2022 14:34
filipelautert added a commit that referenced this pull request Nov 24, 2022
…th (Paths.get added on #3355 to normalize Strings removes it)
filipelautert added a commit that referenced this pull request Nov 28, 2022
…th (#3506)

* Fixes behaviour of includeAll by KEEPING the trailing slash on the path (Paths.get added on #3355 to normalize Strings removes it)
@filipelautert filipelautert added this to the 4.18.0 milestone Nov 29, 2022
@SamD
Copy link

SamD commented Dec 14, 2022

This impacts existing migrations so this is a breaking change wouldn't it be ?

On migration , for a sql file, the filename will include the path separator in the changelog table
With this update that name no longer matches on a deployment so the existing migration attempts to run again
checksums are equal , names are different

@filipelautert
Copy link
Collaborator

This impacts existing migrations so this is a breaking change wouldn't it be ?

On migration , for a sql file, the filename will include the path separator in the changelog table With this update that name no longer matches on a deployment so the existing migration attempts to run again checksums are equal , names are different

Well, it went back to as it was before 4.17.0 . So if you already faced this problem with 4.17 you need to run clearChecksums before upgrading.

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

Successfully merging this pull request may close these issues.

None yet

7 participants