-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
add develop script to view and update test data #26594
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
base: main
Are you sure you want to change the base?
Conversation
try add a dev script to start a dev service base on the test data (`models/fixtures/`, `tests/gitea-repositories-meta` and `tests/gitea-lfs-meta`). then the developer can check and update the test data by ui operation on the test server. I think it will be a more simple way than manually edit. Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
This reverts commit 615ccbb.
Signed-off-by: a1012112796 <1012112796@qq.com>
2fc7c5b
to
10474e5
Compare
Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
How about to implement |
I do not think it is maintainable to introduce a new "contrib/dev/dev.go" with a lot of magic strings in it. I have a feeling that many existing test-related code could/should be reused. |
And there is a security problem: if by default "git hook" is enabled , and the passwords are well-known ones, attackers could hack into a Gitea developer's computer. |
I think I hasn't change any test data now. just update a little test datas which has bug ...
I think it's not a problem, developer just use it to edit test data, which should not be running as a public web server. and user can only view/update the test data in develop server, can't view or change other data in developer's computer also. I think it's necesary, because fully manually editing the test data may be hard in some operations like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: will do these bug fixs in new pull requests
@@ -320,6 +320,10 @@ func (pr *PullRequest) LoadRequestedReviewers(ctx context.Context) error { | |||
return err | |||
} | |||
for _, review := range reviews { | |||
if review.Type != ReviewTypeRequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug
@@ -159,6 +159,11 @@ func (r *Review) LoadReviewer(ctx context.Context) (err error) { | |||
return err | |||
} | |||
r.Reviewer, err = user_model.GetPossibleUserByID(ctx, r.ReviewerID) | |||
if user_model.IsErrUserNotExist(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug
@@ -33,6 +33,9 @@ func (reviews ReviewList) LoadReviewers(ctx context.Context) error { | |||
} | |||
for _, review := range reviews { | |||
review.Reviewer = userMap[review.ReviewerID] | |||
if review.Reviewer == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug
oh, sorry I fogot the |
luckly looks git hook has been disabled by default, So I think it's safe. and maybe I can add a logic to update all password to a random value before the dev server start and reset it to the test data when the server stop. |
Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
This reverts commit 884bb85.
Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: a1012112796 <1012112796@qq.com>
try add a dev script to start a dev service base on the test data (
models/fixtures/
,tests/gitea-repositories-meta
andtests/gitea-lfs-meta
). then the developer can check and update the test data by ui operation on the test server. I think it will be a more simple way than manually edit. example:example.mp4
TODOs: