Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the duplicate Flyway migration detection scripts to deduplicate by the migration “prefix” up to the numeric portion before __, avoiding false positives like treating all R__* files as duplicates.
Changes:
- Adjusted filename-prefix extraction logic to key on
..._<digits>__...prefixes (instead of splitting only on__). - Updated directory handling/quoting in the
findinvocation (partial/inconsistent between scripts).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
script.sh |
Adds a new prefix-extraction pipeline, but currently leaves the old pipeline in place (breaking the shell pipeline) and uses an undefined dirname variable. |
check.sh |
Replaces the prefix-extraction logic with a sed regex, but now operates on full paths and has inconsistent quoting in later find usage. |
Comments suppressed due to low confidence (2)
check.sh:8
- Inside the loop,
find $dirname -type fis unquoted. If the provided directory contains spaces or glob characters, this will break or scan unintended paths. Quote the variable consistently (as done in the earlierfind).
find $dirname -type f | grep "${fileName}" |
while read fname
script.sh:23
dirnameis not defined anywhere in this script, sofind $dirname -type fwill expand to an empty path and scan the current working directory instead ofINPUT_DIRECTORY. Use the same directory variable used for scanning (e.g.,INPUT_DIRECTORY) and quote it to handle spaces.
do
find $dirname -type f | grep "${fileName}" |
while read fname
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
albertcbrown
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deduplication logic improvements:
sedcommand in bothcheck.shandscript.shto use a regular expression that extracts file name prefixes ending with an underscore and digits, improving accuracy when identifying duplicates. Look for number and then "__" as the split where everything after is arbitrary, and the prefix is the key to dedup.Examples where "R__" was creating false positive.
Evidence:
❯ ./check.sh "/Volumes/veritone/aiware-core/services/api/core-graphql-server/flyway/db/platform/sql" /Volumes/veritone/aiware-core/services/api/core-graphql-server/flyway/db/platform/sql/V3_273__add_ingest_slugs_delete_by_source_event.sql:1:1: Duplicate filename -- V3_273 /Volumes/veritone/aiware-core/services/api/core-graphql-server/flyway/db/platform/sql/V3_273__recording_clone_mapping.sql:1:1: Duplicate filename -- V3_273