diff --git a/agent-service/.dockerignore b/agent-service/.dockerignore deleted file mode 100644 index 44b274308ab..00000000000 --- a/agent-service/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.yarn diff --git a/amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveResource.scala b/amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveResource.scala index 96ffe5d6916..a6ba5ece11b 100644 --- a/amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveResource.scala +++ b/amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveResource.scala @@ -32,8 +32,6 @@ import javax.ws.rs._ import javax.ws.rs.core.MediaType import scala.jdk.CollectionConverters._ import java.util -import javax.ws.rs.DELETE -import javax.ws.rs.PathParam import javax.ws.rs.core.Response object PveResource { diff --git a/bin/licensing/audit_jar_licenses.py b/bin/licensing/audit_jar_licenses.py index ef609f7c89c..aa2772d5427 100755 --- a/bin/licensing/audit_jar_licenses.py +++ b/bin/licensing/audit_jar_licenses.py @@ -150,13 +150,12 @@ def main() -> int: groups = collect_groups([Path(d) for d in args.lib_dirs]) rows = [] - for (lic_h, not_h), members in groups.items(): + for (lic_h, _), members in groups.items(): sample_lic = members[0][1] sample_not = members[0][2] cprights = len(COPYRIGHT_RE.findall(sample_lic)) rows.append({ "lic_hash": lic_h, - "not_hash": not_h, "lic_size": len(sample_lic), "not_size": len(sample_not), "cprights": cprights, diff --git a/bin/licensing/test_generate_notice_binary.py b/bin/licensing/test_generate_notice_binary.py index d8a172b595e..a6c3c3150fa 100644 --- a/bin/licensing/test_generate_notice_binary.py +++ b/bin/licensing/test_generate_notice_binary.py @@ -46,7 +46,6 @@ def make_jar( group: str | None = None, artifact: str | None = None, version: str | None = None, - extra: dict[str, str] | None = None, ) -> Path: """Write a minimal jar (zip) with an optional META-INF/NOTICE and an optional Maven pom.properties.""" @@ -59,8 +58,6 @@ def make_jar( f"META-INF/maven/{group}/{artifact}/pom.properties", f"#Generated by Maven\ngroupId={group}\nartifactId={artifact}\nversion={version}\n", ) - for name, content in (extra or {}).items(): - zf.writestr(name, content) return path diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/SQLSourceOpExec.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/SQLSourceOpExec.scala index 47920ae990c..838fcc37bd6 100644 --- a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/SQLSourceOpExec.scala +++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/SQLSourceOpExec.scala @@ -242,7 +242,7 @@ abstract class SQLSourceOpExec(descString: String) extends SourceOperatorExecuto curLowerBound.longValue <= upperBound.longValue case AttributeType.DOUBLE => curLowerBound.doubleValue <= upperBound.doubleValue - case AttributeType.STRING | AttributeType.ANY | AttributeType.BOOLEAN | _ => + case _ => throw new IllegalArgumentException("Unexpected type: " + attribute.getType) } case None => @@ -298,7 +298,7 @@ abstract class SQLSourceOpExec(descString: String) extends SourceOperatorExecuto case AttributeType.DOUBLE => nextLowerBound = curLowerBound.doubleValue + desc.interval isLastBatch = nextLowerBound.doubleValue >= upperBound.doubleValue - case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _ => + case _ => throw new IllegalArgumentException("Unexpected type: " + attribute.getType) } queryBuilder ++= " AND " + attribute.getName + @@ -332,7 +332,7 @@ abstract class SQLSourceOpExec(descString: String) extends SourceOperatorExecuto String.valueOf(value) case AttributeType.TIMESTAMP => "'" + new Timestamp(value.longValue).toString + "'" - case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _ => + case _ => throw new IllegalArgumentException("Unexpected type: " + attribute.getType) } case None => @@ -368,7 +368,7 @@ abstract class SQLSourceOpExec(descString: String) extends SourceOperatorExecuto resultSet.getTimestamp(1).getTime case AttributeType.DOUBLE => resultSet.getDouble(1) - case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _ => + case _ => throw new IllegalStateException("Unexpected value: " + attribute.getType) } resultSet.close() diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/asterixdb/AsterixDBSourceOpExec.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/asterixdb/AsterixDBSourceOpExec.scala index e6251abdede..a5e2a770375 100644 --- a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/asterixdb/AsterixDBSourceOpExec.scala +++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/asterixdb/AsterixDBSourceOpExec.scala @@ -261,7 +261,7 @@ class AsterixDBSourceOpExec private[asterixdb] ( String.valueOf(value) case AttributeType.TIMESTAMP => "datetime('" + formatter.format(new Timestamp(value.longValue).toInstant) + "')" - case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _ => + case _ => throw new IllegalArgumentException("Unexpected type: " + attribute.getType) } case None => diff --git a/frontend/src/app/common/service/computing-unit/computing-unit-actions/computing-unit-actions.service.ts b/frontend/src/app/common/service/computing-unit/computing-unit-actions/computing-unit-actions.service.ts index 49047b299ae..eaa9da2646e 100644 --- a/frontend/src/app/common/service/computing-unit/computing-unit-actions/computing-unit-actions.service.ts +++ b/frontend/src/app/common/service/computing-unit/computing-unit-actions/computing-unit-actions.service.ts @@ -98,7 +98,7 @@ export class ComputingUnitActionsService { // ng-zorro renders this string as HTML and any user can name their unit, so the name is escaped. const unitName = escapeHtml(unit.computingUnit.name); - const unitType = unit?.computingUnit.type || "kubernetes"; // fallback + const unitType = unit.computingUnit.type || "kubernetes"; // fallback const templates = unitTypeMessageTemplate[unitType]; // Show confirmation modal diff --git a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.ts b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.ts index 2b61641e973..6c0256b927a 100644 --- a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.ts +++ b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.ts @@ -29,7 +29,7 @@ import { getRelativePathFromDatasetFileNode, } from "../../../../../common/type/datasetVersionFileTree"; import { Contributor, DatasetVersion } from "../../../../../common/type/dataset"; -import { switchMap, throttleTime } from "rxjs/operators"; +import { switchMap, tap, throttleTime } from "rxjs/operators"; import { NotificationService } from "../../../../../common/service/notification/notification.service"; import { DownloadService } from "../../../../service/user/download/download.service"; import { formatSize } from "src/app/common/util/size-formatter.util"; @@ -62,7 +62,7 @@ import { DATASET_FILE_RESOURCE_ENDPOINT } from "../../../../service/user/file-re import { VersionsFilesBrowserComponent } from "../../versions-files-browser/versions-files-browser.component"; import { ResourceDetailSettingsComponent } from "../../resource-detail-settings.component"; -export const THROTTLE_TIME_MS = 1000; +const THROTTLE_TIME_MS = 1000; @UntilDestroy() @Component({ @@ -167,12 +167,11 @@ export class DatasetDetailComponent implements OnInit { ngOnInit(): void { this.route.params .pipe( - switchMap(params => { + tap(params => { this.did = params["did"]; this.retrieveDatasetInfo(); this.retrieveDatasetVersionList(); this.retrieveLatestVersionFile(); - return this.route.data; // or some other observable }), untilDestroyed(this) ) diff --git a/frontend/src/app/dashboard/component/user/user-model/user-model-explorer/model-detail.component.ts b/frontend/src/app/dashboard/component/user/user-model/user-model-explorer/model-detail.component.ts index 510e6b76825..57776bfb22b 100644 --- a/frontend/src/app/dashboard/component/user/user-model/user-model-explorer/model-detail.component.ts +++ b/frontend/src/app/dashboard/component/user/user-model/user-model-explorer/model-detail.component.ts @@ -20,7 +20,7 @@ import { Component, OnInit, ViewChild } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy"; -import { catchError, map, switchMap } from "rxjs/operators"; +import { catchError, map, switchMap, tap } from "rxjs/operators"; import { Observable, of } from "rxjs"; import { format } from "date-fns"; import { NgIf, NgClass, NgFor } from "@angular/common"; @@ -173,19 +173,18 @@ export class ModelDetailComponent implements OnInit { ngOnInit(): void { this.route.params .pipe( - switchMap(params => { + tap(params => { // Route params are strings, and the segment is whatever the URL carried: reject // anything that is not a positive integer once, here, rather than at each use. const mid = Number(params["mid"]); this.mid = Number.isInteger(mid) && mid > 0 ? mid : undefined; if (this.mid === undefined) { this.notificationService.error("This is not a valid model id"); - return this.route.data; + return; } this.retrieveModelInfo(); this.retrieveModelVersionList(); this.loadHubActivity(); - return this.route.data; }), untilDestroyed(this) ) diff --git a/frontend/src/app/dashboard/component/user/version-uploader/version-uploader.component.spec.ts b/frontend/src/app/dashboard/component/user/version-uploader/version-uploader.component.spec.ts index 87b25c85dee..180301b9814 100644 --- a/frontend/src/app/dashboard/component/user/version-uploader/version-uploader.component.spec.ts +++ b/frontend/src/app/dashboard/component/user/version-uploader/version-uploader.component.spec.ts @@ -23,11 +23,7 @@ import { By } from "@angular/platform-browser"; import { NzModalService } from "ng-zorro-antd/modal"; import { NzTooltipDirective } from "ng-zorro-antd/tooltip"; import { concat, Observable, of, Subject, throwError } from "rxjs"; -import { - ABORT_RETRY_BACKOFF_BASE_MS, - ABORT_RETRY_MAX_ATTEMPTS, - VersionUploaderComponent, -} from "./version-uploader.component"; +import { VersionUploaderComponent } from "./version-uploader.component"; import { MultipartUploadProgress, MultipartUploadService, @@ -257,6 +253,10 @@ describe("VersionUploaderComponent", () => { * and the caller's callback must fire exactly once down every one of those paths. */ describe("aborting an upload", () => { + // The component's abort policy: up to ten retries after a 409, each waiting 100 ms times its number. + const ABORT_RETRY_BACKOFF_BASE_MS = 100; + const ABORT_RETRY_MAX_ATTEMPTS = 10; + beforeEach(() => { vi.useFakeTimers(); }); diff --git a/frontend/src/app/dashboard/component/user/version-uploader/version-uploader.component.ts b/frontend/src/app/dashboard/component/user/version-uploader/version-uploader.component.ts index d6b4e2482ef..d7576025759 100644 --- a/frontend/src/app/dashboard/component/user/version-uploader/version-uploader.component.ts +++ b/frontend/src/app/dashboard/component/user/version-uploader/version-uploader.component.ts @@ -51,9 +51,9 @@ import { FileUploadItem } from "../../../type/dashboard-file.interface"; import { FilesUploaderComponent } from "../files-uploader/files-uploader.component"; import { StagedObjectsListComponent } from "../staged-objects-list/staged-objects-list.component"; -export const ABORT_RETRY_MAX_ATTEMPTS = 10; -export const ABORT_RETRY_BACKOFF_BASE_MS = 100; -export const FINISHED_TASK_HIDE_DELAY_MS = 5000; +const ABORT_RETRY_MAX_ATTEMPTS = 10; +const ABORT_RETRY_BACKOFF_BASE_MS = 100; +const FINISHED_TASK_HIDE_DELAY_MS = 5000; /** * The "Create New Version" panel of a versioned resource's detail page: pick files, watch them @@ -380,16 +380,12 @@ export class VersionUploaderComponent implements OnInit { }, error: (res: unknown) => { const err = res as HttpErrorResponse; - // Already gone, treat as done. - if (err.status === HttpStatusCode.NotFound) { - done(); - return; - } // Backend is still finalizing/aborting; retry with a tiny backoff. if (err.status === HttpStatusCode.Conflict && attempt < ABORT_RETRY_MAX_ATTEMPTS) { setTimeout(() => abortWithRetry(attempt + 1), ABORT_RETRY_BACKOFF_BASE_MS * (attempt + 1)); return; } + // Any other error ends the abort, including a 404 for an upload that is already gone. done(); }, }); diff --git a/frontend/src/app/workspace/component/agent/agent-interaction/agent-interaction.component.ts b/frontend/src/app/workspace/component/agent/agent-interaction/agent-interaction.component.ts index 957edd0b38c..b7548222b8a 100644 --- a/frontend/src/app/workspace/component/agent/agent-interaction/agent-interaction.component.ts +++ b/frontend/src/app/workspace/component/agent/agent-interaction/agent-interaction.component.ts @@ -20,7 +20,7 @@ import { ChangeDetectorRef, Component, Input, OnChanges, OnInit, SimpleChanges } from "@angular/core"; import { DomSanitizer, SafeHtml } from "@angular/platform-browser"; import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy"; -import { AgentService } from "../../../service/agent/agent.service"; +import { AgentService, IndexedTuple, Tuple, tupleColumns, tupleToRecord } from "../../../service/agent/agent.service"; import { AgentState } from "../../../service/agent/agent-types"; import { WorkflowActionService } from "../../../service/workflow-graph/model/workflow-action.service"; import { NotificationService } from "../../../../common/service/notification/notification.service"; @@ -41,7 +41,6 @@ import { NzTooltipDirective } from "ng-zorro-antd/tooltip"; import { NzInputDirective, NzAutosizeDirective } from "ng-zorro-antd/input"; import { NzButtonComponent } from "ng-zorro-antd/button"; import { NzWaveDirective } from "ng-zorro-antd/core/wave"; -import { IndexedTuple, Tuple, tupleColumns, tupleToRecord } from "../../../service/agent/agent.service"; import type { WebOutputMode } from "../../../types/execute-workflow.interface"; interface TupleDisplayEntry { diff --git a/frontend/src/app/workspace/util/loop-block.util.spec.ts b/frontend/src/app/workspace/util/loop-block.util.spec.ts index f5fed29267b..43dc9474b80 100644 --- a/frontend/src/app/workspace/util/loop-block.util.spec.ts +++ b/frontend/src/app/workspace/util/loop-block.util.spec.ts @@ -19,7 +19,7 @@ // The backend's LogicalPlanSpec checks LogicalPlan.enclosingLoopStarts against the same file. import loopBlocks from "../../../../../common/workflow-compiler/src/test/resources/loop-blocks.json"; -import { enclosingLoopStarts, LOOP_END_OP_TYPE, LOOP_START_OP_TYPE } from "./loop-block.util"; +import { enclosingLoopStarts, LOOP_START_OP_TYPE } from "./loop-block.util"; /** A case of loop-blocks.json: a graph, and the Loop Starts around each operator inside a block. */ interface LoopBlockCase { @@ -87,7 +87,7 @@ describe("enclosingLoopStarts", () => { const types = new Set( [...loopBlocks.cases, ...loopBlocks.randomGraphs].flatMap(testCase => testCase.operators.map(({ type }) => type)) ); - expect([...types].sort()).toEqual([LOOP_END_OP_TYPE, LOOP_START_OP_TYPE, "Operator"].sort()); + expect([...types].sort()).toEqual(["LoopEnd", LOOP_START_OP_TYPE, "Operator"].sort()); }); it("finds nothing in an empty graph", () => { diff --git a/frontend/src/app/workspace/util/loop-block.util.ts b/frontend/src/app/workspace/util/loop-block.util.ts index 8d96b836465..cb1716c312f 100644 --- a/frontend/src/app/workspace/util/loop-block.util.ts +++ b/frontend/src/app/workspace/util/loop-block.util.ts @@ -21,7 +21,7 @@ import { OperatorLink, OperatorPredicate } from "../types/workflow-common.interf /** The operator types that open and close a loop block, as the backend names them. */ export const LOOP_START_OP_TYPE = "LoopStart"; -export const LOOP_END_OP_TYPE = "LoopEnd"; +const LOOP_END_OP_TYPE = "LoopEnd"; type BlockOperator = Pick; type BlockLink = {