Skip to content

feat: enhance holiday data handling and add 2024/2025 holiday JSON files#236

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/snipefrom
dengzhongyuan365-dev:develop/snipe
Apr 22, 2025
Merged

feat: enhance holiday data handling and add 2024/2025 holiday JSON files#236
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/snipefrom
dengzhongyuan365-dev:develop/snipe

Conversation

@dengzhongyuan365-dev
Copy link
Copy Markdown
Contributor

@dengzhongyuan365-dev dengzhongyuan365-dev commented Apr 22, 2025

  • Updated DbusHuangLiRequest to process holiday data from new JSON structure.
  • Modified lunardatastruct.h to adjust HolidayInfo structure.
  • Added new holiday JSON files for 2024 and 2025 to resources.
  • Refactored DHuangLiDataBase to read holiday data from JSON files instead of SQL queries.

Log: enhance holiday data handling and add 2024/2025 holiday JSON files
Bug: https://pms.uniontech.com/bug-view-298927.html

Summary by Sourcery

Enhance holiday data handling by migrating from SQL queries to JSON-based holiday data processing for 2024 and 2025

New Features:

  • Add support for reading holiday data from JSON files for 2024 and 2025

Enhancements:

  • Refactor holiday data processing to use a more flexible JSON-based approach
  • Update HolidayInfo structure to support new data format

Chores:

  • Update translation files with minor line number adjustments

- Updated DbusHuangLiRequest to process holiday data from new JSON structure.
- Modified lunardatastruct.h to adjust HolidayInfo structure.
- Added new holiday JSON files for 2024 and 2025 to resources.
- Refactored DHuangLiDataBase to read holiday data from JSON files instead of SQL queries.

Log: enhance holiday data handling and add 2024/2025 holiday JSON files
Bug: https://pms.uniontech.com/bug-view-298927.html
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 22, 2025

Reviewer's Guide by Sourcery

This pull request enhances the holiday data handling by switching from SQL queries to JSON files, adds holiday data for 2024 and 2025, and updates translations. The changes involve modifying the data processing logic, adding new JSON files, and adjusting the structure of the HolidayInfo struct.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Refactored holiday data handling to read from JSON files instead of SQL queries.
  • Modified DbusHuangLiRequest to process holiday data from the new JSON structure.
  • Refactored DHuangLiDataBase to read holiday data from JSON files.
  • Updated HolidayInfo structure in lunardatastruct.h.
calendar-client/src/dbus/dbushuanglirequest.cpp
calendar-service/src/dbmanager/dhuanglidatabase.cpp
calendar-common/src/huangliData/lunardatastruct.h
Added new holiday JSON files for 2024 and 2025.
  • Added 2024.json to the holiday-cn directory.
  • Added 2025.json to the holiday-cn directory.
calendar-service/assets/holiday-cn/2024.json
calendar-service/assets/holiday-cn/2025.json
Updated translations for dde-calendar in English (US).
  • Updated message locations in CMonthView, CScheduleOperation, CScheduleSearchDateItem, CScheduleSearchView, CScheduleView, CTimeEdit, CYearWindow, CalendarWindow, Calendarmainwindow, Return, and YearFrame.
  • Removed unused translations in CWeekWidget.
  • Added new translations in DAccountDataBase and DAlarmManager.
translations/dde-calendar_en_US.ts
translations/dde-calendar-service_en_US.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @dengzhongyuan365-dev - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using a more robust JSON parsing library to handle potential variations in the JSON structure.
  • Ensure the date format string "yyyy-MM-dd" is consistent across all JSON files to avoid parsing errors.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread calendar-common/src/huangliData/lunardatastruct.h
@github-actions
Copy link
Copy Markdown

  • 敏感词检查失败, 检测到6个文件存在敏感词
详情
{
    "calendar-service/assets/holiday-cn/2022.json": [
        {
            "line": "    \"$schema\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/schema.json\",",
            "line_number": 2,
            "rule": "S35",
            "reason": "Url link | a43bfa6ba7"
        },
        {
            "line": "    \"$id\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/2022.json\",",
            "line_number": 3,
            "rule": "S35",
            "reason": "Url link | 335e709177"
        },
        {
            "line": "        \"http://www.gov.cn/zhengce/zhengceku/2021-10/25/content_5644835.htm\"",
            "line_number": 6,
            "rule": "S35",
            "reason": "Url link | 90da8a89b3"
        }
    ],
    "calendar-service/assets/holiday-cn/2020.json": [
        {
            "line": "    \"$schema\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/schema.json\",",
            "line_number": 2,
            "rule": "S35",
            "reason": "Url link | a43bfa6ba7"
        },
        {
            "line": "    \"$id\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/2020.json\",",
            "line_number": 3,
            "rule": "S35",
            "reason": "Url link | 843c84a738"
        },
        {
            "line": "        \"http://www.gov.cn/zhengce/zhengceku/2019-11/21/content_5454164.htm\",",
            "line_number": 6,
            "rule": "S35",
            "reason": "Url link | a4827650b4"
        },
        {
            "line": "        \"http://www.gov.cn/zhengce/zhengceku/2020-01/27/content_5472352.htm\"",
            "line_number": 7,
            "rule": "S35",
            "reason": "Url link | e13024345b"
        }
    ],
    "calendar-service/assets/holiday-cn/2025.json": [
        {
            "line": "    \"$schema\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/schema.json\",",
            "line_number": 2,
            "rule": "S35",
            "reason": "Url link | a43bfa6ba7"
        },
        {
            "line": "    \"$id\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/2025.json\",",
            "line_number": 3,
            "rule": "S35",
            "reason": "Url link | feef2d31dc"
        },
        {
            "line": "        \"https://www.gov.cn/zhengce/zhengceku/202411/content_6986383.htm\"",
            "line_number": 6,
            "rule": "S35",
            "reason": "Url link | f187f32d0d"
        }
    ],
    "calendar-service/assets/holiday-cn/2021.json": [
        {
            "line": "    \"$schema\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/schema.json\",",
            "line_number": 2,
            "rule": "S35",
            "reason": "Url link | a43bfa6ba7"
        },
        {
            "line": "    \"$id\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/2021.json\",",
            "line_number": 3,
            "rule": "S35",
            "reason": "Url link | 3b8fb29762"
        },
        {
            "line": "        \"http://www.gov.cn/zhengce/zhengceku/2020-11/25/content_5564127.htm\"",
            "line_number": 6,
            "rule": "S35",
            "reason": "Url link | 274f5033e2"
        }
    ],
    "calendar-service/assets/holiday-cn/2019.json": [
        {
            "line": "    \"$schema\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/schema.json\",",
            "line_number": 2,
            "rule": "S35",
            "reason": "Url link | a43bfa6ba7"
        },
        {
            "line": "    \"$id\": \"https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/2019.json\",",
            "line_number": 3,
            "rule": "S35",
            "reason": "Url link | 13160397df"
        },
        {
            "line": "        \"http://www.gov.cn/zhengce/zhengceku/2018-12/06/content_5346276.htm\",",
            "line_number": 6,
            "rule": "S35",
            "reason": "Url link | 0383e0fa1e"
        },
        {
            "line": "        \"http://www.gov.cn/zhengce/zhengceku/2019-03/22/content_5375877.htm\"",
            "line_number": 7,
            "rule": "S35",
            "reason": "Url link | 8ff6055cb1"
        }
    ],
    "calendar-service/src/dbmanager/dhuanglidatabase.cpp": [
        {
            "line": "const QString HolidayUpdateURLPrefix =\"https://cdn-nu-common.uniontech.com/deepin-calendar\";",
            "line_number": 21,
            "rule": "S35",
            "reason": "Url link | 0b2e847e1f"
        }
    ]
}

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengzhongyuan365-dev, lzwind

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dengzhongyuan365-dev
Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot
Copy link
Copy Markdown
Contributor

deepin-bot Bot commented Apr 22, 2025

This pr force merged! (status: unstable)

@deepin-bot deepin-bot Bot merged commit 65b152f into linuxdeepin:develop/snipe Apr 22, 2025
18 of 20 checks passed
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.

3 participants