Skip to content

Commit 781c321

Browse files
Allow parsing third-party archives (#1029)
1 parent 072d0f2 commit 781c321

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

etl/globals.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const DatePathPattern = `(\d{4}/[01]\d/[0123]\d)/`
6868
const dateTime = `(\d{4}[01]\d[0123]\d)T(\d{6}(\.\d{0,6})?)Z`
6969

7070
const type2 = `(?:-([a-z0-9-]+))?` // optional datatype string
71-
const mlabNSiteNN = `-(mlab\d)-([a-z]{3}\d[0-9t])-`
71+
const mlabNSiteNN = `-(mlab\d|third)-([a-z]{3}\d[0-9t]|party)-`
7272

7373
// This parses the experiment name, optional -NNNN sequence number, and optional -e (for old embargoed files)
7474
const expNNNNE = `([a-z-]+)(?:-(\d{4}))?(-e)?`

etl/globals_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ func TestValidateTestPath(t *testing.T) {
137137
"archive-measurement-lab", "ndt", "scamper1", "2021/09/08", "20210908", "215656.886052", "scamper1", "mlab3", "bog03", "ndt", "", "", ".tgz",
138138
},
139139
},
140+
{
141+
name: "thirdparty-annotation",
142+
path: `gs://archive-mlab-sandbox/ndt/annotation/2019/08/14/20211107T143735.458956Z-annotation-third-party-ndt.tgz`,
143+
wantType: etl.ANNOTATION,
144+
want: etl.DataPath{
145+
`gs://archive-mlab-sandbox/ndt/annotation/2019/08/14/20211107T143735.458956Z-annotation-third-party-ndt.tgz`,
146+
`ndt/annotation/2019/08/14/20211107T143735.458956Z-annotation-third-party-ndt.tgz`,
147+
`archive-mlab-sandbox`, "ndt", "annotation", "2019/08/14", "20211107", "143735.458956", "annotation", "third", "party", "ndt", "", "", ".tgz",
148+
},
149+
},
140150
}
141151
for _, tt := range tests {
142152
t.Run(tt.name, func(t *testing.T) {

0 commit comments

Comments
 (0)