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

Flag for error on ignored versioned migration #287

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zanebclark
Copy link

This is a resurrection of PR 222 and 275:

  • Add two CLI arguments:
    • raise-exception-on-ignored-version-script: At my shop, we're using epoch time as our version number. If you create a script with an epoch time and your colleague merges their changes in before you get a chance to, the max_published_version will cause schemachange will skip your script without complaint. To address this, I handle versioned scripts almost identically to repeatable scripts. I store the metadata on the script's execution in a dictionary and compare that to the scripts in the script directory. If a script is "stale", hasn't been applied, and the flag is true: I raise an exception.
    • version-number-validation-regex: Again, we're using epoch time as the version number in my shop. If someone deploys a script prefixed with Vspam__, future scripts versioned with the current epoch time will be skipped. The max_published_version is now spam and cannot be trumped by a number. To address this, I've added a version_number_validation_regex CLI argument that will reject spam as a version number if I've specificed \d{10}

@zanebclark zanebclark changed the title Feature/flag for error on ignored versioned migration Flag for error on ignored versioned migration Oct 8, 2024
@zanebclark
Copy link
Author

@sfc-gh-tmathew , this is the new feature pull request you asked for as part of 275

@zanebclark
Copy link
Author

@sfc-gh-tmathew @jamesweakley @sfc-gh-jhansen, Any thoughts on getting this feature into main?

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.

1 participant