-
Notifications
You must be signed in to change notification settings - Fork 190
chore: add FileId repr (#1628) #1726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add FileId repr (#1628) #1726
Conversation
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. Quick Fix for CHANGELOG.md ConflictsIf your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:
For all other merge conflicts, please read: Thank you for contributing! |
WalkthroughAdded a constructor-style Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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 toFileIdclass 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.
There was a problem hiding this 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 Report✅ All modified and coverable lines are covered by tests. @@ 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:
|
exploreriii
left a comment
There was a problem hiding this 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
There was a problem hiding this 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
|
Hii @exploreriii I have made the changes requested by @manishdait Sorry for the delay |
|
Hii @manishdait can you help me with this DCO error |
|
I can help you, thanks for asking! Easiest option: else: Ensure you have a local copy of your branch by checking out the pull request locally via command line. |
2143844 to
99d83ae
Compare
|
I see your commits are now signed, well done! |
|
fix DCO and LGTM |
exploreriii
left a comment
There was a problem hiding this 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
Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
3db152a to
91247ac
Compare
Signed-off-by: Subhra Sameer Dash <170787407+Subhrasameerdash@users.noreply.github.com>
exploreriii
left a comment
There was a problem hiding this 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
There was a problem hiding this 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
| 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)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"
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 |
exploreriii
left a comment
There was a problem hiding this 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
|
I'm not sure how you did that :) |
Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
Should I update my fork and commit the changes? |
There was a problem hiding this 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
exploreriii
left a comment
There was a problem hiding this 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>
There was a problem hiding this 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
|
Hii @exploreriii should i add the changes mentioned by the @coderabbitai ? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 0 🏁 Script executed: Length of output: 22525
|
|
Hi, not if it is not relevant to the issue description please! |
exploreriii
left a comment
There was a problem hiding this 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
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.
Checklist