Skip to content

feat: add badword and elevateword CSV upload/download commands - #57

Merged
marevol merged 1 commit into
fix/exit-code-all-formatsfrom
feat/badword-elevateword-csv
Nov 15, 2026
Merged

marevol merged 1 commit into
fix/exit-code-all-formatsfrom
feat/badword-elevateword-csv

Conversation

@marevol

@marevol marevol commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the CSV import/export endpoints of the Fess admin API that fessctl had no command for:

  • fessctl badword upload <file> [--yes] / fessctl badword download [--file PATH] [--force]
  • fessctl elevateword upload <file> [--yes] / fessctl elevateword download [--file PATH] [--force]

The multipart upload and the file download helpers in the client are shared with the existing dictionary upload/download. Like dict upload, the upload is refused client-side on Fess 15.6 to 15.8, where the server cannot read the multipart request (POST is accepted from 15.9).

Server behaviour worth knowing (documented in badword.md / elevateword.md):

  • The import runs in the background; upload returning success means the file was accepted. The import merges with existing words instead of replacing them.
  • The first line of the file is always treated as a header and skipped.
  • Bad words: a line starting with -- deletes that word; only the first column is read, and the import does not understand CSV quoting although the export quotes every field, so words containing , or " do not round-trip.
  • Elevate words: a row for an existing word with empty reading and boost deletes it; other rows overwrite reading, permissions and boost.

Tests

  • Unit tests for both commands (success and failure exit codes in all formats, confirmation prompt, --force, missing file and existing target file (reported in the requested output format, before any download), multipart field names, unicode); they fail without the change.
  • Integration tests for both commands, passing on Fess 15.9.0 and a 15.10 snapshot.

Stacked on the previous PR in this series.

Add `badword upload|download` and `elevateword upload|download` for the
CSV import and export endpoints of the Fess admin API.

- upload asks for confirmation unless --yes; the import merges into the
  existing words and Fess runs it in the background, so success means the
  file was accepted
- download writes to standard output or --file (--force to overwrite)
- upload is refused client-side on Fess 15.6 to 15.8, as for dict upload
- share the multipart upload and download code with the dict commands
- document the CSV format and the import semantics in the skill references
@marevol
marevol force-pushed the feat/badword-elevateword-csv branch from 4fabb30 to 63d5910 Compare November 15, 2026 09:53
@marevol
marevol added this pull request to stack #61 November 15, 2026 10:52
@marevol marevol self-assigned this Nov 15, 2026
@marevol marevol added this to the 0.5.0 milestone Nov 15, 2026
@marevol
marevol merged commit 977ef51 into main Nov 15, 2026
16 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.

1 participant