Skip to content

Commit

Permalink
qa bundle flag now downloads staging highlighter builds (#5277)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggolda authored Jan 8, 2025
1 parent f5cd8fd commit 4eb9f99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/services/highlighter/ai-highlighter/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ export class AiHighlighterUpdater {
*/
private getManifestUrl(): string {
if (Utils.getHighlighterEnvironment() === 'staging') {
return 'https://cdn-highlighter-builds.streamlabs.com/staging/manifest_win_x86_64.json';
const cacheBuster = Math.floor(Date.now() / 1000);
return `https://cdn-highlighter-builds.streamlabs.com/staging/manifest_win_x86_64.json?t=${cacheBuster}`;
} else {
return 'https://cdn-highlighter-builds.streamlabs.com/manifest_win_x86_64.json';
return 'https://cdn-highlighter-builds.streamlabs.com/production/manifest_win_x86_64.json';
}
}
/**
Expand Down Expand Up @@ -141,7 +142,10 @@ export class AiHighlighterUpdater {
await fs.readFile(this.manifestPath, 'utf-8'),
) as IAIHighlighterManifest;

if (newManifest.version !== currentManifest.version) {
if (
newManifest.version !== currentManifest.version ||
newManifest.timestamp > currentManifest.timestamp
) {
console.log(
`new highlighter version available. ${currentManifest.version} -> ${newManifest.version}`,
);
Expand Down
5 changes: 5 additions & 0 deletions app/services/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ export default class Utils {
static isDevMode() {
return Utils.env.NODE_ENV !== 'production';
}

static getHighlighterEnvironment(): 'production' | 'staging' | 'local' {
if (process.argv.includes('--bundle-qa')) {
return 'staging';
}

if (process.env.HIGHLIGHTER_ENV !== 'staging' && process.env.HIGHLIGHTER_ENV !== 'local') {
return 'production';
}
Expand Down

0 comments on commit 4eb9f99

Please sign in to comment.