fix: fixed upper bound on step number and moved private GitHub helper methods to utils package#2755
Conversation
…number filters the log content correctly Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Greptile code reviewThis repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md. Run a review — add a PR comment with: Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5. Optional: automate with the greploop skill. |
…d_github_mcp_config` methods in git deploy timeline tool test Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Greptile SummaryThis PR fixes an off-by-one bug in
Confidence Score: 5/5Safe to merge — the refactor is a mechanical rename with no logic changes, and the step_number bound fix is correct and well-tested. The helper extraction is a straight copy-and-rename with all call sites and test patches updated consistently. The extract_step_log fix correctly narrows the upper bound from total section count to named-group count, and two new tests directly validate both the happy path and the previously-broken out-of-bounds case. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Tools
A[GitHubActionsTool]
B[GitHubSearchCodeTool]
C[GitHubCommitsTool]
D[GitHubFileContentsTool]
E[GitHubRepositoryTreeTool]
F[GitDeployTimelineTool]
end
subgraph Utils
G[github_helpers.py]
end
subgraph Integration
H[github_mcp]
end
A --> G
B --> G
C --> G
D --> G
E --> G
F --> G
G --> H
Reviews (2): Last reviewed commit: "test: added test to check for invalid st..." | Re-trigger Greptile |
Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
|
@greptile review |
|
@muddlebee I found out that the usage of private helper methods has been followed far and wide across the project. Should I refactor those methods in this PR or should I create a new issue + PR? Some notable code examples across GitLab, BitBucket, Grafana, Sentry, Tracer, Lambda and EKS related tools:
and many more. |
|
@SaptarshiSarkar12 we will need to fix those, we started revamping/refactoring our code, probably will take those later, but for now priority is functional for older integrations, and thanks for this. Looks good. LGTM |
|
🐉 Legend says enough merged PRs and you ascend. @SaptarshiSarkar12 is dangerously close. 🌤️ 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |
|
Okay thanks @muddlebee for merging this PR! ❤️ |

Fixes #2719
Describe the changes you have made in this PR
In this pull request, I have addressed the following changes:
step_numberis pre-calculated as the total count of grouped stepsapp/tools/utils/github_helpers.pyfile and modified relevant tools and test filesDemo/Screenshot for feature changes and bug fixes
No demo attached as the issue is about refactoring existing code
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
The complete log content has ungrouped and grouped parts. The total sum of grouped parts is the maximum possible
step_numbervalue. So, I have used that value as its upper bound.I have converted the private helper methods to public methods in
app/tools/utils/github_helpers.pyfile. On performing those changes across all GitHub related tools, the tests failed due to mockup methods. So, I refactored those mock calls togithub_helpersfile and the tests pass! 🎉Checklist before requesting a review
Note: Please check Allow edits from maintainers if you would like us to assist in the PR.