Skip to content

Added a variable for readability in automation repository test#28375

Merged
EvanHahn merged 1 commit into
mainfrom
tidy-automations-repository-hour-var
Jun 4, 2026
Merged

Added a variable for readability in automation repository test#28375
EvanHahn merged 1 commit into
mainfrom
tidy-automations-repository-hour-var

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

@EvanHahn EvanHahn commented Jun 4, 2026

towards https://linear.app/ghost/issue/NY-1286
ref #28120

This is a test-only change that just makes things a little easier to read. I think it's useful on its own, but it'll also be useful for an upcoming change.

towards https://linear.app/ghost/issue/NY-1286
ref #28120

This is a test-only change that just makes things a little easier to
read. I think it's useful on its own, but it'll also be useful for [an
upcoming change](#28120).
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: afe13825-b47b-4bbf-b00f-e8da8a2a0248

📥 Commits

Reviewing files that changed from the base of the PR and between c68bbdb and a6ac77b.

📒 Files selected for processing (1)
  • ghost/core/test/unit/server/services/automations/automations-repository.test.ts

Walkthrough

This PR refactors the test suite for the automations repository service by extracting a hardcoded millisecond conversion factor into a named constant. The addHours helper function, used to generate test timestamps, now references a HOUR_MS constant instead of computing hours * 60 * 60 * 1000 inline, improving code readability and maintainability.

Possibly related PRs

  • TryGhost/Ghost#28313: Both PRs touch ghost/core/test/unit/server/services/automations/automations-repository.test.ts—this PR updates the addHours timestamp helper used by the test suite, while the retrieved PR adds/extends edit revision-deduplication assertions that rely on those generated timestamps.

Suggested reviewers

  • troyciesco
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: introducing a variable (HOUR_MS) to improve readability in the automation repository test file.
Description check ✅ Passed The description is related to the changeset, explaining that this is a test-only readability improvement and referencing relevant issues and related work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tidy-automations-repository-hour-var

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EvanHahn EvanHahn enabled auto-merge (squash) June 4, 2026 19:28
@EvanHahn EvanHahn merged commit 24244bb into main Jun 4, 2026
31 checks passed
@EvanHahn EvanHahn deleted the tidy-automations-repository-hour-var branch June 4, 2026 19:31
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.

1 participant