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

#18: Add utilities for assisting with common migration logic #19

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

cpointe-ibllanos
Copy link
Contributor

@cpointe-ibllanos cpointe-ibllanos commented Jun 27, 2024

Add: file utils, common utils for use in migration logic by users
Working example for using utils to write a migration
Update docs to mention utils

BDDs

  • Scenario: I can leverage migration utilities from Baton in my custom migration implementations
    ** Given I have created a new baton migration that imports the baton utils class
    ** And the util methods are used or extended inside the custom migration
    ** When The migration runs
    ** Then The the migration should finish successfully

  • Scenario: I want to easily replace a string in a file using a regex expression
    ** Given I have a file containing the string "123abc456"
    ** When I use the regex "(?<=123).*(?=456)" to substitute "def"
    ** Then the file should now contain the string "123def456"

  • Scenario: I want to easily replace a substring of a string in a file using a regex expression
    ** Given I have a file containing the string "123abc456"
    ** When I use the regex "123.*456" to substitute "abc" with "def"
    ** Then the file should now contain the string "123def456"

  • Scenario: I want to easily test if a string is present in a file using a regex expression
    ** Given I have a file containing the string "123abc456"
    ** When I use the regex "123.*456" to search for matches in a file
    ** Then the match result should be "true"

  • Scenario: I want to easily be able to pull out specific substrings from a string using regex capture groups
    ** Given I have a string containing "123abc456"
    ** When I use the regex "123(.*)456" to retrieve capture groups
    ** Then the size of the retrieved capture groups should be "1"
    ** And the capture groups should include
    |abc|

  • Scenario: I want to easily be able to pull out specific strings from a file using regex capture groups
    ** Given I have a file containing the string "123abc456"
    ** When I use the regex "(123).*(456)" to retrieve capture groups
    ** Then the size of the retrieved capture groups should be "2"
    ** And the capture groups should include
    |123|
    |456|

Test Steps

  1. Pull down and open Baton
  1. Confirm the Baton bootstrap build is successful and tests pass
  • mvn clean install -Pbootstrap -Dmaven.build.cache.enabled=false
  1. Confirm the Baton example projects build successfully
  • mvn clean install -Pdefault -Dmaven.build.cache.enabled=false

Copy link
Contributor

@d-ryan-ashcraft d-ryan-ashcraft left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. A couple minor items I'd recommend cleaning up before committing.

 Add: file utils, common utils for use in migration logic by users
 Working example for using utils to write a migration
 Update docs to mention utils
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.

3 participants