You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR reduces backend bundle size and memory footprint by replacing the monolithic oci-sdk package with five targeted OCI sub-packages (oci-common, oci-identity, oci-keymanagement, oci-secrets, oci-vault), removing googleapis (no remaining usages confirmed), and relocating ts-node, tsconfig-paths, and ora from dependencies to devDependencies. The OCI and AWS source-file updates are mechanical import rewrites with no logic changes.
Key concerns:
Production migration breakage — auditlog-knexfile.ts still contains import "ts-node/register" on line 3. Because tsup is configured with skipNodeModulesBundle: true, this import is emitted verbatim into the compiled dist/db/auditlog-knexfile.mjs. Moving ts-node to devDependencies means it won't be installed in production, so every auditlog migration command (auditlog-migration:latest, auditlog-migration:up, etc.) will throw ERR_MODULE_NOT_FOUND at startup. The import is entirely unnecessary in already-compiled output and should be removed from the source file.
Unused type fields in OCI vault sync types — TUpdateOCIVaultVariable, TDeleteOCIVaultVariable, and TUnmarkOCIVaultVariableFromDeletion inherit compartmentId and vaultId from TOCIVaultListVariables, but these fields are never used by the corresponding function implementations, resulting in callers passing dead arguments.
Confidence Score: 3/5
Not safe to merge without fixing the ts-node devDependency issue, which will break production audit-log migrations.
The OCI and AWS import rewrites are low-risk mechanical changes, but moving ts-node to devDependencies while auditlog-knexfile.ts still imports ts-node/register is a concrete production breakage path — confirmed by the skipNodeModulesBundle: true tsup config that prevents bundling. Fixing that one line would bring confidence to 5.
backend/src/db/auditlog-knexfile.ts — the import "ts-node/register" line must be removed or ts-node must be kept in dependencies.
Important Files Changed
Filename
Overview
backend/src/db/auditlog-knexfile.ts
Still imports ts-node/register at the top level, which will fail in production now that ts-node has been moved to devDependencies and tsup's skipNodeModulesBundle: true keeps it as an external import.
backend/package.json
Moves ts-node, tsconfig-paths, and ora to devDependencies, replaces monolithic oci-sdk with individual OCI packages, and removes googleapis. Core refactoring for bundle-size reduction — mostly correct, but moving ts-node to devDependencies conflicts with the auditlog knexfile.
OCI vault type definitions updated to use the new granular oci-common package. TUpdateOCIVaultVariable, TDeleteOCIVaultVariable, and TUnmarkOCIVaultVariableFromDeletion all extend TOCIVaultListVariables (which includes compartmentId and vaultId), but those extra fields are unused in the actual function implementations.
Uses RE2 for regex patterns and aws-sdk v2 ACM client correctly; no new issues detected.
Comments Outside Diff (1)
backend/src/ee/services/secret-sync/oci-vault/oci-vault-sync-types.ts, line 37-48 (link)
Unused compartmentId and vaultId fields inherited via type extension
TUpdateOCIVaultVariable, TDeleteOCIVaultVariable, and TUnmarkOCIVaultVariableFromDeletion all extend TOCIVaultListVariables, which includes compartmentId and vaultId. However, the actual function implementations in oci-vault-sync-fns.ts destructure only provider + secretId (+ value for update) and never reference these two inherited fields:
Every call-site passes compartmentId and vaultId even though they are silently discarded. Consider narrowing the types so callers don't have to supply unused arguments:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #5766