* fixing profiler so that it will load correctly in the tracing UI

* initialize hash

* Change files
This commit is contained in:
Kenneth Chau 2023-01-26 16:20:12 -08:00 коммит произвёл GitHub
Родитель 3ebdc50793
Коммит b0f0b5a777
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 22 добавлений и 5 удалений

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fixing profiler so that it will load correctly in the tracing UI",
"packageName": "@lage-run/reporters",
"email": "kchau@microsoft.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fixing profiler so that it will load correctly in the tracing UI",
"packageName": "@lage-run/scheduler",
"email": "kchau@microsoft.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -71,6 +71,6 @@ module.exports = {
},
npmClient: "yarn",
cacheOptions: {
environmentGlob: ["*.js", "*.json", ".github/**", "packages/tsconfig.lage2.json", "patches"],
environmentGlob: ["beachball.config.js", "lage.config.js", "package.json", "renovate.json5", ".github/**", "packages/tsconfig.lage2.json", "patches"],
},
};

Просмотреть файл

@ -126,7 +126,7 @@ export class AdoReporter implements Reporter {
? normalize(entry.msg)
: normalize(getTaskLogPrefix(packageName ?? "<root>", task), entry.msg);
return this.logStream.write(format(entry.level, normalizedArgs.prefix, colorFn("| " + normalizedArgs.message)));
} else {
} else if (entry?.msg.trim() !== "") {
return this.logStream.write(format(entry.level, "", entry.msg));
}
}

Просмотреть файл

@ -295,7 +295,8 @@ export class SimpleScheduler implements TargetScheduler {
if (shouldRun) {
await target.run();
} else {
target.status = "skipped";
target.onStart(0);
target.onSkipped();
}
} catch (e) {
runError = e;

Просмотреть файл

@ -77,6 +77,7 @@ export class WrappedTarget implements TargetRun {
onStart(threadId: number) {
if (this.status !== "running") {
this.threadId = threadId;
this.status = "running";
this.startTime = process.hrtime();
this.options.logger.info("", { target: this.target, status: "running", threadId });
@ -109,7 +110,7 @@ export class WrappedTarget implements TargetRun {
}
}
onSkipped(hash: string | null) {
onSkipped(hash?: string | undefined) {
this.status = "skipped";
this.duration = process.hrtime(this.startTime);
this.options.logger.info("", {
@ -123,7 +124,8 @@ export class WrappedTarget implements TargetRun {
async getCache() {
const { cacheProvider, hasher } = this.options;
let hash: string | null = null;
let hash: string | undefined = undefined;
let cacheHit = false;
const { target, shouldCache, shouldResetCache } = this.options;