mattcasters commented on code in PR #8661:
URL: https://github.com/apache/hop/pull/8661#discussion_r4153816888


##########
plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpencryptfiles/ActionPGPEncryptFiles.java:
##########
@@ -1260,15 +1276,28 @@ private String getMoveDestinationFilename(String 
shortSourceFileName, String dat
   }
 
   public void doJob(
-      ActionType actionType, FileObject sourceFile, String userID, FileObject 
destinationFile)
+      ActionType actionType,
+      FileObject sourceFile,
+      String userID,
+      String localUser,
+      FileObject destinationFile)
       throws HopException {
 
     switch (actionType) {
       case SIGN:
-        gpg.signFile(sourceFile, userID, destinationFile, isAsciiMode());
+        // Signing has no recipient, so the user ID is not used here. It never 
was: it went to gpg
+        // as -r, which GnuPG ignores for anything but encryption. Saying so 
out loud beats both
+        // the old silence and quietly promoting it to the signing key, which 
would change what an
+        // existing workflow signs with.
+        if (Utils.isEmpty(localUser) && !Utils.isEmpty(userID)) {
+          logBasic(

Review Comment:
   **[nit]** This warning is logged from `doJob` at Basic, so a Sign of a 
folder that still has a User ID and no signing key prints the same row-level 
message once per file.
   
   **Suggestion:** Log it once per row in `processFileFolder`, or drop repeats 
to Detailed.



##########
plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpencryptfiles/ActionPGPEncryptFiles.java:
##########
@@ -389,6 +390,11 @@ public Result execute(Result result, int nr) {
       previousPgpFile.setWildcard(resolve(resultRow.getString(2, null)));
       previousPgpFile.setUserId(resultRow.getString(3, null));
       previousPgpFile.setDestinationFileFolder(resultRow.getString(4, null));
+      // The signing key is appended after the columns this action has always 
read, so a pipeline
+      // that still feeds five fields keeps working.
+      if (resultRow.size() > 5) {
+        previousPgpFile.setLocalUser(resultRow.getString(5, null));

Review Comment:
   **[suggestion]** "Copy previous results" still reads the historical 
positions: destination at index 4, and the signing key only when a sixth field 
is present. The grid inserts Signing key *before* File/Folder destination, and 
`ActionPGPEncryptFiles.Previous.Tooltip` still lists five fields and says they 
must be in that order. It was not updated with the manual. A row lined up with 
the visible columns stores the signing key as the destination path and passes 
the destination path to `gpg -u`.
   
   **Suggestion:** Extend `ActionPGPEncryptFiles.Previous.Tooltip` with the 
optional sixth field and say plainly that it is appended after the destination, 
not placed where the new grid column is.



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