Skip to content

Do not check prefix in delete list#162

Merged
leborchuk merged 1 commit intomasterfrom
FixPrefixDeletionCheck
Mar 12, 2026
Merged

Do not check prefix in delete list#162
leborchuk merged 1 commit intomasterfrom
FixPrefixDeletionCheck

Conversation

@leborchuk
Copy link
Contributor

@leborchuk leborchuk commented Mar 12, 2026

func (s *S3StorageInteractor) ListBucketPath from s3storage.go delete prefix while creating list of files on prefix:

			cPath, ok := strings.CutPrefix(path, s.cnf.StoragePrefix)
			if !ok {
				ylogger.Zero.Debug().Str("path", path).Msg("skipping file")
				continue
			}

This is a protection against accidental listing of unnecessary files.

In ListDelete2Files we check if filename has prefix once again. And since prefix was cut from file got empty list for deletion. Add test for Delete2 message and remove check - not need to check for prefix again,

@github-actions
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (27)
alloc
Burstable
CGO
COPYV
cpath
fds
gogc
gomaxprocs
gomemlimit
goroutines
inuse
LISTV
mallocs
mcache
memstats
mspan
mws
promauto
promhttp
PUTV
qfkbl
sched
setport
Sourced
TSTo
Vec
ydt
These words are not needed and should be removed persisnt

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:open-gpdb/yproxy.git repository
on the FixPrefixDeletionCheck branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/open-gpdb/yproxy/actions/runs/23004721680/attempts/1' &&
git commit -m 'Update check-spelling metadata'

OR

To have the bot accept them for you, comment in the PR quoting the following line:
@check-spelling-bot apply updates.

Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (238) from .github/actions/spelling/expect.txt and unrecognized words (27)

Dictionary Entries Covers Uniquely
cspell:golang/dict/go.txt 2099 15 5
cspell:node/dict/node.txt 891 15 2
cspell:php/dict/php.txt 1689 14 2
cspell:python/src/python/python-lib.txt 2417 14 2
cspell:dotnet/dict/dotnet.txt 405 7

Consider adding them (in .github/workflows/spelling.yaml) in jobs:/spelling: for uses: check-spelling/check-spelling@main in its with:

      with:
        extra_dictionaries: |
          cspell:golang/dict/go.txt
          cspell:node/dict/node.txt
          cspell:php/dict/php.txt
          cspell:python/src/python/python-lib.txt
          cspell:dotnet/dict/dotnet.txt

To stop checking additional dictionaries, add (in .github/workflows/spelling.yaml) for uses: check-spelling/check-spelling@main in its with:

check_extra_dictionaries: ""
Pattern suggestions ✂️ (9)

You could add these patterns to .github/actions/spelling/patterns.txt:

# Automatically suggested patterns

# hit-count: 13 file-count: 8
# https/http/file urls
(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/*%?=~_|!:,.;]+[-A-Za-z0-9+&@#/*%=~_|]

# hit-count: 8 file-count: 2
# version suffix <word>v#
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))

# hit-count: 4 file-count: 4
# uuencoded
[!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_]{40,}

# hit-count: 4 file-count: 2
# C network byte conversions
(?:\d|\bh)to(?!ken)(?=[a-z])|to(?=[adhiklpun]\()

# hit-count: 4 file-count: 1
# container images
image: [-\w./:@]+

# hit-count: 1 file-count: 1
# scala imports
^import (?:[\w.]|\{\w*?(?:,\s*(?:\w*|\*))+\})+

# hit-count: 1 file-count: 1
# Debian changelog severity
[-\w]+ \(.*\) (?:\w+|baseline|unstable|experimental); urgency=(?:low|medium|high|emergency|critical)\b

# hit-count: 1 file-count: 1
# Compiler flags (Unix, Java/Scala)
# Use if you have things like `-Pdocker` and want to treat them as `docker`
(?:^|[\t ,>"'`=(])-(?:(?:J-|)[DPWXY]|[Llf])(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})

# hit-count: 1 file-count: 1
# Compiler flags (Windows / PowerShell)
# This is a subset of the more general compiler flags pattern.
# It avoids matching `-Path` to prevent it from being treated as `ath`
(?:^|[\t ,"'`=(])-(?:[DPL](?=[A-Z]{2,})|[WXYlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}))

Alternatively, if a pattern suggestion doesn't make sense for this project, add a #
to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Notices ℹ️ (1)

See the 📂 files view, the 📜action log, or 📝 job summary for details.

ℹ️ Notices Count
ℹ️ candidate-pattern 15

See ℹ️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

🚂 If you're seeing this message and your PR is from a branch that doesn't have check-spelling,
please merge to your PR's base branch to get the version configured for your repository.

@leborchuk leborchuk merged commit 079112e into master Mar 12, 2026
9 checks passed
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.

2 participants