fix(mcp): log the numeric auto_index_limit in autoindex.skip (#1466) - #1779
Open
rarepops wants to merge 2 commits into
Open
fix(mcp): log the numeric auto_index_limit in autoindex.skip (#1466)#1779rarepops wants to merge 2 commits into
rarepops wants to merge 2 commits into
Conversation
The too_many_files warning passed the CBM_CONFIG_AUTO_INDEX_LIMIT key constant as the value of the `limit` field, so the warning read `limit=auto_index_limit` instead of the configured number. Format the effective file_limit into a buffer the same way the neighbouring `files` count already is. Fixes DeusData#1466 Signed-off-by: Rares Popa <2606875+rarepops@users.noreply.github.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1466
Problem
When auto-indexing skips a repository because its tracked-file count exceeds
auto_index_limit, the warning reports the name of the config key instead of the configured value:CBM_CONFIG_AUTO_INDEX_LIMITis#defined as the string"auto_index_limit"in src/cli/cli.h, and it was being passed straight through as the value of thelimitfield:The effective numeric limit was already in scope as
file_limit, read a few lines earlier viacbm_config_get_int().As the reporter noted, the malformed
filesfield from v0.9.0 is already fixed onmain; only thelimitfield remained.Fix
Format
file_limitinto a buffer, mirroring exactly how the neighbouringfilescount is already handled:Output now matches the issue's expectation:
Test
autoindex_skip_reports_numeric_limit_issue1466intests/test_mcp.cdrives the real public entry point (initialize->maybe_auto_index) against a fresh project holding more files thanauto_index_limit, and captures the emitted warning through a log sink.Reproduce-first, verified in both directions on the same tree:
autoindex_skip_reports_numeric_limit_issue1466FAIL tests/test_mcp.c:10637: strstr(warning, "limit=1") is NULLPASSmcpsuiteThe failure is not vacuous: the
msg=autoindex.skip,reason=too_many_filesandfiles=2assertions all pass in the RED run, so the skip path is genuinely exercised and the log line is genuinely captured. Only thelimit=1assertion flips. The test also asserts the absence oflimit=auto_index_limit, so a future regression that drops the value back to the key name fails loudly.Verification
Run in a container mirroring the CI toolchain (Ubuntu 24.04 + gcc, ASan/UBSan build):
mcpsuite: 204 passed, 0 failedlog,daemon,daemon_runtime,daemon_application(the suites covering the logging layer and the sibling auto-index admission path): 120 passed, 0 failedlint-formatwith clang-format-20: cleanlint-cppcheckwith cppcheck 2.20.0: cleanlint-no-suppressandlint-mem-ciare structurally unaffected: the diff adds noNOLINT, the onlyLINT_SRCSfile touched issrc/mcp/mcp.c(two stack buffers, no allocation), and no entry inscripts/lint-mem-whitelist.txtis pinned tomaybe_auto_index, so no sha256 pin is invalidated.Out of scope (possible follow-up)
While tracing this I noticed the daemon has a sibling warning at
src/daemon/application.cthat emitsreasonandfilesfor the same condition but carries nolimitkey at all:That is a different defect from #1466 (a missing field rather than a wrong one) and it is not what the issue reports, so I left it alone to keep this PR to one issue. Happy to open a separate issue or PR for it if you would like the two skip warnings to carry the same fields.