Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: set milestone.deadline_unix in fixtures #18237

Merged
merged 4 commits into from
Jan 13, 2022

Conversation

realaravinth
Copy link
Contributor

@realaravinth realaravinth commented Jan 11, 2022

On behalf of Loïc Dachary from the forgefriends project:

The value of deadline_unix must be set to 253370764800 (i.e. 9999-01-01) in
fixtures, otherwise it will be inserted as null which leads to
unexpected errors. For instance, DumpRepository will store a null
deadline_unix as 0 (i.e. 1970-01-01) and RestoreRepository will change
it to 9999-01-01.


source

@realaravinth realaravinth marked this pull request as draft January 11, 2022 15:45
@realaravinth realaravinth marked this pull request as ready for review January 11, 2022 16:52
@lunny
Copy link
Member

lunny commented Jan 12, 2022

Is there any effective for the UI of the migration repositories?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 12, 2022
Loïc Dachary added 2 commits January 12, 2022 20:30
Do not change the deadline value if it is set to January 1st, 1970.

Setting the deadline to year 9999 when it is zero (which is equal to
January 1st, 1970) modifies a deadline set to January 1st, 1970 which
is a valid date. In addition, setting a date in year 9999 will be
converted to a null date in some cases.

Signed-off-by: Loïc Dachary <loic@dachary.org>
The value of deadline_unix must be set to 253370764800 (i.e. 9999-01-01) in
fixtures, otherwise it will be inserted as null which leads to
unexpected errors. For instance, DumpRepository will store a null
deadline_unix as 0 (i.e. 1970-01-01) and RestoreRepository will change
it to 9999-01-01.

Signed-off-by: Loïc Dachary <loic@dachary.org>
@realaravinth
Copy link
Contributor Author

on behalf of @dachary:

Thanks for the review. The bug fix was incorrect. The milestone fixtures must have a deadline_unix field set instead. I now understand why the year 9999 is special.


source

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 12, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 13, 2022
@lunny
Copy link
Member

lunny commented Jan 13, 2022

make L-G-T-M work.

@lunny lunny merged commit 69a2829 into go-gitea:main Jan 13, 2022
@realaravinth realaravinth changed the title migrations: a deadline at January 1st, 1970 is valid tests: set milestone.deadline_unix in fixtures Jan 13, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 14, 2022
* 'main' of https://github.com/go-gitea/gitea:
  [skip ci] Updated translations via Crowdin
  Improve the comment for 2FA filter in admin panel (go-gitea#18017)
  fix regression from go-gitea#16075 (go-gitea#18260)
  Prevent underline hover on cards (go-gitea#18259)
  Fix release link broken (go-gitea#18252)
  migrations: a deadline at January 1st, 1970 is valid (go-gitea#18237)
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
* migrations: a deadline at January 1st, 1970 is valid

Do not change the deadline value if it is set to January 1st, 1970.

Setting the deadline to year 9999 when it is zero (which is equal to
January 1st, 1970) modifies a deadline set to January 1st, 1970 which
is a valid date. In addition, setting a date in year 9999 will be
converted to a null date in some cases.

Signed-off-by: Loïc Dachary <loic@dachary.org>

* tests: set milestone.deadline_unix in fixtures

The value of deadline_unix must be set to 253370764800 (i.e. 9999-01-01) in
fixtures, otherwise it will be inserted as null which leads to
unexpected errors. For instance, DumpRepository will store a null
deadline_unix as 0 (i.e. 1970-01-01) and RestoreRepository will change
it to 9999-01-01.

Signed-off-by: Loïc Dachary <loic@dachary.org>

Co-authored-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants