Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): strip special characters from mongodb-runner tmp directories #2011

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions testing/integration-testing-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { promises as fs } from 'fs';
import { MongoClient, MongoClientOptions } from 'mongodb';
import path from 'path';
import semver from 'semver';
import { URL } from 'url';
import { promisify } from 'util';
import which from 'which';
import { ConnectionString } from 'mongodb-connection-string-url';
import { MongoCluster, MongoClusterOptions } from 'mongodb-runner';
import { downloadMongoDb } from '@mongodb-js/mongodb-downloader';
import { downloadCryptLibrary } from '../packages/build/src/packaging/download-crypt-library';

const execFile = promisify(child_process.execFile);
Expand Down Expand Up @@ -126,7 +124,7 @@ export class MongoRunnerSetup extends MongodSetup {
private static _usedDirPrefix: Record<string, 0> = {};

private static _buildDirPath(id: string, version?: string, topology?: string) {
const prefix = [id, version, topology].filter(Boolean).join('-');
const prefix = [id, version, topology].filter(Boolean).join('-').replace(/[^a-zA-Z0-9_.-]/g, '');

this._usedDirPrefix[prefix] ??= 0;

Expand Down
Loading