mattcasters opened a new pull request, #8245:
URL: https://github.com/apache/hop/pull/8245

   Fixes #2955
   
   Sergio originally asked for a warning when a transform is assigned a 
database connection that is not in the project metadata, while still being able 
to save. This implements that, and extends it so the same check covers 
**actions as well as transforms**, without patching every plugin's `check()` 
method.
   
   ## What the user sees
   
   When **Validate database connections when saving** is on (the default), 
saving a pipeline or workflow that references a missing RDBMS connection shows 
a warning:
   
   - **Yes** saves anyway
   - **No** cancels the save
   - **Don't run this check when saving** turns the option off (same setting as 
Configuration → Plugins → File validation)
   
   Verify (F7) reports the same findings. Saving is never blocked. Hop does 
**not** open a JDBC connection for this check.
   
   Connection names that still contain a variable after the current environment 
is applied (`'${CONNECTION}'`, `'db_${ENV}'`, …) are skipped, because the name 
cannot be decided at design time.
   
   ## How it works
   
   - `HopMetadataPropertyWalker` collects every 
`@HopMetadataProperty(hopMetadataPropertyType = RDBMS_CONNECTION)` string, 
including nested lists (Check DB connections, Table Compare).
   - `ReferencedDatabaseConnectionChecker` resolves the name, skips unresolved 
variable tokens, and looks it up in metadata (`serializer.exists`).
   - Pipeline and workflow Verify call that checker.
   - Save/Save As go through `ReferencedConnectionSaveValidator` and 
`MessageDialogWithToggle`.
   
   A few plugins stored a `connection` string without `RDBMS_CONNECTION` and 
would have been invisible to the walker. Those annotations are added on Wait 
for SQL, MySQL/MSSQL bulk load, SQL File Output, and Snowflake Warehouse 
Manager.
   
   ## Tests
   
   - `StringUtil.containsVariableToken`
   - `HopMetadataPropertyWalkerTest` (nested lists, two connection fields, 
unannotated fields ignored)
   - `ReferencedDatabaseConnectionCheckerTest` (missing/present names, 
unresolved and resolved variables, empty connection, nested lists, pipeline 
transform, workflow action)
   
   UI compiled with an isolated display. Full `mvn clean install 
apache-rat:check` was not run locally.
   
   ## Docs
   
   Configuration perspective, create pipeline, create workflow, and RDBMS 
connection pages, with screenshots of the option and the save warning.
   
   ------------------------
   
   - [x] Mention the appropriate issue in your description (for example: 
`addresses #123`), if applicable.
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)


-- 
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]

Reply via email to