Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/scripts/split_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eou pipefail

echo "Running FOAS CLI versions command"
foascli versions -s openapi-foas.json -o ./openapi/v2/versions.json --env "${target_env:?}" --stability-level stable --stability-level preview --stability-level upcoming
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root cause of the failure 🐛

foascli versions -s openapi-foas.json -o ./openapi/v2/versions.json --env "${target_env:?}" --stability-level stable --stability-level preview

echo "Running FOAS CLI split command with the following --env=${target_env:?} and -o=./openapi/v2/openapi.json"

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

"github.com/mongodb/openapi/tools/cli/internal/changelog"
Expand Down Expand Up @@ -72,9 +71,6 @@ 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
15 changes: 2 additions & 13 deletions tools/cli/internal/cli/changelog/metadata/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ func TestCreateBuild_Run(t *testing.T) {
opts := &Opts{
specRevision: "11110c256dffdb163be71a3ca70854a57fad5f6f",
runDate: "2024-01-01",
versions: []string{"2024-01-01", "2024-01-01.upcoming"},
versions: []string{"2024-01-01"},
fs: fs,
}

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

Expand All @@ -46,18 +47,6 @@ func TestCreateBuild_PreRun_InvalidVersion(t *testing.T) {
require.ErrorContains(t, opts.PreRun(), "invalid version date")
}

func TestCreateBuild_PreRun_upcomingAPI(t *testing.T) {
fs := afero.NewMemMapFs()
opts := &Opts{
specRevision: "test",
runDate: "2024-01-01",
versions: []string{"2024-01-01", "2024-01-01.upcoming"},
fs: fs,
}

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

func TestCreateBuilder(t *testing.T) {
test.CmdValidator(
t,
Expand Down
Loading