Skip to content

fix(cli): preserve Unicode in deployment ignore patterns - #2136

Merged
ChiragAgg5k merged 1 commit into
appwrite:mainfrom
ChiragAgg5k:fix/cli-unicode-ignore
Oct 23, 2026
Merged

ChiragAgg5k merged 1 commit into
appwrite:mainfrom
ChiragAgg5k:fix/cli-unicode-ignore

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Fixes #2129.

Literal Unicode characters in deployment ignore patterns were converted one UTF-8 byte at a time into separate characters (é became é). Files explicitly excluded by .gitignore or the resource's ignore array could therefore be uploaded. Unicode negations could also fail to restore source files excluded by a preceding rule.

Preserve each complete UTF-8 character when translating literal and escaped pattern characters, while retaining the existing glob and bracket-class handling. Add a CLI regression that inspects the actual multipart deployment tar received by a local HTTP server for both .gitignore and config rules. It covers accented and Japanese paths, wildcard extensions, escaped Unicode, negation, and ASCII/bracket-class controls.

Staging verification

Verified on 2026-10-23 using an existing staging login against https://fra.cloud.staging.appwrite.io/v1, in a disposable project. Compared the unmodified generated CLI from ce0b4844c with the fixed generated CLI, both built with Go 1.26.5.

For each binary, uploaded once through functions create-deployment --code ./fn --activate=false using .gitignore, and once through push function --activate=false --async --force --no-logs using the config's ignore array. Downloaded each deployment's source archive with functions get-deployment-download --type source and inspected its entries.

Patterns included données/, secret-é.env, *.café, 日本/**/*.key, \é.env, secret-e.env, [é].txt, *.log, !résumé.log, and src/*.tmp.

Archive contents Before After
données/prod.env, secret-é.env, x.café, 日本/a/b.key, é.env Uploaded despite exclusion Excluded
résumé.log Incorrectly excluded; Unicode negation failed Included
secret-e.env, é.txt, src/temp-é.tmp Excluded Excluded
index.js, src/visible-é.js Included Included

Both deployment paths produced these results. After the fix, the archives contain only index.js, résumé.log, and src/visible-é.js, plus .gitignore for the direct deployment case. This also confirms the issue's blanket “non-ASCII patterns never match” wording has exceptions: bracket classes such as [é] already work.

Only dummy file contents were uploaded; the function was disabled and all four deployments used activate=false. Deleted the disposable project afterward and verified it could no longer be fetched.

Validation

  • The new archive regression fails against the baseline CLI and passes against the fixed CLI.
  • Regenerated with php example.php cli; generated output passes gofmt -l without formatting after generation.
  • Generated CLI: Go 1.26.5 go build, go vet ./..., and go test ./... pass.
  • vendor/bin/phpunit tests/e2e/CLIGo126Test.php passes (1 test, 26 assertions).
  • composer refactor:check, composer lint-twig, PHP CodeSniffer, and scoped PHPStan on tests/e2e/CLIGo126Test.php pass.

Related: appwrite-labs/cloud#6667

@hansi-codes

hansi-codes Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The UTF-8 decoding change preserves the existing ASCII glob handling, and the new regression exercises both ignore-rule sources against the actual uploaded archive.

The CLI ignore-pattern translator now decodes complete UTF-8 characters before quoting literal and escaped pattern characters. The CLI end-to-end conformance harness checks the uploaded deployment archive against Unicode .gitignore and config ignore rules, including wildcard, negation, and bracket-class cases.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 3
File Change
templates/cli/internal/ignore/ignore.go Decode and quote full UTF-8 characters in literal and escaped patterns.
tests/e2e/CLIGo126Test.php Add the Unicode deployment archive check to expected CLI conformance output.
tests/e2e/languages/cli/main.go Use a local HTTP server to inspect archives uploaded with Unicode ignore rules.

Reviewed 102f2d8 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 23, 2026

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k
ChiragAgg5k merged commit 6d4e7df into appwrite:main Oct 23, 2026
61 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/cli-unicode-ignore branch October 23, 2026 08:59
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.

🐛 Bug Report: CLI ignore patterns with non-ASCII characters never match, so ignored files are deployed

1 participant