Skip to content

chore: speed up pr-check-test workflow runtime - #1895

Merged
manishdait merged 4 commits into
hiero-ledger:mainfrom
adityagiri3600:optimize-pr-check-test
Mar 12, 2026
Merged

chore: speed up pr-check-test workflow runtime#1895
manishdait merged 4 commits into
hiero-ledger:mainfrom
adityagiri3600:optimize-pr-check-test

Conversation

@adityagiri3600

Copy link
Copy Markdown
Contributor

Description:
Optimize PR CI runtime in .github/workflows/pr-check-test.yml

  • Run integration tests only on python 3.12 and parallelize it into 2 jobs
  • Unit tests run on full python matrix [3.10, 3.11, 3.12, 3.13, 3.14]
  • Add test-summary job to aggregate outcomes and fail workflow if any of the test job fails
  • Add paths-ignore for docs/markdown-only changes to avoid unnecessary runs

**Related issue(s)*:
Fixes #1878

Notes for reviewer:

Checklist

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

@coderabbitai

coderabbitai Bot commented Mar 1, 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

Split CI into three jobs: a 2-shard integration-tests job (fixed Python 3.12), a unit-tests job (Python 3.10–3.14 matrix), and a test-summary job. Added proto generation, Hiero Solo init, shard-aware test discovery/execution, exit-code propagation, and improved failure logging/aggregation.

Changes

Cohort / File(s) Summary
CI workflow
.github/workflows/pr-check-test.yml
Replaced build-and-test with integration-tests (2-way shard, Python 3.12), added unit-tests (Python 3.10–3.14 matrix) and test-summary. Added proto generation and Hiero Solo preparation, shard-aware test discovery/partitioning, SHARD_INDEX/SHARD_TOTAL handling, exit-code export via GITHUB_OUTPUT, enhanced failure logging, and dedicated fail steps.
Changelog
CHANGELOG.md
Added entry describing CI optimization: sharded integration tests and unit-test Python matrix.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer/PR
    participant GH as GitHub Actions Runner
    participant Proto as Proto Generation
    participant Solo as Hiero Solo Prep
    participant TestsI as Integration Tests (Shard)
    participant TestsU as Unit Tests (Matrix)
    participant Summary as Test-Summary Job

    Dev->>GH: push PR / trigger workflow
    GH->>Proto: generate proto files
    GH->>Solo: initialize Hiero Solo
    GH->>TestsI: start integration-tests (set SHARD_INDEX/SHARD_TOTAL)
    TestsI->>GH: discover tests, partition by shard
    TestsI->>GH: run shard subset, record exit_code & ERROR logs
    GH->>TestsU: run unit-tests matrix (3.10–3.14), generate protos per job
    TestsU->>GH: run tests, record exit_code & ERROR logs
    GH->>Summary: test-summary (needs: integration-tests, unit-tests) collects outputs
    Summary->>Dev: post aggregated test summary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: speed up pr-check-test workflow runtime' accurately describes the main change—optimizing workflow performance by parallelizing integration tests and restructuring the test jobs.
Description check ✅ Passed The description is detailed and directly related to the changeset, explaining the specific optimizations made including test parallelization, Python matrix changes, and workflow restructuring.
Linked Issues check ✅ Passed The PR successfully addresses all major requirements from issue #1878: separating integration and unit tests, running integration tests on Python 3.12 only, full matrix for units, parallelizing with sharding, adding test-summary job, and including a changelog entry.
Out of Scope Changes check ✅ Passed The PR makes targeted changes to .github/workflows/pr-check-test.yml and CHANGELOG.md that are all directly aligned with optimizing the workflow as specified in #1878; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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

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

@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

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ee286c and 5cf77c2.

📒 Files selected for processing (2)
  • .github/workflows/pr-check-test.yml
  • CHANGELOG.md

Comment thread .github/workflows/pr-check-test.yml Outdated
Comment thread .github/workflows/pr-check-test.yml Outdated
@exploreriii
exploreriii requested a review from manishdait March 1, 2026 09:36
Comment thread .github/workflows/pr-check-test.yml
Comment thread .github/workflows/pr-check-test.yml Outdated
Comment thread .github/workflows/pr-check-test.yml Outdated
Comment thread .github/workflows/pr-check-test.yml Outdated
Comment thread .github/workflows/pr-check-test.yml Outdated
@adityagiri3600
adityagiri3600 force-pushed the optimize-pr-check-test branch from 5cf77c2 to 08f40bf Compare March 1, 2026 12:14

@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.

♻️ Duplicate comments (1)
.github/workflows/pr-check-test.yml (1)

16-18: ⚠️ Potential issue | 🟠 Major

Scope GITHUB_TOKEN permissions to least privilege.

actions: write is broader than needed for this workflow and increases risk on trusted-branch runs. No step in this workflow requires writing Actions resources.

🔧 Suggested fix
 permissions:
   contents: read
-  actions: write

As per coding guidelines, “permissions: must be explicitly declared and scoped to the minimum needed.”


ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5cf77c2 and 08f40bf.

📒 Files selected for processing (2)
  • .github/workflows/pr-check-test.yml
  • CHANGELOG.md

@adityagiri3600

adityagiri3600 commented Mar 1, 2026

Copy link
Copy Markdown
Contributor Author

@MonaaEid MonaaEid 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 @adityagiri3600, nice work overall. I do have some concerns about certain points
I think the summary is misleading here...the job is being treated as a success when it should actually fail
+the project isn't installed for tests.. what do you think?
Image

Image

Comment thread .github/workflows/pr-check-test.yml
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown

[commit-verification-bot]
Hi, this is VerificationBot.
Your pull request cannot be merged as it has 1 unverified commit(s):

  • e83a8fc chore(ci): fix unit workflow result handling

View your commit verification status: Commits Tab.

To achieve verified status, please read:

Remember, you require a GPG key and each commit must be signed with:
git commit -S -s -m "Your message here"

Thank you for contributing!

From the Hiero Python SDK Team

@adityagiri3600
adityagiri3600 force-pushed the optimize-pr-check-test branch from e83a8fc to 309231d Compare March 2, 2026 03:50
@adityagiri3600

Copy link
Copy Markdown
Contributor Author

good catch @MonaaEid , thanks @manishdait for finding the fix, fixing it now

@adityagiri3600
adityagiri3600 marked this pull request as ready for review March 2, 2026 04:28
@adityagiri3600

Copy link
Copy Markdown
Contributor Author

fixed

@adityagiri3600
adityagiri3600 requested a review from MonaaEid March 2, 2026 04:36
@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown

Hi, this is MergeConflictBot.
Your pull request cannot be merged because it contains merge conflicts.

Please resolve these conflicts locally and push the changes.

Quick Fix for CHANGELOG.md Conflicts

If your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:

  1. Click on the "Resolve conflicts" button in the PR
  2. Accept both changes (keep both changelog entries)
  3. Click "Mark as resolved"
  4. Commit the merge

For all other merge conflicts, please read:

Thank you for contributing!

@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: 1


ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 309231d and a553845.

📒 Files selected for processing (2)
  • .github/workflows/pr-check-test.yml
  • CHANGELOG.md

Comment thread .github/workflows/pr-check-test.yml

@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: 1

♻️ Duplicate comments (1)
.github/workflows/pr-check-test.yml (1)

16-18: ⚠️ Potential issue | 🟠 Major

Scope GITHUB_TOKEN to least privilege; actions: write appears unnecessary.

This workflow does not show a write operation against Actions APIs, so retaining actions: write broadens risk on trusted-branch runs without clear need.

🔧 Proposed fix
 permissions:
   contents: read
-  actions: write

As per coding guidelines, “permissions: must be explicitly declared and scoped to the minimum needed. Flag over-permissioned or under-permissioned workflows, and any reliance on broad default permissions.”


ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a553845 and 214d151.

📒 Files selected for processing (1)
  • .github/workflows/pr-check-test.yml

Comment thread .github/workflows/pr-check-test.yml
@exploreriii exploreriii added reviewer: maintainer PR needs a review from the maintainer team and removed status: needs developer revision labels Mar 3, 2026
@exploreriii
exploreriii marked this pull request as draft March 10, 2026 11:54
@adityagiri3600

Copy link
Copy Markdown
Contributor Author

I think we could be even more aggressive and limit this to only run once all the other checks succeed

do you want me to do this here? or later in a separate PR?

@exploreriii

Copy link
Copy Markdown
Contributor

separate probably

Signed-off-by: Aditya Giri <74224708+adityagiri3600@users.noreply.github.com>
@adityagiri3600
adityagiri3600 marked this pull request as ready for review March 10, 2026 15:23
@exploreriii
exploreriii requested a review from MonaaEid March 10, 2026 17:46
@codecov

codecov Bot commented Mar 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1895   +/-   ##
=======================================
  Coverage   93.53%   93.53%           
=======================================
  Files         141      141           
  Lines        9146     9146           
=======================================
  Hits         8555     8555           
  Misses        591      591           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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.

This looks good to me, can you run some tests please and send us the results

@exploreriii
exploreriii marked this pull request as draft March 10, 2026 19:08
@adityagiri3600

Copy link
Copy Markdown
Contributor Author

all good

@adityagiri3600
adityagiri3600 marked this pull request as ready for review March 11, 2026 01:50

@MonaaEid MonaaEid 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.

Well done!

@github-actions

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

@exploreriii exploreriii added reviewer: maintainer PR needs a review from the maintainer team and removed status: needs developer testing labels Mar 11, 2026
@exploreriii

Copy link
Copy Markdown
Contributor

Request review @manishdait please

@manishdait
manishdait merged commit a4d9a8c into hiero-ledger:main Mar 12, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewer: maintainer PR needs a review from the maintainer team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Advanced]: Optimize .github/workflows/pr-check-test.yml to run in fewer minutes and calls

6 participants