Skip to content

fix : Update get Deployment logs query to GetDeploymentLogsV2 to match the updated windowed deployment logs query - #216

Open
AryanBansal-launch wants to merge 1 commit into
developmentfrom
cl-4901
Open

fix : Update get Deployment logs query to GetDeploymentLogsV2 to match the updated windowed deployment logs query#216
AryanBansal-launch wants to merge 1 commit into
developmentfrom
cl-4901

Conversation

@AryanBansal-launch

Copy link
Copy Markdown
Contributor

No description provided.

…h the updated windowed deployment logs query
@AryanBansal-launch
AryanBansal-launch requested review from a team as code owners August 5, 2026 20:55
Copilot AI lite review requested due to automatic review settings August 5, 2026 20:55
@snyk-io

snyk-io Bot commented Aug 5, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates deployment log polling to use the new cursor-paged getDeploymentLogsV2 query (matching the updated windowed logs behavior), while retaining a safe fallback to the legacy timestamp-based getLogs query for regions that don’t support V2.

Changes:

  • Switch deployment log polling from getLogs (timestamp paging) to getDeploymentLogsV2 (cursor paging) with cursor tracking and drain behavior on terminal statuses.
  • Add schema-mismatch detection to fall back to the legacy query only when V2 is unsupported (not on transient/network/auth errors).
  • Add GraphQL query definition/export for GetDeploymentLogsV2 and add Jest coverage for the new paging + fallback behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/util/logs-polling-utilities.ts Implements V2 cursor-paged polling, cursor advancement, and legacy fallback on schema mismatch.
src/util/logs-polling-utilities.test.ts Adds tests validating initial V2 variables, cursor advancement, non-looping behavior, drain semantics, and fallback vs transient errors.
src/graphql/queries.ts Introduces and exports the GetDeploymentLogsV2 GraphQL query and documents legacy query role.
Suppressed comments (1)

src/util/logs-polling-utilities.ts:304

  • After handling GraphQL errors with data === null, the callback still continues and may emit logs/DONE again or run the terminal-status stop logic. Return immediately after stopPolling() to avoid double-handling.
      if (errors?.length && data === null) {
        this.loader=cliux.loaderV2('done', this.loader);
        this.$event.emit('deployment-logs', {
          message: errors,
          msgType: 'error',
        });

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +287 to +298
if (error) {
this.loader=cliux.loaderV2('done', this.loader);
this.$event.emit('deployment-logs', {
message: error?.message,
msgType: 'error',
});
this.$event.emit('deployment-logs', {
message: 'DONE',
msgType: 'debug',
});
logsWatchQuery.stopPolling();
}
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.

3 participants