fix the trimming of log filenames for gh run view
This commit is contained in:
parent
1886fb46ab
commit
64415df08d
3 changed files with 13 additions and 0 deletions
Binary file not shown.
|
|
@ -546,6 +546,7 @@ func logFilenameRegexp(job shared.Job, step shared.Step) *regexp.Regexp {
|
|||
// * Truncate long job names
|
||||
//
|
||||
sanitizedJobName := strings.ReplaceAll(job.Name, "/", "")
|
||||
sanitizedJobName = strings.ReplaceAll(sanitizedJobName, ":", "")
|
||||
sanitizedJobName = truncateAsUTF16(sanitizedJobName, JOB_NAME_MAX_LENGTH)
|
||||
re := fmt.Sprintf(`^%s\/%d_.*\.txt`, regexp.QuoteMeta(sanitizedJobName), step.Number)
|
||||
return regexp.MustCompile(re)
|
||||
|
|
|
|||
|
|
@ -1522,6 +1522,18 @@ func Test_attachRunLog(t *testing.T) {
|
|||
// not the double space in the dir name, as the slash has been removed
|
||||
wantFilename: "cool job with slash/1_fob the barz.txt",
|
||||
},
|
||||
{
|
||||
name: "job name with colon matches dir with colon removed",
|
||||
job: shared.Job{
|
||||
Name: "cool job : with colon",
|
||||
Steps: []shared.Step{{
|
||||
Name: "fob the barz",
|
||||
Number: 1,
|
||||
}},
|
||||
},
|
||||
wantMatch: true,
|
||||
wantFilename: "cool job with colon/1_fob the barz.txt",
|
||||
},
|
||||
{
|
||||
name: "Job name with really long name (over the ZIP limit)",
|
||||
job: shared.Job{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue