Skip to content

DM-53502-weekly: Add ability to retire old weekly tags#17

Merged
roceb merged 3 commits into
mainfrom
tickets/DM-53502-weekly
Dec 12, 2025
Merged

DM-53502-weekly: Add ability to retire old weekly tags#17
roceb merged 3 commits into
mainfrom
tickets/DM-53502-weekly

Conversation

@roceb
Copy link
Copy Markdown
Contributor

@roceb roceb commented Dec 11, 2025

No description provided.

@roceb roceb force-pushed the tickets/DM-53502-weekly branch 2 times, most recently from ccfa23a to 8769f81 Compare December 11, 2025 04:18
@roceb roceb force-pushed the tickets/DM-53502-weekly branch from 8769f81 to 33098b5 Compare December 11, 2025 04:37
@roceb roceb requested a review from mwittgen December 11, 2025 04:39
Comment thread main.go Outdated
}
// ISO week date format
// Get time for first day of the given year and week
t = time.Date(year, 0, 0, 0, 0, 0, 0, time.UTC)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Date function uses 1-12 for month and 1-31 for day.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't calculate the dates correctly. Maybe write a unit test?
https://go.dev/play/p/PVa_Z7-y6Zz

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed the bug and added some error handling.

@roceb roceb force-pushed the tickets/DM-53502-weekly branch 2 times, most recently from 7515d82 to 009ffcd Compare December 11, 2025 23:26
@roceb roceb requested a review from mwittgen December 12, 2025 18:15
Comment thread main.go Outdated
if err != nil {
return time.Time{}, err
}
if week >=53 || week <=0 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

53 is a valid year week. See
w.2022.53
So all returned dates are Mondays.

Comment thread main_test.go
Comment thread main.go
return t, err
}

func parse_w_tag(tag string) (t time.Time, err error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This always returns a Monday with the exception of the first release in a year which is always Jan 1st.
Check for consistency.

@roceb roceb force-pushed the tickets/DM-53502-weekly branch from 009ffcd to 33aa418 Compare December 12, 2025 20:58
Copy link
Copy Markdown
Contributor

@mwittgen mwittgen left a comment

Choose a reason for hiding this comment

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

Looks good me now.

@roceb roceb force-pushed the tickets/DM-53502-weekly branch from 33aa418 to 89b8e1b Compare December 12, 2025 21:56
@roceb roceb merged commit b6ded6f into main Dec 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants