Skip to content

Conversation

@mckellyln
Copy link
Contributor

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

Copilot AI review requested due to automatic review settings January 6, 2026 15:17
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-35470

Jirabot Action Result:
Assigning user: [email protected]
Workflow Transition To: Merge Pending
Updated PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new --delete-prev option to the ecl queries copy-set command, allowing users to delete the previously active query when activating a new one, as an alternative to the existing suspend behavior.

Key Changes:

  • Added WUQueryActivationMode enum value ActivateDeletePrevious to support deleting previous queries
  • Extended ESDL API to version 2.04 with new Activate enum field for fine-grained activation control
  • Implemented backward compatibility by preserving existing CloneActiveState behavior when new field is not set
  • Added CLI options -dp/--delete-prev and -sp/--suspend-prev for explicit activation mode control

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
esp/scm/ws_workunits.ecm Incremented service version to 2.04 and default_client_version to match
esp/scm/ws_workunits_queryset_req_resp.ecm Added new Activate field with version 2.04 to WUCopyQuerySetRequest
esp/services/ws_workunits/ws_workunitsQuerySets.cpp Implemented activation mode handling with backward compatibility logic, added setActivationMode method to QueryCloner class
ecl/eclcmd/queries/ecl-queries.cpp Added CLI option parsing, validation, and help text for new suspend-prev and delete-prev flags

Comment on lines 781 to 786
fputs("Error: --suspend-prev and --delete-prev require --clone-active-state.\n", stderr);
return false;
}
if (optSuspendPrevious && optDeletePrevious)
{
fputs("Error: --suspend-prev and --delete-prev are mutually exclusive options.\n", stderr);
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message starts with "Error:" prefix which is inconsistent with the error message on line 787. Consider removing "Error:" prefix from both messages for consistency with other error messages in this file, or add it to both.

Suggested change
fputs("Error: --suspend-prev and --delete-prev require --clone-active-state.\n", stderr);
return false;
}
if (optSuspendPrevious && optDeletePrevious)
{
fputs("Error: --suspend-prev and --delete-prev are mutually exclusive options.\n", stderr);
fputs("--suspend-prev and --delete-prev require --clone-active-state.\n", stderr);
return false;
}
if (optSuspendPrevious && optDeletePrevious)
{
fputs("--suspend-prev and --delete-prev are mutually exclusive options.\n", stderr);

Copilot uses AI. Check for mistakes.
Comment on lines 781 to 786
fputs("Error: --suspend-prev and --delete-prev require --clone-active-state.\n", stderr);
return false;
}
if (optSuspendPrevious && optDeletePrevious)
{
fputs("Error: --suspend-prev and --delete-prev are mutually exclusive options.\n", stderr);
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message starts with "Error:" prefix which is inconsistent with the error message on line 781. Consider removing "Error:" prefix from both messages for consistency with other error messages in this file, or add it to both.

Suggested change
fputs("Error: --suspend-prev and --delete-prev require --clone-active-state.\n", stderr);
return false;
}
if (optSuspendPrevious && optDeletePrevious)
{
fputs("Error: --suspend-prev and --delete-prev are mutually exclusive options.\n", stderr);
fputs("--suspend-prev and --delete-prev require --clone-active-state.\n", stderr);
return false;
}
if (optSuspendPrevious && optDeletePrevious)
{
fputs("--suspend-prev and --delete-prev are mutually exclusive options.\n", stderr);

Copilot uses AI. Check for mistakes.
continue;
if (iter.matchFlag(optCloneActiveState, ECLOPT_CLONE_ACTIVE_STATE))
continue;
if (iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS)||iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS_S))
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after the || operator. The condition should be formatted as "iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS) || iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS_S)" for consistency with other similar checks in this file.

Suggested change
if (iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS)||iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS_S))
if (iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS) || iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS_S))

Copilot uses AI. Check for mistakes.
continue;
if (iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS)||iter.matchFlag(optSuspendPrevious, ECLOPT_SUSPEND_PREVIOUS_S))
continue;
if (iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS)||iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS_S))
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after the || operator. The condition should be formatted as "iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS) || iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS_S)" for consistency with other similar checks in this file.

Suggested change
if (iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS)||iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS_S))
if (iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS) || iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS_S))

Copilot uses AI. Check for mistakes.
Comment on lines 887 to 888
" -sp, --suspend-prev Suspend previously active query\n"
" -dp, --delete-prev Delete previously active query\n"
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text shows both "-sp" and "-dp" options but should clarify that these options work in conjunction with --clone-active-state. Consider adding a note in the help text or updating the option descriptions to indicate these require --clone-active-state.

Suggested change
" -sp, --suspend-prev Suspend previously active query\n"
" -dp, --delete-prev Delete previously active query\n"
" -sp, --suspend-prev Suspend previously active query (requires --clone-active-state)\n"
" -dp, --delete-prev Delete previously active query (requires --clone-active-state)\n"

Copilot uses AI. Check for mistakes.
Comment on lines 914 to 915
bool optSuspendPrevious = false;
bool optDeletePrevious = false;
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new boolean member variables optSuspendPrevious and optDeletePrevious should be initialized in the constructor's initialization list (line 707-709) for consistency with the other boolean members like optCloneActiveState, optOverwrite, etc., rather than using in-class initialization.

Suggested change
bool optSuspendPrevious = false;
bool optDeletePrevious = false;
bool optSuspendPrevious;
bool optDeletePrevious;

Copilot uses AI. Check for mistakes.
@mckellyln mckellyln force-pushed the copy_set_del_prev branch 2 times, most recently from 3d0e517 to e562639 Compare January 7, 2026 21:30
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