File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
tools/cli/internal/cli/changelog/metadata Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package metadata
17
17
import (
18
18
"encoding/json"
19
19
"fmt"
20
+ "strings"
20
21
"time"
21
22
22
23
"github.com/mongodb/openapi/tools/cli/internal/changelog"
@@ -71,6 +72,9 @@ func (o *Opts) PreRun() error {
71
72
}
72
73
73
74
for _ , version := range o .versions {
75
+ if strings .Contains (version , ".upcoming" ) {
76
+ continue
77
+ }
74
78
if _ , err := time .Parse ("2006-01-02" , version ); err != nil {
75
79
return fmt .Errorf ("invalid version date: %w. Make sure to use the format YYYY-MM-DD" , err )
76
80
}
Original file line number Diff line number Diff line change @@ -28,10 +28,9 @@ func TestCreateBuild_Run(t *testing.T) {
28
28
opts := & Opts {
29
29
specRevision : "11110c256dffdb163be71a3ca70854a57fad5f6f" ,
30
30
runDate : "2024-01-01" ,
31
- versions : []string {"2024-01-01" },
31
+ versions : []string {"2024-01-01" , "2024-01-01.upcoming" },
32
32
fs : fs ,
33
33
}
34
-
35
34
require .NoError (t , opts .Run ())
36
35
}
37
36
@@ -47,6 +46,18 @@ func TestCreateBuild_PreRun_InvalidVersion(t *testing.T) {
47
46
require .ErrorContains (t , opts .PreRun (), "invalid version date" )
48
47
}
49
48
49
+ func TestCreateBuild_PreRun_upcomingAPI (t * testing.T ) {
50
+ fs := afero .NewMemMapFs ()
51
+ opts := & Opts {
52
+ specRevision : "test" ,
53
+ runDate : "2024-01-01" ,
54
+ versions : []string {"2024-01-01" , "2024-01-01.upcoming" },
55
+ fs : fs ,
56
+ }
57
+
58
+ require .NoError (t , opts .PreRun ())
59
+ }
60
+
50
61
func TestCreateBuilder (t * testing.T ) {
51
62
test .CmdValidator (
52
63
t ,
You can’t perform that action at this time.
0 commit comments