Skip to content

Update the status of Journal to the latest#178

Merged
kou merged 5 commits into
clear-code:masterfrom
abetomo:update-journal-status
Sep 22, 2025
Merged

Update the status of Journal to the latest#178
kou merged 5 commits into
clear-code:masterfrom
abetomo:update-journal-status

Conversation

@abetomo

@abetomo abetomo commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

GitHub fixes GH-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 2507b82, so when we update all journals, we do not create new FTS target.

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>
Tag.issue_status(issue.status_id).id,
],
],
journal_targets.collect {|target| target.tag_ids})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
journal_targets.collect {|target| target.tag_ids})
journal_targets.collect(&:tags)

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems that this is not used.

)
issue.reload
journal = issue.journals.create!(notes: "comment")
journal.reload

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this?

status: IssueStatus.find_by_name("New"),
tracker: Tracker.find_by_name("Bug")
)
issue.reload

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this?

issue.status = IssueStatus.find_by_name("Closed")
issue.tracker = Tracker.find_by_name("Support request")
issue.save!
issue.reload

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this?

Tag.issue_status(issue.status_id),
],
],
journal_targets.collect(&:tags))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems that we need to sort by something for stable test result:

https://github.com/clear-code/redmine_full_text_search/actions/runs/17203600120/job/48799194519?pr=178#step:10:23

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

Comment thread test/unit/full_text_search/issue_test.rb Outdated
Comment thread test/unit/full_text_search/issue_test.rb Outdated
abetomo and others added 2 commits August 26, 2025 09:52
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
@kou
kou merged commit bb80370 into clear-code:master Sep 22, 2025
22 of 24 checks passed
@abetomo
abetomo deleted the update-journal-status branch September 22, 2025 08:03
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.

drilldown: Issue's comment status is wrong

3 participants