Regenerate .mo catalogs after #458 backport - #469
Open
jacalata wants to merge 10 commits into
Open
Conversation
* Require --db-server for embedded credentials/oauth workbook publishing, fix connections payload * Translations for publish.options.db-server message * Simplify changes * Adjust tests
PR #458 fixed the two publish crashes when using --db-username / --db-password / --save-db-password, but callers who omit --db-server still hit a raw ValueError from tableauserverclient's _add_connections_element. Fail fast in run_command with a clear, localizable message before we build the ConnectionItem so users get an actionable error instead of an internal stack trace. Update the existing no-db-server test to assert the exit path and add the parallel coverage for the --oauth-username branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extend the online publish suite with: - A positive assertion for the happy path: test_wb_publish_embedded now passes --db-server matching the connection host baked into EmbeddedCredentials.twb (see-internal-slack). Without a matching server_address, tableauserverclient silently drops the embedded credentials at publish time, so covering the match is what actually proves the fix. - A negative assertion: test_wb_publish_embedded_missing_db_server_fails runs publish with --db-username but no --db-server and expects a non-zero exit. The check now fires in run_command before any network work, so hardcoded placeholder creds are sufficient. Threads a db_server keyword through the _publish_creds_args helper and records the workbook's connection host as a class constant. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Scope the guard to workbook publishes only. Datasource publishes go through _add_credentials_element on the TSC side, which never requires server_address, so the previous unconditional check was a regression for `tabcmd publish live_mysql.tds --db-username ...` and similar. The guard now checks the target filename extension early (before auth, for fast failure) and repeats per-file inside the workbook branch of the loop for the folder-publish case. Rename the `credentials` parameter of `publish_workbook_file` to `connection` — it holds a single ConnectionItem, not a list. Tests: - Add test_publish_with_oauth_creds covering the oauth branch's server_address assignment (previously untested). - Add test_publish_datasource_with_db_username_no_db_server verifying datasource publishes are not blocked when --db-server is omitted. - Strengthen the e2e negative test to run tabcmd via subprocess.run, capture stdout/stderr, and assert on the localized guard message (or the raw key when .mo has not been regenerated). Any earlier unrelated failure — bad auth, missing asset, session expiry — now fails the test rather than passing it. - Trim the misleading class-constant comment on TWB_FILE_EMBEDDED_ CONNECTION_SERVER; reword the "before we touch the database" comment to reference the guard's contract instead of a specific location. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This reverts commit cfe52c1.
This reverts commit 9581329.
This reverts commit d59ee65.
The success-print branch referenced uniques instead of unique_lines, breaking doit properties when input files contained no non-'=' non- codestring lines. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Compiles the new `publish.options.db-server` help-text key added by #458 (backported in PR A) into the runtime gettext catalogs. Without this, English users see the raw msgid key in `tabcmd publish --help`. Non-English locales fall back to English until translators supply their versions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Sep 10, 2026
…ost-458 # Conflicts: # tabcmd/locales/de/LC_MESSAGES/tabcmd.mo # tabcmd/locales/es/LC_MESSAGES/tabcmd.mo # tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo # tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo # tabcmd/locales/it/LC_MESSAGES/tabcmd.mo # tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo # tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo # tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo # tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo # tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo
yyk16293
approved these changes
Sep 11, 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.
Second in the #467 backport-split (PR B). Stacked on top of PR A (#467,
jac/fix-publish-embed-creds).What this does
Runs
doit localizeto regeneratetabcmd/locales/*/LC_MESSAGES/tabcmd.mofrom the.propertiesfiles. #458 addedpublish.options.db-servertoen/tabcmd_messages_en.propertiesbut did not refresh the compiled English.mobinary — so users currently see the raw msgid key intabcmd publish --help.Verification
gettext.translation("tabcmd", localedir="tabcmd/locales", languages=["en"]).gettext("publish.options.db-server")returns the English message, not the raw key.Stacked-PR notes
jac/fix-publish-embed-creds(PR A). Rebase todevelopmentafter A merges.publish.errors.db_server_required), which will require another.moregeneration in that PR.🤖 Generated with Claude Code