Skip to content

[coap] reorganize CoapBase::PendingRequests methods - #12577

Merged
jwhui merged 1 commit into
openthread:mainfrom
abtink:coap/pending-req-rearrange-methods
Feb 27, 2026
Merged

[coap] reorganize CoapBase::PendingRequests methods#12577
jwhui merged 1 commit into
openthread:mainfrom
abtink:coap/pending-req-rearrange-methods

Conversation

@abtink

@abtink abtink commented Feb 27, 2026

Copy link
Copy Markdown
Member

This commit moves all methods belonging to the CoapBase::PendingRequests class into a dedicated section in coap.cpp. Recent PRs #12421 and #12527 introduced this class and shifted many methods into it, but kept them in their original file locations to maintain reviewable git diffs. This update completes the reorganization for better code structure without any functional changes.

This commit moves all methods belonging to the `CoapBase::PendingRequests`
class into a dedicated section in `coap.cpp`. Recent PRs openthread#12421 and openthread#12527
introduced this class and shifted many methods into it, but kept them in
their original file locations to maintain reviewable `git` diffs. This
update completes the reorganization for better code structure without
any functional changes.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the coap.cpp file by relocating all methods associated with the CoapBase::PendingRequests class to a unified section. This change enhances the code's readability and maintainability by grouping related functionalities, without impacting the existing CoAP protocol operations.

Highlights

  • Code Reorganization: All methods belonging to the CoapBase::PendingRequests class have been consolidated into a single, dedicated section within coap.cpp for improved code structure.
  • No Functional Changes: This pull request focuses purely on code refactoring and does not introduce any functional changes or alter the behavior of the CoAP module.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/core/coap/coap.cpp
    • Moved CoapBase::PendingRequests::HandleTimer methods to a dedicated section.
    • Moved CoapBase::PendingRequests::FinalizeRequest methods to a dedicated section.
    • Moved CoapBase::PendingRequests::AddClone method to a dedicated section.
    • Moved CoapBase::PendingRequests::Remove method to a dedicated section.
    • Moved CoapBase::PendingRequests::RetransmitRequest method to a dedicated section.
    • Moved CoapBase::PendingRequests::FindRelatedRequest method to a dedicated section.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request reorganizes the methods of the CoapBase::PendingRequests class within src/core/coap/coap.cpp. All methods are now grouped together in a dedicated section, which improves code structure and readability. This is a pure refactoring with no functional changes. The changes are correct and I have no issues to report.

@github-actions

Copy link
Copy Markdown

Merging #12577 into main

name branch text data bss total
ot-cli-ftd 7c88bc7 482280 860 66532 549672
b599543 482280 860 66532 549672
+/- +0 +0 +0 +0
ot-ncp-ftd 7c88bc7 448164 764 61768 510696
b599543 448164 764 61768 510696
+/- +0 +0 +0 +0
ot-cli-mtd 7c88bc7 374712 764 50964 426440
b599543 374712 764 50964 426440
+/- +0 +0 +0 +0
ot-ncp-mtd 7c88bc7 355828 764 46232 402824
b599543 355828 764 46232 402824
+/- +0 +0 +0 +0
ot-cli-ftd-br 7c88bc7 598072 868 136588 735528
b599543 598072 868 136588 735528
+/- +0 +0 +0 +0
ot-rcp 7c88bc7 63328 568 20804 84700
b599543 63328 568 20804 84700
+/- +0 +0 +0 +0
Library files
name branch text data bss total
libopenthread-ftd.a 7c88bc7 249808 95 40311 290214
b599543 249808 95 40311 290214
+/- +0 +0 +0 +0
libopenthread-cli-ftd.a 7c88bc7 61710 0 8091 69801
b599543 61710 0 8091 69801
+/- +0 +0 +0 +0
libopenthread-ncp-ftd.a 7c88bc7 33581 0 5948 39529
b599543 33581 0 5948 39529
+/- +0 +0 +0 +0
libopenthread-mtd.a 7c88bc7 168341 0 24775 193116
b599543 168341 0 24775 193116
+/- +0 +0 +0 +0
libopenthread-cli-mtd.a 7c88bc7 41419 0 8059 49478
b599543 41419 0 8059 49478
+/- +0 +0 +0 +0
libopenthread-ncp-mtd.a 7c88bc7 25805 0 5948 31753
b599543 25805 0 5948 31753
+/- +0 +0 +0 +0
libopenthread-ftd-br.a 7c88bc7 366503 100 110327 476930
b599543 366503 100 110327 476930
+/- +0 +0 +0 +0
libopenthread-cli-ftd-br.a 7c88bc7 80757 0 8131 88888
b599543 80757 0 8131 88888
+/- +0 +0 +0 +0
libopenthread-rcp.a 7c88bc7 9944 0 5060 15004
b599543 9944 0 5060 15004
+/- +0 +0 +0 +0
libopenthread-radio.a 7c88bc7 19707 0 238 19945
b599543 19707 0 238 19945
+/- +0 +0 +0 +0

@codecov

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.99%. Comparing base (7c88bc7) to head (5224b6c).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/core/coap/coap.cpp 97.22% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12577      +/-   ##
==========================================
+ Coverage   73.46%   74.99%   +1.52%     
==========================================
  Files         697      702       +5     
  Lines       95499    96070     +571     
==========================================
+ Hits        70157    72044    +1887     
+ Misses      25342    24026    -1316     
Files with missing lines Coverage Δ
src/core/coap/coap.cpp 85.66% <97.22%> (+21.89%) ⬆️

... and 160 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@abtink
abtink marked this pull request as ready for review February 27, 2026 04:53
@github-project-automation github-project-automation Bot moved this to Under review in Improving CoAP/TMF Feb 27, 2026
@jwhui
jwhui merged commit 05ef3b4 into openthread:main Feb 27, 2026
131 of 134 checks passed
@github-project-automation github-project-automation Bot moved this from Under review to Merged in Improving CoAP/TMF Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants