Skip to content

Conversation

niranjan-uma-shankar
Copy link
Contributor

@niranjan-uma-shankar niranjan-uma-shankar commented Jul 30, 2025

This PR updates the timezone data test and fixtures for the timezone data, which is needed for the changes made to the timezone-data package in TryGhost/SDK#585.

Ref: #24536

Note:

TryGhost/SDK#585 will need to be shipped for the tests here to pass. In the meantime, run the following test locally to verify they pass:

cd ghost/admin/tests 
yarn test 1 --filter="config-manager"

Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

Walkthrough

The timezone fixture array at ghost/admin/mirage/fixtures/timezones.js was edited: several timezone entries were added, removed or renamed (notably replacing America/Tijuana with America/Mazatlan, adding America/Chihuahua, swapping/adjusting various Asia entries and labels), and GMT offsets/labels were corrected for multiple regions. The integration test ghost/admin/tests/integration/services/config-test.js had its expected availableTimezones length updated to reflect the changed fixture data (assertion updated from 67 to 70).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related issues

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@niranjan-uma-shankar niranjan-uma-shankar marked this pull request as ready for review July 30, 2025 08:13
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
ghost/admin/mirage/fixtures/timezones.js (3)

17-17: Remove trailing whitespace.

There's unnecessary trailing whitespace after the comma.

-    }, 
+    },

203-204: Consider updating the city name spelling.

The timezone entry is correct, but consider updating "Katmandu" to "Kathmandu" for the more modern and widely accepted spelling.

-        label: '(GMT +5:45) Katmandu'
+        label: '(GMT +5:45) Kathmandu'

221-221: Fix formatting: add space after comma.

The addition of "Novosibirsk" is appropriate, but there should be a space after the comma for consistency.

-        label: '(GMT +7:00) Krasnoyarsk,Novosibirsk'
+        label: '(GMT +7:00) Krasnoyarsk, Novosibirsk'
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8bad9bd and fa1dd5f.

📒 Files selected for processing (2)
  • ghost/admin/mirage/fixtures/timezones.js (6 hunks)
  • ghost/admin/tests/integration/services/config-test.js (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: cathysarisky
PR: TryGhost/Ghost#0
File: :0-0
Timestamp: 2025-05-20T21:08:21.026Z
Learning: In the Ghost project, translation files (ghost/i18n/locales/*/*.json) commonly have blank values for translations, and this is normal behavior that should not be flagged in reviews. These empty translations will be filled in separate PRs.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Setup
🔇 Additional comments (12)
ghost/admin/mirage/fixtures/timezones.js (11)

15-16: LGTM! Valid timezone identifier replacement.

The replacement of America/Tijuana with America/Mazatlan is a legitimate timezone data update that aligns with standard IANA timezone database practices.


30-33: LGTM! Valid new timezone entry.

The addition of America/Chihuahua is a legitimate timezone entry with correct GMT offset and appropriate labeling.


64-64: LGTM! Enhanced timezone label for better geographic coverage.

The addition of "Georgetown" to the America/Caracas label accurately reflects the cities covered by this timezone.


68-68: LGTM! Corrected timezone label by removing geographically incorrect city.

Removing "Brasilia" from the America/Halifax label is correct, as Brasilia operates on GMT-3, not GMT-4 like Atlantic Canada.


80-80: LGTM! Corrected geographic assignment in timezone label.

Changing "Georgetown" to "Brasilia" in the America/Argentina/Buenos_Aires label is accurate, as Brasilia operates on GMT-3 like Buenos Aires.


182-185: LGTM! Valid new timezone entry for Kazakhstan.

The addition of Asia/Almaty with GMT+5:00 offset and appropriate city labels is a legitimate timezone entry.


196-196: LGTM! Updated city name to current official designation.

Changing "Calcutta" to "Kolkata" reflects the official name change and is more culturally appropriate.


199-201: LGTM! Accurate timezone entry for Sri Lanka.

The Asia/Colombo entry with both major Sri Lankan cities in the label is geographically correct.


209-209: LGTM! Simplified timezone label.

The simplified "Dhaka" label is appropriate for the Asia/Dhaka timezone.


213-213: LGTM! Inclusive labeling with both historical and current city names.

Using "Yangon (Rangoon)" provides clarity by showing both the current official name and the historically known name.


229-229: LGTM! Corrected spelling of Mongolia's capital.

The updated spelling "Ulaanbaatar" is the correct modern transliteration of Mongolia's capital city.

ghost/admin/tests/integration/services/config-test.js (1)

25-25: LGTM! Test updated to reflect increased timezone count.

The change from 67 to 69 timezones correctly reflects the addition of "America/Chihuahua" and "Asia/Almaty" entries in the fixtures.

@niranjan-uma-shankar niranjan-uma-shankar changed the title Timezone: Update fixtures Timezone: Update tests for the timezone-data package Jul 30, 2025
@niranjan-uma-shankar niranjan-uma-shankar changed the title Timezone: Update tests for the timezone-data package Update tests for the timezone-data package Jul 30, 2025
@ErisDS ErisDS requested a review from troyciesco August 4, 2025 11:33
Updates the timezone data array size count to 70, given that the SDK package was updated with an additional entry
@niranjan-uma-shankar niranjan-uma-shankar force-pushed the fix-tests-outdated-timezone branch from ca71b3c to a971529 Compare August 12, 2025 09:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
ghost/admin/mirage/fixtures/timezones.js (2)

15-17: Verify the placement order of America/Mazatlan

The America/Mazatlan entry (GMT -7:00) appears before America/Los_Angeles (GMT -8:00), which breaks the ascending GMT offset order. Consider moving it after line 21 to maintain consistent ordering.

Apply this diff to maintain consistent GMT offset ordering:

-    {
-        name: 'America/Mazatlan',
-        label: '(GMT -7:00) La Paz, Mazatlan'
-    }, 
     {
         name: 'America/Los_Angeles',
         label: '(GMT -8:00) Pacific Time (US & Canada); Tijuana'
     },
+    {
+        name: 'America/Mazatlan',
+        label: '(GMT -7:00) La Paz, Mazatlan'
+    },

221-221: Add missing space after comma in label

The label "Krasnoyarsk,Novosibirsk" is missing a space after the comma for consistency with other multi-city labels.

Apply this diff to fix the formatting:

-        label: '(GMT +7:00) Krasnoyarsk,Novosibirsk'
+        label: '(GMT +7:00) Krasnoyarsk, Novosibirsk'
ghost/admin/tests/integration/services/config-test.js (1)

25-30: Consider adding test coverage for the modified timezone entries

While the total count verification is correct, consider adding assertions to verify some of the newly added or modified timezone entries (e.g., America/Mazatlan, America/Chihuahua, Asia/Almaty) to ensure the fixture changes are fully validated.

Example additional assertions to add after line 30:

// Verify some of the newly added/modified entries
const mazatlan = timezones.find(tz => tz.name === 'America/Mazatlan');
expect(mazatlan).to.exist;
expect(mazatlan.label).to.equal('(GMT -7:00) La Paz, Mazatlan');

const chihuahua = timezones.find(tz => tz.name === 'America/Chihuahua');
expect(chihuahua).to.exist;
expect(chihuahua.label).to.equal('(GMT -6:00) Chihuahua');
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3cea1bc and a971529.

📒 Files selected for processing (2)
  • ghost/admin/mirage/fixtures/timezones.js (6 hunks)
  • ghost/admin/tests/integration/services/config-test.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Setup
🔇 Additional comments (2)
ghost/admin/mirage/fixtures/timezones.js (1)

182-205: Offsets Verified – No Changes Required

All reviewed entries match current UTC offsets:

  • Asia/Almaty – UTC +05:00
  • Asia/Colombo – UTC +05:30
  • Asia/Kathmandu – UTC +05:45

No update to these fixtures is needed.

ghost/admin/tests/integration/services/config-test.js (1)

25-25: Test correctly updated to match fixture data

The test expectation has been properly updated from 67 to 70 timezones, matching the changes in the timezone fixtures file (removed 1, added 4 entries).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants