Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DEV: Refactor automation Update service per PR #36458 feedback#36771

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ZogStriP merged 4 commits intomainfromrefactor-update-automation-service
Dec 18, 2025

Conversation

@ZogStriP
Copy link
Member

Addresses code review feedback to improve the automation Update service by following Discourse service best practices and extracting complex logic into a dedicated action class.

Changes:

  • Extract logging logic toDiscourseAutomation::Action::LogAutomationUpdate action class, removing utility methods from the service (per service guidelines that discourage utility methods in services)
  • Usemodel step forprevious_state instead of regular step
  • Simplifycapture_previous_state usingslice andmerge
  • Passprevious_state as explicit parameter tolog_action
  • Remove unusedparams fromapply_forced_triggerable
  • Simplify attributes building withsymbolize_keys.slice().compact_blank
  • Simplify save logic:save!(validate: context[:clear_trigger].blank?)
  • Useindex_with for building change hashes in action class
  • Usehave_attributes matcher in request specs
  • Simplify boolean checks withvalue.in?([true, false])

References:

Addresses code review feedback to improve the automation Update serviceby following Discourse service best practices and extracting complexlogic into a dedicated action class.Changes:- Extract logging logic to `DiscourseAutomation::Action::LogAutomationUpdate`  action class, removing utility methods from the service (per service  guidelines that discourage utility methods in services)- Use `model` step for `previous_state` instead of regular step- Simplify `capture_previous_state` using `slice` and `merge`- Pass `previous_state` as explicit parameter to `log_action`- Remove unused `params` from `apply_forced_triggerable`- Simplify attributes building with `symbolize_keys.slice().compact_blank`- Simplify save logic: `save!(validate: context[:clear_trigger].blank?)`- Use `index_with` for building change hashes in action class- Use `have_attributes` matcher in request specs- Simplify boolean checks with `value.in?([true, false])`References:- PR feedback:#36458- Service objects guide:https://meta.discourse.org/t/using-service-objects-in-discourse/333641
@ZogStriPZogStriP requested a review fromFlinkDecember 18, 2025 11:07
Copy link
Contributor

@FlinkFlink left a comment

Choose a reason for hiding this comment

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

Just small comments, otherwise 👍

ZogStriP reacted with thumbs up emoji
@ZogStriPZogStriP merged commite701375 intomainDec 18, 2025
24 of 26 checks passed
@ZogStriPZogStriP deleted the refactor-update-automation-service branchDecember 18, 2025 17:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@FlinkFlinkFlink approved these changes

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@ZogStriP@Flink

[8]ページ先頭

©2009-2025 Movatter.jp