Skip to content

Conversation

@Subhrasameerdash
Copy link
Contributor

Description:

Related issue(s):

Fixes #1628

Notes for reviewer:

Ran pytest tests/ via venv Python; integration tests failed with INVALID_SIGNATURE (missing/invalid credentials) and two existing TopicInfo unit tests failed.

==== 323 failed, 1881 passed, 3 skipped, 1 xfailed, 375 warnings, 9 errors in 1323.25s (0:22:03) =====

Checklist

@Subhrasameerdash Subhrasameerdash requested a review from a team as a code owner February 5, 2026 16:29
Copilot AI review requested due to automatic review settings February 5, 2026 16:29
@Subhrasameerdash Subhrasameerdash requested a review from a team as a code owner February 5, 2026 16:29
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

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
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Walkthrough

Added a constructor-style __repr__ to FileId with tests, updated CHANGELOG.md, and extended the GitHub recommendation bot script to add org-fallback searching, idempotent comment posting, and metadata for recommendation scope.

Changes

Cohort / File(s) Summary
FileId repr Implementation
src/hiero_sdk_python/file/file_id.py
Added __repr__() that returns FileId(shard=X, realm=Y, file=Z) (constructor-style) for clearer debugging output.
FileId Representation Tests
tests/unit/file_id_test.py
Added test_repr_representation() and test_repr_representation_with_checksum() to validate repr(...) for direct and checksum-aware construction.
Changelog Update
CHANGELOG.md
Updated Unreleased entries: documented FileId.__repr__, consolidated formatting and reordered bullets under Added/Changed/Fixed/Tests.
Bot: Issue Recommendation Script
.github/scripts/bot-next-issue-recommendation.js
Introduced explicit radix use, repo→org fallback search, new searchOrgIssues helper, added recommendationScope metadata, updated generateAndPostComment signature/behavior, added idempotent comment detection/posting and title/description sanitization/truncation.

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request
    participant Script as bot-next-issue-recommendation.js
    participant GH as GitHub API
    participant Search as Issue Search

    PR->>Script: receive PR event & parse body/linked issues
    Script->>GH: fetch linked issue details
    GH-->>Script: return issue metadata & labels
    Script->>Search: search repo for beginner/good-first issues
    Search-->>Script: return candidate issues
    alt no repo candidates
        Script->>Search: search org-wide beginner/good-first issues
        Search-->>Script: return org candidates
    end
    Script->>GH: check existing comments for idempotency marker
    GH-->>Script: existing comment present?
    alt not found
        Script->>GH: post generated recommendation comment (includes recommendationScope)
        GH-->>Script: comment posted
    else
        Script-->>PR: skip posting
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes significant out-of-scope changes: updates to CHANGELOG.md, modifications to .github/scripts/bot-next-issue-recommendation.js, and a merge conflict resolution commit unrelated to the FileId repr requirement. Remove or revert changes to bot-next-issue-recommendation.js and ensure only FileId repr changes, related tests, and a changelog entry remain in the PR.
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: add FileId repr (#1628)' accurately describes the primary change—adding a repr method to the FileId class.
Description check ✅ Passed The description relates to the changeset by explaining the repr implementation for FileId and linking to issue #1628, though it mentions unrelated test failures.
Linked Issues check ✅ Passed The PR implements the core requirement from issue #1628: a custom repr method for FileId returning constructor-style format, with checksum omitted when None, plus unit tests validating the behavior.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a custom __repr__ method to the FileId class to improve debugging output by providing a constructor-style representation instead of the default dataclass repr. The implementation conditionally includes the checksum field only when it's present (not None), making the output cleaner for the common case where no checksum is set.

Changes:

  • Added custom __repr__ method to FileId class that returns constructor-style format
  • Added unit test to verify the repr output for FileId without checksum
  • Updated CHANGELOG.md to document the enhancement

Reviewed changes

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

File Description
src/hiero_sdk_python/file/file_id.py Implements __repr__ method with conditional checksum handling
tests/unit/file_id_test.py Adds unit test for repr without checksum
CHANGELOG.md Documents the new feature (with some formatting cleanup)

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

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: 2

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1726   +/-   ##
=======================================
  Coverage   93.25%   93.25%           
=======================================
  Files         141      141           
  Lines        9061     9063    +2     
=======================================
+ Hits         8450     8452    +2     
  Misses        611      611           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @Subhrasameerdash
Requested changes as noted Manish recommended ignoring checksums for repr 👍
Will convert this to draft while youapply the change, and then mark this as ready to review when it is !
Thank you

@exploreriii exploreriii marked this pull request as draft February 5, 2026 19:13
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

hi @Subhrasameerdash
Could you please help us to review this PR?
Manish requested some changes, have you applied them?
Could you please resolve the other conversations?

Once it is ready for review, please mark is so
Thank you

@exploreriii exploreriii added the status: needs developer revision PR has requested changes that the developer needs to implement label Feb 6, 2026
@Subhrasameerdash Subhrasameerdash marked this pull request as ready for review February 6, 2026 15:51
@Subhrasameerdash
Copy link
Contributor Author

Hii @exploreriii I have made the changes requested by @manishdait

Sorry for the delay

@exploreriii exploreriii added status: needs maintainer review PR needs a review from the maintainer team and removed status: needs developer revision PR has requested changes that the developer needs to implement labels Feb 6, 2026
@Subhrasameerdash
Copy link
Contributor Author

Subhrasameerdash commented Feb 6, 2026

Hii @manishdait can you help me with this DCO error

@exploreriii
Copy link
Contributor

exploreriii commented Feb 6, 2026

I can help you, thanks for asking!
One of your commits is not -s signed

Easiest option:
soft revert your commits:
git reset --soft HEAD~9
recommit:
git commit -S -s -m "chore: add file id repr"
then push:
git push --force

else:
To add your Signed-off-by line to every commit in this branch:

Ensure you have a local copy of your branch by checking out the pull request locally via command line.
In your local branch, run: git rebase HEAD~9 --signoff
Force push your changes to overwrite the branch: git push --force-with-lease origin chore/fileid-repr-1628

@exploreriii exploreriii added status: needs developer revision PR has requested changes that the developer needs to implement and removed status: needs maintainer review PR needs a review from the maintainer team labels Feb 6, 2026
@exploreriii exploreriii marked this pull request as draft February 6, 2026 23:59
@exploreriii
Copy link
Contributor

I see your commits are now signed, well done!
The merge conflcit will be a little tricker as it involves two files -
If you want me to resolve it for you, please let me know

@exploreriii exploreriii marked this pull request as ready for review February 7, 2026 15:46
@exploreriii exploreriii removed the status: needs developer revision PR has requested changes that the developer needs to implement label Feb 7, 2026
@tech0priyanshu
Copy link
Contributor

fix DCO and LGTM

@tech0priyanshu tech0priyanshu added status: needs developer revision PR has requested changes that the developer needs to implement and removed status: needs triage review PR needs a review from the triage team labels Feb 7, 2026
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @Subhrasameerdash
Your changelog is fine but please can you please try to resign
I think you had them all resigned, but you lost it again
Sometimes this happens when you do merges, so I would not recommend merging from or to main

https://github.com/hiero-ledger/hiero-sdk-python/pull/1726/checks?check_run_id=62850862253

Please soft revert, resign and force push
git reset --soft HEAD~12
git -S -s -m "feat: add file id repr"
git push --force

This should resolve the signing issues

Once that is done, you can resolve the merge conflict issues, probably using the online editor

Good luck and appreicate your patience

@exploreriii exploreriii marked this pull request as draft February 7, 2026 21:08
Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
Signed-off-by: Subhra Sameer Dash <170787407+Subhrasameerdash@users.noreply.github.com>
@Subhrasameerdash Subhrasameerdash marked this pull request as ready for review February 8, 2026 02:58
@Subhrasameerdash Subhrasameerdash requested a review from a team as a code owner February 8, 2026 02:58
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @Subhrasameerdash
Note you have content here from two PRs, please keep this PR to just solve the file id repr issue 👍
https://github.com/hiero-ledger/hiero-sdk-python/pull/1726/commits

@exploreriii exploreriii marked this pull request as draft February 8, 2026 02:59
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: 7

Comment on lines +55 to +59
def test_repr_representation_with_checksum():
"""Test repr representation of FileId with checksum."""
file_id = FileId.from_string("0.0.1-dfkxr")

assert repr(file_id) == "FileId(shard=0, realm=0, file=1)"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Test asserts the wrong expected output — checksum should be included in repr.

Issue #1628 requires __repr__ to include checksum when it is not None. FileId.from_string("0.0.1-dfkxr") sets checksum="dfkxr", so the expected repr should include it. This test currently validates the buggy behavior and will need to be updated alongside the __repr__ fix.

Proposed fix (aligns with the __repr__ fix)
 def test_repr_representation_with_checksum():
     """Test repr representation of FileId with checksum."""
     file_id = FileId.from_string("0.0.1-dfkxr")
 
-    assert repr(file_id) == "FileId(shard=0, realm=0, file=1)"
+    assert repr(file_id) == "FileId(shard=0, realm=0, file=1, checksum='dfkxr')", \
+        "repr should include checksum when checksum is not None"

@Subhrasameerdash
Copy link
Contributor Author

Hi @Subhrasameerdash Note you have content here from two PRs, please keep this PR to just solve the file id repr issue 👍 https://github.com/hiero-ledger/hiero-sdk-python/pull/1726/commits

I am sorry I couldn't follow completely what you meant.

In my commits, there are two commits. So you want me to revert the previous commit and keep the current one

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

You can see here you have added changes to github/scripts
https://github.com/hiero-ledger/hiero-sdk-python/pull/1726/changes

@exploreriii
Copy link
Contributor

I'm not sure how you did that :)
It looks like your previous commit had so many changes, if that's the case, it could be due to your fork being out of date with the main?

Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
@Subhrasameerdash
Copy link
Contributor Author

Subhrasameerdash commented Feb 8, 2026

I'm not sure how you did that :) It looks like your previous commit had so many changes, if that's the case, it could be due to your fork being out of date with the main?

Should I update my fork and commit the changes?
Also should I make all the changes recommended by coderabbit as is?

@Subhrasameerdash Subhrasameerdash marked this pull request as ready for review February 8, 2026 03:44
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: 2

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

The easiest approach is probably to visit here
click sync, then pull those changes to your github desktop
https://github.com/Subhrasameerdash/hiero-sdk-python
(we have a guide that explains how to do that in rebasing.md)

Then create a fresh branch, copy in the changes you want and create a new PR

You can see you are 67 commits behind the main
To avoid this regularly rebase, following our guide

Sorry about this and thanks for asking 👍

Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
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: 2

@Subhrasameerdash
Copy link
Contributor Author

Hii @exploreriii should i add the changes mentioned by the @coderabbitai ?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch all review comments made by coderabbitai on PR `#1726`
gh pr view 1726 --repo hiero-ledger/hiero-sdk-python --json reviews,comments --jq '.reviews[] | select(.author.login == "coderabbitai[bot]") | {state: .state, body: .body, submittedAt: .submittedAt}'

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Also fetch review thread comments from coderabbitai
gh api repos/hiero-ledger/hiero-sdk-python/pulls/1726/comments --jq '.[] | select(.user.login == "coderabbitai[bot]") | {path: .path, line: .line, body: .body, created_at: .created_at}'

Length of output: 22525


@Subhrasameerdash, great question! Let me help clarify which CodeRabbit suggestions you should apply.

⚠️ Important: PR Scope Issue

First, as @exploreriii mentioned, your PR currently contains changes from two different PRs. The file .github/scripts/bot-next-issue-recommendation.js should NOT be in this PR. This PR should only contain changes for the FileId __repr__ implementation (issue #1628). You'll need to remove those unrelated changes.

🐛 Critical Bug in Your Code

CodeRabbit found a major bug in your __repr__ implementation that you must fix:

Issue: Your __repr__ always omits the checksum, but issue #1628 requires: "include checksum only when checksum is not None"

Current code (wrong):

return f"FileId(shard={self.shard}, realm={self.realm}, file={self.file})"

Should be:

base = f"FileId(shard={self.shard}, realm={self.realm}, file={self.file}"
if self.checksum is not None:
    base += f", checksum='{self.checksum}'"
return base + ")"

✅ Changes You Should Apply for FileId PR

For this PR (FileId repr only), apply these CodeRabbit suggestions:

  1. Fix the __repr__ method in src/hiero_sdk_python/file/file_id.py (CRITICAL - see above)

  2. Update the test in tests/unit/file_id_test.py:

    • Fix test_repr_representation_with_checksum to expect checksum in output
    • Add assertion messages for better debugging
    • The checksum test should expect: "FileId(shard=0, realm=0, file=1, checksum='dfkxr')"
  3. Clean up CHANGELOG.md:

    • Remove duplicate entries
    • Remove the ContractId entry (line 38) - that's for a different PR/issue
    • Consolidate duplicate "Added" sections
    • Keep only the FileId entry

❌ Don't Apply These (Out of Scope)

  • All suggestions for .github/scripts/bot-next-issue-recommendation.js - this file should be removed from your PR entirely
  • Suggestions for tests/integration/account_id_population_e2e_test.py - not part of this PR

🎯 Recommended Next Steps

  1. Update your fork with the latest main branch
  2. Create a clean branch with only the FileId changes
  3. Apply the three changes listed above (fix __repr__, update tests, clean CHANGELOG)
  4. Make sure your commits are signed with -s flag
  5. Push the clean changes

Would you like help with any of these steps?

@exploreriii
Copy link
Contributor

Hi, not if it is not relevant to the issue description please!

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

This PR cannot be merged

It has changes to .github/scripts/bot-next-issue-recommendation.js

https://github.com/hiero-ledger/hiero-sdk-python/pull/1726/changes

I will close this PR
Please open a fresh branch, from an updated copy of main, then copy in just the changes to file_id.py and file_id_test.py, and its changelog entry

@exploreriii exploreriii closed this Feb 8, 2026
@Subhrasameerdash Subhrasameerdash deleted the chore/fileid-repr-1628 branch February 9, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs developer revision PR has requested changes that the developer needs to implement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Beginner]: Implement __repr__ Method for FileId Class

4 participants