Skip to content

Commit 88374ab

Browse files
authored
[server] fix prebuild organizationId (#17289)
1 parent 3a284fa commit 88374ab

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

components/server/ee/src/prebuilds/prebuild-manager.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class PrebuildManager {
174174
}
175175
}
176176
}
177-
if (project && context.ref && !project.settings?.keepOutdatedPrebuildsRunning) {
177+
if (context.ref && !project.settings?.keepOutdatedPrebuildsRunning) {
178178
try {
179179
await this.abortPrebuildsForBranch({ span }, project, user, context.ref);
180180
} catch (e) {
@@ -222,17 +222,10 @@ export class PrebuildManager {
222222
}
223223
}
224224

225-
let organizationId = (await this.teamDB.findTeamById(project.id))?.id;
226-
if (!user.additionalData?.isMigratedToTeamOnlyAttribution) {
227-
// If the user is not migrated to team-only attribution, we retrieve the organization from the attribution logic.
228-
const attributionId = await this.userService.getWorkspaceUsageAttributionId(user, project.id);
229-
organizationId = attributionId.kind === "team" ? attributionId.teamId : undefined;
230-
}
231-
232225
const workspace = await this.workspaceFactory.createForContext(
233226
{ span },
234227
user,
235-
organizationId,
228+
project.teamId,
236229
project,
237230
prebuildContext,
238231
context.normalizedContextURL!,

0 commit comments

Comments
 (0)