[rails] migrate compiles of conversions/submissions to history mode (#32053)

* [saas-e2e] test gallery templates with binary file

* [rails] add make target for fixing rubocop errors

* [rails] migrate compiles of conversions/submissions to history mode

* [rails] forward version to clsi request

* [rails] trim down compile request

* [saas-e2e] source v1 secrets after make install

GitOrigin-RevId: 65269e1df1051c9f3b4f1813d2e9dcf32a01be50
This commit is contained in:
Jakob Ackermann
2026-03-17 14:08:09 +01:00
committed by Copybot
parent d5b55b831d
commit 2e389c5a41
4 changed files with 21 additions and 6 deletions

View File

@@ -107,7 +107,7 @@ async function doCompile(request, stats, timings) {
let resourceList, baseHistoryVersion
try {
if (request.historyId) {
if (request.rawChangeOperations) {
;({ resourceList, baseHistoryVersion } =
await HistoryResourceWriter.syncResourcesToDisk(
projectId,
@@ -849,7 +849,7 @@ function _emitMetrics(request, status, stats, timings) {
if (timings.compileE2E != null) {
ClsiMetrics.e2eCompileDurationSeconds.observe(
{
compileFromHistory: !!request.historyId,
compileFromHistory: !!request.rawChangeOperations,
compile: request.metricsOpts.compile,
group: request.compileGroup,
},

View File

@@ -421,7 +421,11 @@ export async function syncResourcesToDisk(
)
}
const blobStore = new BlobStore(request.historyId, globalBlobs)
const blobStore = new BlobStore(
request.historyId,
request.filestoreBlobPrefix,
globalBlobs
)
const loadEagerStart = performance.now()
await snapshot.loadFiles('eager', blobStore)
timings.snapshotLoadEager = Math.ceil(performance.now() - loadEagerStart)
@@ -503,13 +507,17 @@ class BlobStore {
#historyId
/** @type {string[]} */
#globalBlobs
/** @type {string} */
#filestoreBlobPrefix
/**
* @param {string} historyId
* @param {string} filestoreBlobPrefix
* @param {string[]} globalBlobs
*/
constructor(historyId, globalBlobs) {
constructor(historyId, filestoreBlobPrefix, globalBlobs) {
this.#historyId = historyId
this.#filestoreBlobPrefix = filestoreBlobPrefix
this.#globalBlobs = globalBlobs
}
@@ -519,7 +527,9 @@ class BlobStore {
*/
getBlobURL(hash) {
const u = new URL(Settings.apis.filestore.url)
if (this.#globalBlobs.includes(hash)) {
if (this.#filestoreBlobPrefix) {
u.pathname = `${this.#filestoreBlobPrefix}/${hash}`
} else if (this.#globalBlobs.includes(hash)) {
u.pathname = `/history/global/hash/${hash}`
} else {
u.pathname = `/history/project/${this.#historyId}/hash/${hash}`

View File

@@ -162,6 +162,11 @@ function parse(body, callback) {
response.rawSnapshot = compile.rawSnapshot
response.rawChangeOperations = compile.rawChangeOperations
// v1 conversions / submissions
if (compile.filestoreBlobPrefix) {
response.filestoreBlobPrefix = _checkPath(compile.filestoreBlobPrefix)
}
const rootResourcePath = _parseAttribute(
'rootResourcePath',
compile.rootResourcePath,