Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(entity-archival): add package for entity level archival #2137

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

yeshamavani
Copy link
Contributor

gh-1778

Description

Added a new package for entity level archival

  • Provides a repository mixin to export data to external system and delete the data
  • A service function that asynchronously imports the data from external system and provides the json data
  • A default implementation for S3 as external system to archive data.

Fixes #1778

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

@yeshamavani yeshamavani requested a review from a team as a code owner July 26, 2024 10:57
Copy link

sonarqubecloud bot commented Jul 26, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.3% Duplication on New Code

See analysis details on SonarCloud

private options: ArchivalComponentOptions = DEFAULT_ARCHIVAL_OPTIONS,
) {
this.providers = {};
this.application.component(CoreComponent);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we have this dependency ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when we move this to soft-delete this will no longer be required as I needed this to check if the repo is using DefaultCRUD by loopback or DefaultSoftDelete by ARC since the 'delete' methods are different for both


## Overview

`@sourceloop/entity-archival` package is a powerful LoopBack 4 extension designed to seamlessly
Copy link
Contributor

Choose a reason for hiding this comment

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

after reading this, I feel this should be part of soft delete package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will move once the changes are approved as there are comments to be resolved

* return the json data to user
*/

async import(jobId: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Entire flow for retrieval should be in this service file

data.push(...fileContent);
}

const dsName = 'db';
Copy link
Contributor

Choose a reason for hiding this comment

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

refactor this code. ensure connection is closed gracefully

@yeshamavani yeshamavani force-pushed the GH-1778-entity-archival branch from 53f880a to 09db749 Compare December 3, 2024 13:57
@yeshamavani yeshamavani force-pushed the GH-1778-entity-archival branch from 11a5dc8 to 0a50c23 Compare December 10, 2024 09:26
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3 New issues

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

Entity level Archival
2 participants