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
1717import  (
1818	"encoding/json" 
1919	"fmt" 
20+ 	"strings" 
2021	"time" 
2122
2223	"github.com/mongodb/openapi/tools/cli/internal/changelog" 
@@ -71,6 +72,9 @@ func (o *Opts) PreRun() error {
7172	}
7273
7374	for  _ , version  :=  range  o .versions  {
75+ 		if  strings .Contains (version , ".upcoming" ) {
76+ 			continue 
77+ 		}
7478		if  _ , err  :=  time .Parse ("2006-01-02" , version ); err  !=  nil  {
7579			return  fmt .Errorf ("invalid version date: %w. Make sure to use the format YYYY-MM-DD" , err )
7680		}
Original file line number Diff line number Diff line change @@ -28,10 +28,9 @@ func TestCreateBuild_Run(t *testing.T) {
2828	opts  :=  & Opts {
2929		specRevision : "11110c256dffdb163be71a3ca70854a57fad5f6f" ,
3030		runDate :      "2024-01-01" ,
31- 		versions :     []string {"2024-01-01" },
31+ 		versions :     []string {"2024-01-01" ,  "2024-01-01.upcoming" },
3232		fs :           fs ,
3333	}
34- 
3534	require .NoError (t , opts .Run ())
3635}
3736
@@ -47,6 +46,18 @@ func TestCreateBuild_PreRun_InvalidVersion(t *testing.T) {
4746	require .ErrorContains (t , opts .PreRun (), "invalid version date" )
4847}
4948
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+ 
5061func  TestCreateBuilder (t  * testing.T ) {
5162	test .CmdValidator (
5263		t ,
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments