Skip to content

Fix/dynamic call reminder time#2213

Merged
AntonioCeppellini merged 16 commits into
hiero-ledger:mainfrom
ManmathX:fix/dynamic-call-reminder-time
May 7, 2026
Merged

Fix/dynamic call reminder time#2213
AntonioCeppellini merged 16 commits into
hiero-ledger:mainfrom
ManmathX:fix/dynamic-call-reminder-time

Conversation

@ManmathX

@ManmathX ManmathX commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Description:
Updates the GitHub cron "call reminder" bots to generate a dynamic "time until meeting" message at runtime (to account for delayed cron execution), replacing the hardcoded "approximately 4 hours" message.

Changes include:

  • Added MEETING_HOUR as a configurable, validated top-level variable in both cron-calls-community.sh and cron-calls-office-hours.sh.
  • Extracted the time-remaining computation logic into a shared helper script (.github/scripts/compute-time-until-meeting.py) to prevent duplication and ensure consistency. The logic correctly calculates hours and minutes remaining using math.ceil for accurate rounding.
  • Updated the posted reminder messages to dynamically display the computed time remaining and the configured meeting time.
  • Added a bash-based test script (.github/scripts/test-cron-calls-time-computation.sh) containing 10 test cases to verify the time computation logic (including edge cases, rounding, and pluralization).

Related issue(s): #2209

Fixes #2209

Notes for reviewer:

  • The Python helper supports an optional MOCK_TIME argument specifically designed for testing, enabling precise validation down to the second.
  • All 11 test cases in test-cron-calls-time-computation.sh are passing successfully.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Copilot AI review requested due to automatic review settings April 30, 2026 07:07
@ManmathX
ManmathX requested review from a team as code owners April 30, 2026 07:07
@codacy-production

codacy-production Bot commented Apr 30, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 53 complexity

Metric Results
Complexity 53

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR implements dynamic time-remaining calculations for community call and office hour reminder bots. A new Python utility computes the actual time remaining until a meeting, formatted as human-readable hours and minutes. Two bash scripts now read a configurable MEETING_HOUR parameter, invoke this utility, and conditionally post reminders with precision timing instead of approximate hardcoded durations.

Changes

Dynamic Meeting Reminders

Layer / File(s) Summary
Core Utility
.github/scripts/utils/compute-time-until-meeting.py
New module that computes time remaining until a meeting given a date and hour. Accepts MEETING_DATE, MEETING_HOUR, and optional MOCK_TIME; constructs a UTC datetime, compares to current time, and returns either "has already started" or a formatted human-readable duration string (e.g., "3 hours and 7 minutes") with singular/plural handling and ceiling rounding.
Bash Script Integration
.github/scripts/cron-calls-community.sh
.github/scripts/cron-calls-office-hours.sh
Both scripts now read MEETING_HOUR from environment (default 14) with validation (0–23 range), compute TIME_UNTIL_MEETING by calling the Python utility, conditionally exit early if the meeting has already started, and update comment templates to interpolate dynamic ${TIME_PHRASE} and ${MEETING_HOUR}:00 UTC in place of hardcoded "4 hours" and "14:00 UTC".
Tests & Validation
.github/scripts/tests/test_compute_time_until_meeting.py
New comprehensive test suite that validates core duration computation across standard and edge cases (rounding, singular/plural, UTC boundaries), tests "has already started" detection, verifies CLI argument handling and error reporting, and exercises helper functions for duration formatting, pluralization, and mock time parsing.

Sequence Diagram

sequenceDiagram
    participant GA as GitHub Actions<br/>(Scheduler)
    participant Bash as Bash Script<br/>(cron-calls-*.sh)
    participant Util as Python Utility<br/>(compute-time-until-meeting.py)
    participant API as GitHub API<br/>(Post Comment)
    
    GA->>Bash: Trigger on schedule
    Bash->>Bash: Read MEETING_HOUR from env<br/>Validate integer [0,23]
    Bash->>Util: Call with TODAY & MEETING_HOUR
    Util->>Util: Build UTC meeting datetime<br/>Compare to current UTC time
    alt Meeting has already started
        Util-->>Bash: Return "has already started"
        Bash->>Bash: Exit without posting
    else Meeting is in future
        Util->>Util: Compute remaining hours/minutes<br/>Format as human-readable string
        Util-->>Bash: Return e.g. "3 hours and 7 minutes"
        Bash->>Bash: Set TIME_PHRASE variable<br/>Build comment body with<br/>dynamic timing & meeting hour
        Bash->>API: POST comment with dynamic message
        API-->>Bash: Success
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix/dynamic call reminder time' clearly summarizes the main change: replacing hardcoded reminder times with dynamic runtime-computed times in call reminder bots.
Description check ✅ Passed The description comprehensively explains the changes, including configurable MEETING_HOUR, extracted helper script, dynamic messages, and testing; it is clearly related to the changeset.
Linked Issues check ✅ Passed The PR successfully implements all key requirements from issue #2209: dynamic time-until-meeting computation replacing hardcoded 'approx 4 hours', configurable MEETING_HOUR variable, extracted shared helper script, updated reminder messages, and comprehensive test coverage.
Out of Scope Changes check ✅ Passed All changes are directly related to the issue objectives: modifications to cron scripts, creation of compute-time-until-meeting helper, and addition of comprehensive tests; no unrelated changes detected.

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

📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #2209

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@ManmathX
ManmathX force-pushed the fix/dynamic-call-reminder-time branch from e502a75 to e4d0816 Compare April 30, 2026 07:10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 539a497d-3c4d-4d35-9328-5ff027e8b86f

📥 Commits

Reviewing files that changed from the base of the PR and between 2f646a8 and e502a75.

📒 Files selected for processing (4)
  • .github/scripts/cron-calls-community.sh
  • .github/scripts/cron-calls-office-hours.sh
  • .github/scripts/test-cron-calls-time-computation.sh
  • src/hiero_sdk_python/query/account_balance_query.py

Comment thread .github/scripts/cron-calls-community.sh Outdated
Comment thread .github/scripts/cron-calls-office-hours.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the GitHub cron “call reminder” bots to generate a dynamic “time until meeting” message at runtime (to account for delayed cron execution), and adds a small script to exercise the time computation logic.

Changes:

  • Add a configurable MEETING_HOUR and compute a human-readable TIME_UNTIL_MEETING in both reminder bot scripts.
  • Update the posted reminder messages to include the computed time remaining and the configured meeting time.
  • Add a bash-based test script for the time computation logic.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/hiero_sdk_python/query/account_balance_query.py Adds a return type hint to _is_payment_required() (appears unrelated to the PR’s stated goal).
.github/scripts/cron-calls-office-hours.sh Computes and injects dynamic “time until meeting” based on the workflow run time; makes meeting hour configurable.
.github/scripts/cron-calls-community.sh Same dynamic time computation and configurable meeting hour as office-hours script.
.github/scripts/test-cron-calls-time-computation.sh Adds a manual test harness for validating the time-until-meeting output formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/scripts/cron-calls-community.sh Outdated
Comment thread .github/scripts/cron-calls-office-hours.sh Outdated
Comment thread .github/scripts/cron-calls-office-hours.sh Outdated
Comment thread .github/scripts/test-cron-calls-time-computation.sh Outdated
Comment thread src/hiero_sdk_python/query/account_balance_query.py
Comment thread .github/scripts/cron-calls-community.sh Outdated
@ManmathX
ManmathX force-pushed the fix/dynamic-call-reminder-time branch 6 times, most recently from f925559 to bdaa864 Compare April 30, 2026 07:35

@exploreriii exploreriii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking good please note organisation :)

Comment thread .github/scripts/utils/compute-time-until-meeting.py
Comment thread .github/scripts/tests/test-cron-calls-time-computation.sh Outdated
@exploreriii
exploreriii marked this pull request as draft April 30, 2026 09:59
Signed-off-by: ManmathX <manmath2006n@gmail.com>
@ManmathX
ManmathX force-pushed the fix/dynamic-call-reminder-time branch from bdaa864 to 7dd540e Compare April 30, 2026 12:21
@ManmathX

Copy link
Copy Markdown
Contributor Author

@exploreriii Ma’am, could you please guide me on where these files should be placed? I’ve also created a utils folder within the scripts directory, as it could be helpful for future use—please let me know if that works or if you’d prefer a different structure.

@ManmathX
ManmathX marked this pull request as ready for review April 30, 2026 12:26
@exploreriii exploreriii added reviewer: junior committer request review from junior committers with triage permissions reviewer: community pull requests looking for community reviews step: 1st 1st stage of the review approval process labels Apr 30, 2026

@darshit2308 darshit2308 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @ManmathX, thanks for putting this together! The dynamic time computation is a really nice addition for the community and office hour calls.

I just went through the code and posted few inline comments. I found a couple of edge cases we should address before merging, specifically around how the Python script handles UTC day boundaries (if the cron runs late in the day for a meeting the next calendar day) and a small UX formatting tweak for when meetings have already started.

Let me know if you have any questions about the suggestions

Comment thread .github/scripts/utils/compute-time-until-meeting.py Outdated
Comment thread .github/scripts/utils/compute-time-until-meeting.py
@exploreriii exploreriii added step: 2nd second stage of the review approval process reviewer: write requires a review with write permissions and removed reviewer: community pull requests looking for community reviews labels May 5, 2026
manishdait
manishdait previously approved these changes May 5, 2026
@github-actions github-actions Bot added lang: bash Uses Bash programming language scope: CI/CD involves continuous integration or delivery skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues labels May 5, 2026
@exploreriii

Copy link
Copy Markdown
Contributor

Hi @ManmathX please apply the formatting as per our docs, then update branch to merge.
Thanks

Signed-off-by: ManmathX <manmath2006n@gmail.com>
@ManmathX
ManmathX dismissed stale reviews from manishdait and exploreriii via 844aa66 May 5, 2026 13:29
@ManmathX

ManmathX commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

Hey @exploreriii, done! I ran ruff format and ruff check locally — everything's clean now. Also fixed all the Codacy stuff (isort, future annotations, subprocess check param)

All commits are signed with both -S and -s as per the workflow docs. Should be good to go — let me know if anything else needs adjusting!

@exploreriii

Copy link
Copy Markdown
Contributor

cc @hiero-ledger/hiero-sdk-python-committers

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Hello, this is the OfficeHourBot.

This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC).

This session provides an opportunity to ask questions regarding this Pull Request.

Details:

Disclaimer: This is an automated reminder. Please verify the schedule here for any changes.

From,
The Python SDK Team

@codacy-production

codacy-production Bot commented May 6, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 53 complexity

Metric Results
Complexity 53

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@aceppaluni

Copy link
Copy Markdown
Contributor

@ManmathX This is great work!. Please be sure to update your branch.

Thank you!

@aceppaluni aceppaluni added the step: merge ready PR is ready and waiting to merge label May 6, 2026
@AntonioCeppellini

Copy link
Copy Markdown
Member

most approved PR 🤣 5 approvals is wild HAHAHA great work @ManmathX thank you for your contribution :D

@AntonioCeppellini
AntonioCeppellini merged commit 97367b2 into hiero-ledger:main May 7, 2026
13 checks passed
NssGourav pushed a commit to NssGourav/hiero-sdk-python that referenced this pull request May 14, 2026
Signed-off-by: ManmathX <manmath2006n@gmail.com>
manishdait pushed a commit to manishdait/hiero-sdk-python that referenced this pull request May 18, 2026
Signed-off-by: ManmathX <manmath2006n@gmail.com>
@exploreriii exploreriii added this to the v0.2.7 milestone May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: bash Uses Bash programming language reviewer: write requires a review with write permissions scope: CI/CD involves continuous integration or delivery skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues step: merge ready PR is ready and waiting to merge step: 2nd second stage of the review approval process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor the community call and office hour bots to post dynamic messages based on time posted

9 participants