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

Fix 909 Update initial data #918

Merged
merged 4 commits into from Apr 25, 2024
Merged

Fix 909 Update initial data #918

merged 4 commits into from Apr 25, 2024

Conversation

zahash
Copy link
Contributor

@zahash zahash commented Apr 23, 2024

fixes #909

@zahash zahash mentioned this pull request Apr 23, 2024
@LinkinStars LinkinStars changed the base branch from main to dev April 23, 2024 07:21
@zahash
Copy link
Contributor Author

zahash commented Apr 23, 2024

@LinkinStars

I just pushed the commit that updates initial data.

few of the tests fails because it has a tag_rel with hard-coded id that clashed with one present in initial data.
i will fix it soon by changing those hard coded IDs

--- FAIL: Test_tagListRepo_BatchGetObjectTagRelList (0.00s)
    tag_rel_repo_test.go:65: 
        	Error Trace:	/home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:65
        	Error:      	Not equal: 
        	            	expected: 2
        	            	actual  : 3
        	Test:       	Test_tagListRepo_BatchGetObjectTagRelList
[xorm] [info]  2024/04/23 20:21:07.437924 [SQL] SELECT count(*) FROM `tag_rel` WHERE `tag_id`=? AND `status`=? [10030000000000001 1] - 77.627µs
--- FAIL: Test_tagListRepo_CountTagRelByTagID (0.00s)
    tag_rel_repo_test.go:73: 
        	Error Trace:	/home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:73
        	Error:      	Not equal: 
        	            	expected: 1
        	            	actual  : 3
        	Test:       	Test_tagListRepo_CountTagRelByTagID


--- FAIL: Test_tagListRepo_GetObjectTagRelWithoutStatus (0.00s)
    tag_rel_repo_test.go:93: 
        	Error Trace:	/home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:93
        	Error:      	Not equal: 
        	            	expected: 2
        	            	actual  : 3
        	Test:       	Test_tagListRepo_GetObjectTagRelWithoutStatus
    tag_rel_repo_test.go:101: 
        	Error Trace:	/home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:101
        	Error:      	Not equal: 
        	            	expected: 0
        	            	actual  : 1
        	Test:       	Test_tagListRepo_GetObjectTagRelWithoutStatus
    tag_rel_repo_test.go:112: 
        	Error Trace:	/home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:112
        	Error:      	Not equal: 
        	            	expected: 1
        	            	actual  : 3
        	Test:       	Test_tagListRepo_GetObjectTagRelWithoutStatus

@zahash
Copy link
Contributor Author

zahash commented Apr 23, 2024

@LinkinStars @fenbox

the enhancement is done and ready for review.

@LinkinStars LinkinStars self-requested a review April 23, 2024 15:13
@LinkinStars LinkinStars added this to the v1.3.1 milestone Apr 23, 2024
@LinkinStars LinkinStars self-assigned this Apr 23, 2024
internal/migrations/init.go Outdated Show resolved Hide resolved
}

_, m.err = m.engine.Context(m.ctx).Insert(entity.TagRel{
CreatedAt: now,
Copy link
Member

Choose a reason for hiding this comment

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

Just like below, no need to set the time here.

Title: "What is a tag?",
OriginalText: "When asking a question, we need to choose tags. What are tags and why should I use them?",
ParsedText: "<p>When asking a question, we need to choose tags. What are tags and why should I use them?</p>",
Pin: entity.QuestionPin,
Copy link
Member

Choose a reason for hiding this comment

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

The questions don't need to be pinned to the top.

Show: entity.QuestionShow,
Status: entity.QuestionStatusAvailable,
AnswerCount: 1,
AcceptedAnswerID: a1_id,
Copy link
Member

Choose a reason for hiding this comment

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

The answer corresponding to the question does not need to be accepted.

Title: "What is reputation and how do I earn them?",
OriginalText: "I see that each user has reputation points, What is it and how do I earn them?",
ParsedText: "<p>I see that each user has reputation points, What is it and how do I earn them?</p>",
Pin: entity.QuestionPin,
Copy link
Member

Choose a reason for hiding this comment

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

The questions don't need to be pinned to the top.

Show: entity.QuestionShow,
Status: entity.QuestionStatusAvailable,
AnswerCount: 1,
AcceptedAnswerID: a2_id,
Copy link
Member

Choose a reason for hiding this comment

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

The answer corresponding to the question does not need to be accepted.

@zahash
Copy link
Contributor Author

zahash commented Apr 24, 2024

@LinkinStars

i think i resolved all the code change requests. can you check?

@LinkinStars LinkinStars merged commit ba90433 into apache:dev Apr 25, 2024
@LinkinStars
Copy link
Member

Great. Thank you for your contribution.

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.

Update initial data
2 participants