Skip to content

Commit

Permalink
Do not add release name for upcoming releases
Browse files Browse the repository at this point in the history
We can infer the release name from the target date by just formatting it
to display the month and year.

Ref: kubernetes/website#45770

Signed-off-by: Sascha Grunert <[email protected]>
  • Loading branch information
saschagrunert committed Apr 15, 2024
1 parent 2fe12ac commit 69a4599
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 1 addition & 3 deletions cmd/schedule-builder/cmd/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,9 @@ func updatePatchSchedule(refTime time.Time, schedule PatchSchedule, eolBranches
nextCherryPickDeadline := time.Date(latestDate.Year(), latestDate.Month(), cherryPickDay, 0, 0, 0, 0, time.UTC)
nextTargetDate := time.Date(latestDate.Year(), latestDate.Month(), targetDateDay, 0, 0, 0, 0, time.UTC)

releaseName := nextTargetDate.Format("January 2006")
logrus.Infof("Adding new upcoming release for %s", releaseName)
logrus.Infof("Adding new upcoming release for %s", nextTargetDate.Format("January 2006"))

newUpcomingReleases = append(newUpcomingReleases, &PatchRelease{
Release: releaseName,
CherryPickDeadline: nextCherryPickDeadline.Format(refDate),
TargetDate: nextTargetDate.Format(refDate),
})
Expand Down
10 changes: 1 addition & 9 deletions cmd/schedule-builder/cmd/markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const expectedPatchSchedule = `### Upcoming Monthly Releases
| MONTHLY PATCH RELEASE | CHERRY PICK DEADLINE | TARGET DATE |
|-----------------------|----------------------|-------------|
| June 2020 | 2020-06-12 | 2020-06-17 |
| | 2020-06-12 | 2020-06-17 |
### Timeline
Expand Down Expand Up @@ -166,7 +166,6 @@ func TestParsePatchSchedule(t *testing.T) {
},
UpcomingReleases: []*PatchRelease{
{
Release: "June 2020",
CherryPickDeadline: "2020-06-12",
TargetDate: "2020-06-17",
},
Expand Down Expand Up @@ -208,7 +207,6 @@ func TestParsePatchSchedule(t *testing.T) {
},
UpcomingReleases: []*PatchRelease{
{
Release: "June 2020",
CherryPickDeadline: "2020-06-12",
TargetDate: "2020-06-17",
},
Expand Down Expand Up @@ -381,17 +379,14 @@ func TestUpdatePatchSchedule(t *testing.T) {
},
UpcomingReleases: []*PatchRelease{
{
Release: "March 2024",
CherryPickDeadline: "2024-03-08",
TargetDate: "2024-03-13",
},
{
Release: "April 2024",
CherryPickDeadline: "2024-04-12",
TargetDate: "2024-04-17",
},
{
Release: "May 2024",
CherryPickDeadline: "2024-05-10",
TargetDate: "2024-05-14",
},
Expand Down Expand Up @@ -432,17 +427,14 @@ func TestUpdatePatchSchedule(t *testing.T) {
},
UpcomingReleases: []*PatchRelease{
{
Release: "April 2024",
CherryPickDeadline: "2024-04-12",
TargetDate: "2024-04-17",
},
{
Release: "May 2024",
CherryPickDeadline: "2024-05-10",
TargetDate: "2024-05-14",
},
{
Release: "June 2024",
CherryPickDeadline: "2024-06-07",
TargetDate: "2024-06-11",
},
Expand Down

0 comments on commit 69a4599

Please sign in to comment.