Skip to content

Conversation

@aman19K
Copy link
Contributor

@aman19K aman19K commented Jun 5, 2025

Integrates v2Logger, messageHandler, and handleAndLogError from @contentstack/cli-utilities to replace the old logging and error handling mechanisms in the export plugin.
Key changes include replacing log calls with v2Logger calls across modules, setting the exportConfig.context.module appropriately in each module, and streamlining error reporting using a unified error handler.

NOTE:- Will do version bump before releasing this feature to avoid unnecessary version conflict.

@aman19K aman19K requested a review from Copilot June 6, 2025 04:24
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 pull request integrates the usage of v2Logger, messageHandler, and handleAndLogError from @contentstack/cli-utilities to replace the old logging and error handling mechanisms in the export plugin. Key changes include replacing log calls with v2Logger calls across modules, setting the exportConfig.context.module appropriately in each module, and streamlining error reporting using a unified error handler.

Reviewed Changes

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

File Description
workflows.ts, webhooks.ts, taxonomies.ts, etc. Replaced legacy log calls with v2Logger and updated error handling with handleAndLogError.
base-class.ts, module-exporter.ts Updated logging functions to include contextual information (module and execution times).
assets.ts Updated asset export logging, including both metadata and download statuses using messageHandler.
messages/index.json Added new message definitions to support the updated logging messages.
Comments suppressed due to low confidence (1)

packages/contentstack-export/src/export/modules/assets.ts:314

  • There is an inconsistency in the asset filename property (using both 'fileName' and 'filename'). Standardize the property naming throughout the module for clarity and consistency.
handleAndLogError(error, { ...this.exportConfig.context, uid: asset.uid, filename: asset.fileName }, messageHandler.parse('ASSET_DOWNLOAD_FAILED', asset.filename, asset.uid),

@aman19K aman19K marked this pull request as ready for review June 6, 2025 05:46
@aman19K aman19K requested a review from a team as a code owner June 6, 2025 05:46
@aman19K aman19K merged commit ad7489b into feat/DX-2951-v2Logger-integration Jun 9, 2025
8 checks passed
@aman19K aman19K deleted the feat/DX-3077-v2Logger-integration-export branch June 9, 2025 15:37
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