fix(ci): satisfy opencode lint gate
This commit is contained in:
parent
e131009bae
commit
0d23dc80c9
2 changed files with 14 additions and 14 deletions
|
|
@ -517,11 +517,12 @@ function looksLikeHtml(text: string): boolean {
|
||||||
function redactUrl(url: string): string {
|
function redactUrl(url: string): string {
|
||||||
try {
|
try {
|
||||||
const parsed = new URL(url);
|
const parsed = new URL(url);
|
||||||
|
const redactedCredential = 'redacted';
|
||||||
if (parsed.username) {
|
if (parsed.username) {
|
||||||
parsed.username = 'redacted';
|
parsed.username = redactedCredential;
|
||||||
}
|
}
|
||||||
if (parsed.password) {
|
if (parsed.password) {
|
||||||
parsed.password = 'redacted';
|
parsed.password = redactedCredential;
|
||||||
}
|
}
|
||||||
return parsed.toString();
|
return parsed.toString();
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
|
import { atomicWriteAsync } from '@main/utils/atomicWrite';
|
||||||
import { createHash, randomUUID } from 'crypto';
|
import { createHash, randomUUID } from 'crypto';
|
||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
import { atomicWriteAsync } from '@main/utils/atomicWrite';
|
|
||||||
|
|
||||||
import { VersionedJsonStore, VersionedJsonStoreError } from './VersionedJsonStore';
|
import { VersionedJsonStore, VersionedJsonStoreError } from './VersionedJsonStore';
|
||||||
|
|
||||||
export const OPENCODE_RUNTIME_STORE_MANIFEST_SCHEMA_VERSION = 1;
|
export const OPENCODE_RUNTIME_STORE_MANIFEST_SCHEMA_VERSION = 1;
|
||||||
|
|
@ -248,6 +247,14 @@ export const OPENCODE_RUNTIME_STORE_DESCRIPTORS: RuntimeStoreDescriptor[] = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
async function readStoreDataOrThrow<TData>(store: VersionedJsonStore<TData>): Promise<TData> {
|
||||||
|
const result = await store.read();
|
||||||
|
if (!result.ok) {
|
||||||
|
throw new VersionedJsonStoreError(result.message, result.reason, result.quarantinePath);
|
||||||
|
}
|
||||||
|
return result.data;
|
||||||
|
}
|
||||||
|
|
||||||
export class RuntimeStoreManifestStore {
|
export class RuntimeStoreManifestStore {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly store: VersionedJsonStore<RuntimeStoreManifest>,
|
private readonly store: VersionedJsonStore<RuntimeStoreManifest>,
|
||||||
|
|
@ -255,11 +262,7 @@ export class RuntimeStoreManifestStore {
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async read(): Promise<RuntimeStoreManifest> {
|
async read(): Promise<RuntimeStoreManifest> {
|
||||||
const result = await this.store.read();
|
return readStoreDataOrThrow(this.store);
|
||||||
if (!result.ok) {
|
|
||||||
throw new VersionedJsonStoreError(result.message, result.reason, result.quarantinePath);
|
|
||||||
}
|
|
||||||
return result.data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async markBatchPreparing(batch: RuntimeStoreWriteBatch): Promise<void> {
|
async markBatchPreparing(batch: RuntimeStoreWriteBatch): Promise<void> {
|
||||||
|
|
@ -348,11 +351,7 @@ export class RuntimeStoreReceiptStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
async list(): Promise<RuntimeStoreWriteBatch[]> {
|
async list(): Promise<RuntimeStoreWriteBatch[]> {
|
||||||
const result = await this.store.read();
|
return readStoreDataOrThrow(this.store);
|
||||||
if (!result.ok) {
|
|
||||||
throw new VersionedJsonStoreError(result.message, result.reason, result.quarantinePath);
|
|
||||||
}
|
|
||||||
return result.data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async listUncommitted(teamName: string): Promise<RuntimeStoreWriteBatch[]> {
|
async listUncommitted(teamName: string): Promise<RuntimeStoreWriteBatch[]> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue