Do not backfill the slug (#3901)

* Do not backfill the slug https://github.com/sitespeedio/sitespeed.io/issues/3899
This commit is contained in:
Peter Hedenskog 2023-07-07 16:31:13 +02:00 committed by GitHub
parent c098331138
commit 9e215b8b06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 11 deletions

View File

@ -31,9 +31,6 @@ export function resultsStorage(input, timestamp, options) {
storageBasePath = resolve('sitespeed-result', ...resultsSubFolders);
}
// backfill the slug
options.slug = options.slug || getDomainOrFileName(input).replace(/\./g, '_');
storagePathPrefix = join(...resultsSubFolders);
if (resultBaseURL) {

View File

@ -56,7 +56,7 @@ export function send(
urlAndGroup[1]
];
// Avoid having the same annotations twice https://github.com/sitespeedio/sitespeed.io/issues/3277#
if (options.slug && options.slug !== urlAndGroup[0]) {
if (options.slug) {
tags.push(options.slug);
}
const extraTags = toArray(options.grafana.annotationTag);

View File

@ -56,7 +56,7 @@ function keyPathFromMessage(message, options, includeQueryParameters, alias) {
typeParts.splice(1, 0, toSafeKey(message.group));
}
if (options.graphite && options.graphite.addSlugToKey) {
if (options.graphite && options.graphite.addSlugToKey && options.slug) {
typeParts.unshift(options.slug);
}

View File

@ -50,8 +50,8 @@ export function send(
urlAndGroup[0],
urlAndGroup[1]
];
// See https://github.com/sitespeedio/sitespeed.io/issues/3277
if (options.slug && options.slug !== urlAndGroup[0]) {
if (options.slug) {
tags.push(options.slug);
}
const extraTags = toArray(options.graphite.annotationTag);

View File

@ -253,7 +253,9 @@ export class InfluxDBDataGenerator {
tags.group = toSafeKey(message.group, options.influxdb.groupSeparator);
}
tags.testName = options.slug;
if (options.slug) {
tags.testName = options.slug;
}
return tags;
}

View File

@ -40,8 +40,7 @@ export function send(
).split('.');
let tags = [connectivity, browser, urlAndGroup[0], urlAndGroup[1]];
// See https://github.com/sitespeedio/sitespeed.io/issues/3277
if (options.slug && options.slug !== urlAndGroup[0]) {
if (options.slug) {
tags.push(options.slug);
}

View File

@ -355,5 +355,5 @@ test(`Test influxdb dataGenerator`, t => {
const seriesName = data[0].seriesName;
const numberOfTags = Object.keys(data[0].tags).length;
t.is(seriesName, 'score');
t.is(numberOfTags, 7);
t.is(numberOfTags, 6);
});