karthik-0306 commented on PR #12858:
URL: https://github.com/apache/seatunnel/pull/12858#issuecomment-6519727679
Thanks @SEZ9. Here is the full mapping as a list, in case the table was cut
off on your side.
On the docstring/error wording: both already say Linux/macOS only. The error
also points to `select_plugins()` as the cross-platform alternative, and the
docstring (L233-235) adds why `bin/install-plugin.cmd` can't be used. I'm happy
to repeat the `select_plugins()` clause in the docstring if you'd like it
there. I held off on pushing so the head you and @DanielLeens verified stays
unchanged.
- F1 (relative seatunnel_home): resolved once up front with
`os.path.abspath(os.path.expanduser(...))`, so the script path and `cwd` can't
be resolved twice. Code: install_plugins L286. Tests:
test_relative_home_is_resolved_to_an_absolute_script_path (L460),
test_invalid_seatunnel_home_raises_plugin_install_error (L348).
- F2 (stray whitespace / trailing comments): mirrors the script's
first-character rule and tolerates stray whitespace. A line the script would
reject raises with its line number before any write. Code: select_plugins
L91-153. Tests: test_connector_lines_with_stray_whitespace_are_recognized
(L192), test_disabled_connector_with_trailing_whitespace_can_be_enabled (L206),
test_line_rejected_by_install_script_raises_and_leaves_file_unchanged (L213).
- F3 (inter-process lock): `_exclusive_lock` holds an exclusive flock across
snapshot, select, run and restore. Code: _exclusive_lock L206, used at L300.
Test: test_lock_is_held_while_the_script_runs (L501).
- F4 (Windows): rejected before bash is looked up or any file is touched;
the rationale is in the docstring (L233-235). Code: install_plugins L262. Test:
test_windows_is_rejected_before_rewriting (L475).
- F5 (version validation): validated against the script's character set
before the rewrite. Code: install_plugins L273. Test:
test_invalid_version_raises_before_rewriting (L449).
- F6 (UnicodeDecodeError / TypeError leaks): wrapped into
PluginInstallError. Code: select_plugins L120, _normalize_connectors L60.
Tests: test_non_utf8_file_raises_plugin_install_error (L225),
test_invalid_connectors_argument_raises_plugin_install_error (L234).
- F7 (unconditional rollback write): `_restore_if_changed` writes only if
the bytes differ. Code: L191-199, called at L327. Test:
test_failed_install_does_not_rewrite_an_unchanged_file (L486).
- F8 ('3.0.1' in the error hint): the hint now says only that the version
should match the SeaTunnel engine version. Code: install_plugins L268-277.
Test: test_empty_version_raises (L437).
All checks are green on 1c42f78cb (Build, Python 3.9, Python 3.13).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]