Update the status of Journal to the latest#178
Merged
Conversation
GitHub fixes clear-codeGH-171 Problem: When `tag_ids` of an issue is updated, `tag_ids` of journal is not updated. The `tag_ids` stores status and tracker information. Solution: When `tag_ids` of an issue is updated, the information of journal is also updated. We have an issue that has been resolved with clear-code@2507b82, so when we update all journals, we do not create new FTS target. Co-authored-by: Sutou Kouhei <kou@clear-code.com>
kou
reviewed
Aug 25, 2025
| Tag.issue_status(issue.status_id).id, | ||
| ], | ||
| ], | ||
| journal_targets.collect {|target| target.tag_ids}) |
Member
There was a problem hiding this comment.
Suggested change
| journal_targets.collect {|target| target.tag_ids}) | |
| journal_targets.collect(&:tags) |
kou
reviewed
Aug 25, 2025
Comment on lines
+60
to
+65
| # Redmine 5.0 doesn't have updated_on | ||
| if journal.respond_to?(:updated_on) | ||
| last_modified_at = journal.updated_on | ||
| else | ||
| last_modified_at = journal.created_on | ||
| end |
kou
reviewed
Aug 25, 2025
| ) | ||
| issue.reload | ||
| journal = issue.journals.create!(notes: "comment") | ||
| journal.reload |
kou
reviewed
Aug 25, 2025
| status: IssueStatus.find_by_name("New"), | ||
| tracker: Tracker.find_by_name("Bug") | ||
| ) | ||
| issue.reload |
kou
reviewed
Aug 25, 2025
| issue.status = IssueStatus.find_by_name("Closed") | ||
| issue.tracker = Tracker.find_by_name("Support request") | ||
| issue.save! | ||
| issue.reload |
otegami
approved these changes
Aug 25, 2025
kou
reviewed
Aug 25, 2025
| Tag.issue_status(issue.status_id), | ||
| ], | ||
| ], | ||
| journal_targets.collect(&:tags)) |
Member
There was a problem hiding this comment.
It seems that we need to sort by something for stable test result:
Failure:
FullTextSearch::IssueTest#test_save_journal_status_and_tracker [plugins/full_text_search/test/unit/full_text_search/issue_test.rb:59]:
--- expected
+++ actual
@@ -1,3 +1,3 @@
-[[#<FullTextSearch::Tag:0xXXXXXX id: 1500, type_id: 393, name: "0">,
- #<FullTextSearch::Tag:0xXXXXXX id: 1501, type_id: 392, name: "3">,
- #<FullTextSearch::Tag:0xXXXXXX id: 1499, type_id: 394, name: "1">]]
+[[#<FullTextSearch::Tag:0xXXXXXX id: 1499, type_id: 394, name: "1">,
+ #<FullTextSearch::Tag:0xXXXXXX id: 1500, type_id: 393, name: "0">,
+ #<FullTextSearch::Tag:0xXXXXXX id: 1501, type_id: 392, name: "3">]]
rails test plugins/full_text_search/test/unit/full_text_search/issue_test.rb:47
kou
reviewed
Aug 26, 2025
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
otegami
approved these changes
Sep 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub fixes GH-171
Problem:
When
tag_idsof an issue is updated,tag_idsof journal is not updated. Thetag_idsstores status and tracker information.Solution:
When
tag_idsof an issue is updated, the information of journal is also updated.We have an issue that has been resolved with 2507b82, so when we update all journals, we do not create new FTS target.