馃悰 Bug Report: CLI ignore patterns with non-ASCII characters never match, so ignored files are deployed聽#2129
Description
馃憻 Reproduction steps
The Go CLI decides what goes into a function or site deployment with internal/ignore (templates/cli/internal/ignore/ignore.go). It handles .gitignore and the ignore field in appwrite.config.json. If a pattern contains any non-ASCII character, it never matches anything.
- Create a function directory:
fn/ .gitignore -> "donn茅es/\nsecret-茅.env\n" index.js donn茅es/prod.env secret-茅.env secret-e.env - Run
appwrite functions create-deployment --function-id fn1 --code ./fn --activate true.appwrite push functionsuses the same packaging code. - List the uploaded archive. I captured it with a local mock API:
.gitignore donn茅es/prod.env index.js secret-e.env secret-茅.env
Cause: translate() loops over the pattern byte by byte and writes regexp.QuoteMeta(string(character)), where character is a byte. In Go, string(byte) converts the byte to a rune. Each byte of a multi-byte UTF-8 character (茅 = C3 A9) therefore turns into a different character (脙, 漏), and the compiled regexp cannot match the real path. The escape branch (\茅) has the same problem.
馃憤 Expected behavior
Patterns match the way the ignore npm package matches them (the package mirrors that library and pins it with testdata/cases.json). ignore@7 reports donn茅es/secret.env, secret-茅.env, x.caf茅 and 鏃ユ湰/a/b.key as ignored for the patterns donn茅es/, secret-茅.env, *.caf茅 and 鏃ユ湰/**/*.key. Those files should be left out of the deployment archive.
馃憥 Actual Behavior
No pattern that contains a non-ASCII character matches. The files they should exclude are packed and uploaded with the deployment. That can include secrets such as .env files kept in a directory with an accented name.
馃幉 Appwrite version
Different version (specify in environment)
馃捇 Operating system
MacOS
馃П Your Environment
The CLI generated from appwrite/sdk-generator main (0955bec). The same code ships in appwrite/sdk-for-cli 28.8.0 (internal/ignore/ignore.go lines 197 and 204). Tested on macOS arm64 with Go 1.26.
馃憖 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
馃彚 Have you read the Code of Conduct?
- I have read the Code of Conduct
I have a fix with a regression test ready. Could this be assigned to me so I can open a PR?
Activity
parth-garg01 commentedon Oct 22, 2026
Hi! I've already got a fix for this with a regression test that fails before the change and passes after it. Could you please assign this issue to me so I can open the PR? Thanks!
ChiragAgg5k commentedon Oct 23, 2026
Thanks for reporting this. We reproduced the deployment archive issue and fixed it in #2136, included in SDK Generator 5.13.10.
The generated CLI now preserves Unicode literals and escapes in ignore patterns, including negations. Regression coverage and before/after staging source-archive downloads confirmed that both
.gitignoreand config ignore rules exclude the intended files and preserve explicitly restored files.