Skip to content

Commit 5b20bcf

Browse files
remove un-needed changes
1 parent 69c60b5 commit 5b20bcf

File tree

5 files changed

+7
-43
lines changed

5 files changed

+7
-43
lines changed

common/changes/@rushstack/operation-graph/eb-concurrency-bug-fix_2025-09-16-19-06.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

common/reviews/api/operation-graph.api.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/// <reference types="node" />
88

99
import type { ITerminal } from '@rushstack/terminal';
10-
import { IWeighted } from '@rushstack/node-core-library';
1110

1211
// @beta
1312
export type CommandMessageFromHost = ICancelCommandMessage | IExitCommandMessage | IRunCommandMessage | ISyncCommandMessage;
@@ -66,7 +65,6 @@ export interface IOperationExecutionOptions<TOperationMetadata extends {} = {},
6665

6766
// @beta
6867
export interface IOperationOptions<TMetadata extends {} = {}, TGroupMetadata extends {} = {}> {
69-
allowOversubscription?: boolean | undefined;
7068
group?: OperationGroupRecord<TGroupMetadata> | undefined;
7169
metadata?: TMetadata | undefined;
7270
name: string;
@@ -150,11 +148,10 @@ export interface IWatchLoopState {
150148
}
151149

152150
// @beta
153-
export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}> implements IOperationStates, IWeighted {
151+
export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}> implements IOperationStates {
154152
constructor(options: IOperationOptions<TMetadata, TGroupMetadata>);
155153
// (undocumented)
156154
addDependency(dependency: Operation<TMetadata, TGroupMetadata>): void;
157-
allowOversubscription: boolean;
158155
readonly consumers: Set<Operation<TMetadata, TGroupMetadata>>;
159156
criticalPathLength: number | undefined;
160157
// (undocumented)

libraries/node-core-library/src/Async.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,10 @@ export interface IWeighted {
9191
weight: number;
9292
}
9393

94-
interface IWeightedWrapper<TElement> {
95-
element: TElement;
96-
weight: number;
97-
}
98-
9994
function toWeightedIterator<TEntry>(
10095
iterable: Iterable<TEntry> | AsyncIterable<TEntry>,
10196
useWeights?: boolean
102-
): AsyncIterable<IWeightedWrapper<TEntry>> {
97+
): AsyncIterable<{ element: TEntry; weight: number }> {
10398
const iterator: Iterator<TEntry> | AsyncIterator<TEntry, TEntry> = (
10499
(iterable as Iterable<TEntry>)[Symbol.iterator] ||
105100
(iterable as AsyncIterable<TEntry>)[Symbol.asyncIterator]
@@ -111,10 +106,7 @@ function toWeightedIterator<TEntry>(
111106
// The await is necessary here, but TS will complain - it's a false positive.
112107
const { value, done } = await iterator.next();
113108
return {
114-
value: {
115-
element: value,
116-
weight: useWeights ? value?.weight : 1
117-
},
109+
value: { element: value, weight: useWeights ? value?.weight : 1 },
118110
done: !!done
119111
};
120112
}
@@ -199,7 +191,7 @@ export class Async {
199191
return result;
200192
}
201193

202-
private static async _forEachWeightedAsync<TReturn, TEntry extends IWeightedWrapper<TReturn>>(
194+
private static async _forEachWeightedAsync<TReturn, TEntry extends { weight: number; element: TReturn }>(
203195
iterable: AsyncIterable<TEntry>,
204196
callback: (entry: TReturn, arrayIndex: number) => Promise<void>,
205197
options?: IAsyncParallelismOptions | undefined

libraries/operation-graph/src/Operation.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
import { InternalError, type IWeighted } from '@rushstack/node-core-library';
4+
import { InternalError } from '@rushstack/node-core-library';
55
import type { ITerminal } from '@rushstack/terminal';
66

77
import { Stopwatch } from './Stopwatch';
@@ -41,13 +41,6 @@ export interface IOperationOptions<TMetadata extends {} = {}, TGroupMetadata ext
4141
*/
4242
weight?: number | undefined;
4343

44-
/**
45-
* Controls whether this operation can start, even if doing so would exceed the total concurrency limit..
46-
* If true (default), will start the operation even when it would exceed the limit.
47-
* If false, waits until sufficient capacity is available.
48-
*/
49-
allowOversubscription?: boolean | undefined;
50-
5144
/**
5245
* The metadata for this operation.
5346
*/
@@ -108,7 +101,7 @@ export interface IExecuteOperationContext extends Omit<IOperationRunnerContext,
108101
* @beta
109102
*/
110103
export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}>
111-
implements IOperationStates, IWeighted
104+
implements IOperationStates
112105
{
113106
/**
114107
* A set of all dependencies which must be executed before this operation is complete.
@@ -181,13 +174,6 @@ export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}
181174
*/
182175
public weight: number;
183176

184-
/**
185-
* If true, allows this operation to exceed the concurrency limit when no other operations are running.
186-
* If false, enforces strict concurrency limits and waits until sufficient capacity is available.
187-
* Defaults to true to maintain backward compatibility with the original behavior.
188-
*/
189-
public allowOversubscription: boolean;
190-
191177
/**
192178
* The state of this operation the previous time a manager was invoked.
193179
*/
@@ -215,7 +201,6 @@ export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}
215201
this.group = options.group;
216202
this.runner = options.runner;
217203
this.weight = options.weight ?? 1;
218-
this.allowOversubscription = options?.allowOversubscription ?? true;
219204
this.name = options.name;
220205
this.metadata = options.metadata || ({} as TMetadata);
221206

libraries/rush-lib/src/logic/operations/WeightedOperationPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { Async } from '@rushstack/node-core-library';
1515
const PLUGIN_NAME: 'WeightedOperationPlugin' = 'WeightedOperationPlugin';
1616

1717
/**
18-
* Add weights and concurrency behavior to operations based on the operation settings in rush-project.json.
18+
* Add weights to operations based on the operation settings in rush-project.json.
1919
*
2020
* This also sets the weight of no-op operations to 0.
2121
*/

0 commit comments

Comments
 (0)