Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/cli/internal/cli/changelog/metadata/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package metadata
import (
"encoding/json"
"fmt"
"strings"
"time"

"github.com/mongodb/openapi/tools/cli/internal/changelog"
Expand Down Expand Up @@ -71,6 +72,9 @@ func (o *Opts) PreRun() error {
}

for _, version := range o.versions {
if strings.Contains(version, ".upcoming") {
continue
}
if _, err := time.Parse("2006-01-02", version); err != nil {
return fmt.Errorf("invalid version date: %w. Make sure to use the format YYYY-MM-DD", err)
}
Expand Down
4 changes: 2 additions & 2 deletions tools/cli/internal/cli/changelog/metadata/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ func TestCreateBuild_Run(t *testing.T) {
opts := &Opts{
specRevision: "11110c256dffdb163be71a3ca70854a57fad5f6f",
runDate: "2024-01-01",
versions: []string{"2024-01-01"},
versions: []string{"2024-01-01", "2024-01-01.upcoming"},
fs: fs,
}

require.NoError(t, opts.PreRun())
require.NoError(t, opts.Run())
}

Expand Down
Loading