Skip to content

Commit

Permalink
feat: report ALREADY_CONVERTED exit code in events
Browse files Browse the repository at this point in the history
  • Loading branch information
aleortega committed Dec 16, 2024
1 parent b1bc350 commit 7b8c902
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public enum ErrorCodes
DOWNLOAD_FAILED,
INVALID_PLATFORM,
GLTF_PROCESS_MISMATCH,
CONVERSION_ERRORS_TOLERATED
CONVERSION_ERRORS_TOLERATED,
ALREADY_CONVERTED
}
}
2 changes: 1 addition & 1 deletion consumer-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@aws-sdk/client-sns": "^3.699.0",
"@dcl/cdn-uploader": "^1.4.1-20230208155013.commit-f75a6ee",
"@dcl/schemas": "https://sdk-team-cdn.decentraland.org/@dcl/schemas/branch/feat/ABConvertedEvent-new-properties/dcl-schemas-15.3.2-12284753098.commit-bbe7c6a.tgz",
"@dcl/schemas": "15.3.3",
"@sentry/node": "^8.27.0",
"@well-known-components/env-config-provider": "^1.2.0",
"@well-known-components/http-server": "^2.1.0",
Expand Down
8 changes: 4 additions & 4 deletions consumer-server/src/logic/conversion-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export async function executeLODConversion(

if (!unityBuildTarget) {
logger.error('Could not find a build target', { ...defaultLoggerMetadata } as any)
return -1
return 5 // UNEXPECTED_ERROR exit code
}

try {
Expand All @@ -128,7 +128,7 @@ export async function executeLODConversion(
// this is an error, if succeeded, we should see at least a manifest file
components.metrics.increment('ab_converter_empty_conversion', { ab_version: $AB_VERSION })
logger.error('Empty conversion', { ...defaultLoggerMetadata } as any)
return -1
return 5 // UNEXPECTED_ERROR exit code
}

await uploadDir(components.cdnS3, cdnBucket, outDirectory, 'LOD', {
Expand Down Expand Up @@ -216,13 +216,13 @@ export async function executeConversion(
const unityBuildTarget = getUnityBuildTarget($BUILD_TARGET)
if (!unityBuildTarget) {
logger.info('Invalid build target ' + $BUILD_TARGET)
return -1
return 5 // UNEXPECTED_ERROR exit code
}

if (!force) {
if (await shouldIgnoreConversion(components, entityId, $AB_VERSION, $BUILD_TARGET)) {
logger.info('Ignoring conversion', { entityId, contentServerUrl, $AB_VERSION })
return -1
return 13 // ALREADY_CONVERTED exit code
}
} else {
logger.info('Forcing conversion', { entityId, contentServerUrl, $AB_VERSION })
Expand Down
2 changes: 1 addition & 1 deletion consumer-server/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function main(program: Lifecycle.EntryPointParameters<AppComponents
const platform = (await components.config.requireString('PLATFORM')).toLocaleLowerCase() as
| 'windows'
| 'mac'
| 'webglb'
| 'webgl'
while (opt.isRunning) {
if (await machineRanOutOfSpace(components)) {
logger.warn('Stopping program due to lack of disk space')
Expand Down
17 changes: 4 additions & 13 deletions consumer-server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -751,19 +751,10 @@
eslint-plugin-prettier "^5.1.3"
prettier "^3.3.2"

"@dcl/schemas@^15.2.0":
version "15.2.0"
resolved "https://registry.yarnpkg.com/@dcl/schemas/-/schemas-15.2.0.tgz#9463426cc939a45e4e8dd94dc9f99b95dfc27976"
integrity sha512-sF7PWZ6Cexf9qXssY7Kt4L5qI1l/87ei4jSEMcGE4AKyI6tCgtAMr2OwHslnKp5D4zT1UliDAt239gk/+/fk7A==
dependencies:
ajv "^8.11.0"
ajv-errors "^3.0.0"
ajv-keywords "^5.1.0"
mitt "^3.0.1"

"@dcl/schemas@https://sdk-team-cdn.decentraland.org/@dcl/schemas/branch/feat/ABConvertedEvent-new-properties/dcl-schemas-15.3.2-12284753098.commit-bbe7c6a.tgz":
version "15.3.2-12284753098.commit-bbe7c6a"
resolved "https://sdk-team-cdn.decentraland.org/@dcl/schemas/branch/feat/ABConvertedEvent-new-properties/dcl-schemas-15.3.2-12284753098.commit-bbe7c6a.tgz#0eb5fd575ca41ca24152a86ccdcd5401e9534efe"
"@dcl/[email protected]":
version "15.3.3"
resolved "https://registry.yarnpkg.com/@dcl/schemas/-/schemas-15.3.3.tgz#29b35d4eb1af0085cb09e79ecdc39a0c074f59a9"
integrity sha512-AID1yUW7gvaE5abZrW8ATK6CA941KoHn4eFWauVCQINqTSfTgp1kBlCO3fYs+26di1tcJHI8XWvR2fuf3Q084w==
dependencies:
ajv "^8.11.0"
ajv-errors "^3.0.0"
Expand Down

0 comments on commit 7b8c902

Please sign in to comment.