fix: updated Fileservice.cc to handle mAdminKeys as value type#1276
fix: updated Fileservice.cc to handle mAdminKeys as value type#1276ParasSalonia wants to merge 7 commits intohiero-ledger:mainfrom
Conversation
Signed-off-by: ParasSalonia <parassalonia22@gmail.com>
|
Hey @ParasSalonia 👋 thanks for the PR! This comment updates automatically as you push changes -- think of it as your PR's live scoreboard! PR Checks✅ DCO Sign-off -- All commits have valid sign-offs. Nice work! ✅ GPG Signature -- All commits have verified GPG signatures. Locked and loaded! ✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing! ✅ Issue Link -- Linked to #1272 (assigned to you). 🎉 All checks passed! Your PR is ready for review. Great job! |
rwalworth
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround on this @ParasSalonia! The fix is correct - mAdminKeys is a KeyList value type in FileInfo, so the pointer/optional semantics needed to go, and toBytes() is the right call here.
One small thing: the clang-format lint check is failing because the replacement block isn't indented to match the surrounding code. Once that's fixed, we'll be good to merge!
Signed-off-by: Paras Salonia <parassalonia22@gmail.com>
rwalworth
left a comment
There was a problem hiding this comment.
Thanks for addressing the review feedback quickly, @ParasSalonia! The second commit fixes the brace positions, but the body of the if block still isn't indented to match the surrounding code. The clang-format check will continue to fail until this is resolved. Once the indentation is corrected the fix looks good and we can merge.
Signed-off-by: Paras Salonia <parassalonia22@gmail.com>
|
Hi @rwalworth, I have made the requested changes. Could you please review them and let me know if any further improvements are needed? |
rwalworth
left a comment
There was a problem hiding this comment.
The formatting is still incorrect. Please run clang-format-17 -i src/tck/src/file/FileService.cc to fix.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
TIP This summary will be updated as you push new changes. Give us feedback
Signed-off-by: ParasSalonia <parassalonia22@gmail.com>
54f913d to
5b68547
Compare
|
Hi @rwalworth, I’ve fixed the GPG signing issue and updated the commits. Please let me know if everything looks good now. |
rwalworth
left a comment
There was a problem hiding this comment.
The clang-format check is failing again, but this time for a different reason. The spacing changes you made in the return blocks throughout the file (e.g., { "status", ... } with spaces inside the braces) are being rejected by the project's clang-format config. Those changes weren't needed - the original formatting in those blocks was already correct.
The root cause is likely that you ran clang-format-17 -i from a subdirectory rather than the repository root. When run from outside the root, clang-format can't find the project's .clang-format file and falls back to a different style.
Please run:
clang-format-17 -i src/tck/src/file/FileService.ccfrom the repository root (the directory containing .clang-format). This should revert the spacing in those return blocks back to the original style while keeping the actual fix in getFileInfo. Once that's done we're good to go!
|
|
||
| return { | ||
| {"status", | ||
| { "status", |
There was a problem hiding this comment.
issue (blocking): The space inside the braces here ({ "status",) is causing the clang-format check to fail. This change wasn't needed - the original {"status", was already correctly formatted per the project's .clang-format config.
The same problem exists in the other return blocks throughout the file (lines 120, 142, 172, 259).
Please run clang-format-17 -i src/tck/src/file/FileService.cc from the repository root (the directory containing .clang-format). If run from a subdirectory, clang-format won't find the project config and will apply a different style. Running from the root will restore the original formatting in these blocks while keeping the actual fix in getFileInfo.
Signed-off-by: ParasSalonia <parassalonia22@gmail.com>
10378e0 to
90a86c6
Compare
|
Thanks! I’ve re-run |
rwalworth
left a comment
There was a problem hiding this comment.
Sorry @ParasSalonia, the lint check is still failing, and looking at the diff the spaces inside the braces ({ "status", ... }) are still there. I verified locally: when clang-format runs on the current main file from the repo root it makes zero changes - so the original {"status", ...} format (without spaces) is correct, and those spacing changes shouldn't be in the PR at all.
The functional change in getFileInfo is the only thing that should differ from main. Here are some things to try to narrow down why clang-format is producing different output on your end:
1. Verify clang-format is actually reading the project config:
clang-format --dump-config src/tck/src/file/FileService.cc | grep -E "BasedOnStyle|Cpp11BracedListStyle"The first line should show BasedOnStyle: "". If it shows Google, LLVM, or anything else, clang-format isn't finding .clang-format.
2. Check for a stray .clang-format in a subdirectory (would shadow the root one):
find . -name ".clang-format" 2>/dev/nullShould print exactly one result at the repo root.
3. Check for a home-directory config:
ls ~/.clang-format 2>/dev/null && echo "Found — this may be overriding the project config"4. Verify your version - must be 17.x:
clang-format --versionOlder versions can produce different results with the same config.
5. Disable editor "Format on Save" - if VS Code or another editor is formatting the file on save, it may apply a different style and silently undo a correct clang-format run before you commit.
6. Confirm the fix directly:
clang-format src/tck/src/file/FileService.cc | diff src/tck/src/file/FileService.cc -No output = file is correctly formatted. Once that's clean, we're good to merge!
Updated FileService.cc to correctly handle
mAdminKeysas a value type instead of a pointer.Fixes [Beginner]: Build failure in TCK FileService.cc due to FileInfo mAdminKeys API change #1272