[OJ-54951] Honor backpopulation_window_days from server endpoint#457
Conversation
Consume the per-instance `backpopulation_window_days` field surfaced by Jellyfish's `_get_git_info()` and pass it through to `JFIngestGitConfig`. Without this, GitLab agent customers were silently falling back to the jf_ingest dataclass default of 60 days, despite Jellyfish's server-side config code specifying 365 for GitLab. Falls back to leaving the kwarg unset (dataclass default) when the field is absent, for backward compatibility with older Jellyfish servers. Companion change: Jellyfish-AI/jellyfish#35100. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the agent’s server-provided Git instance configuration handling so that a per-instance backpopulation_window_days value (when present in the /endpoints/agent/company payload) is propagated into the jf-ingest GitConfig (JFIngestGitConfig) instead of always relying on the jf-ingest default.
Changes:
- Read
backpopulation_window_daysfromendpoint_git_instance_infowhen provided by the server. - Pass
backpopulation_window_daysthrough toJFIngestGitConfigwhile keeping backward compatibility when the field is absent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pull_from = _make_datetimes_timezone_aware(endpoint_git_instance_info['pull_from']) | ||
|
|
||
| # Check if non-default backpopulation window should be used. | ||
| extra_kwargs = {} | ||
| if 'backpopulation_window_days' in endpoint_git_instance_info: | ||
| extra_kwargs['backpopulation_window_days'] = endpoint_git_instance_info[ | ||
| 'backpopulation_window_days' | ||
| ] |
There was a problem hiding this comment.
Added unit coverage in tests/test_config_file.py (TestBackpopulationWindowDaysPassthrough): one test asserts backpopulation_window_days is forwarded into JFIngestGitConfig when present in endpoint_git_instance_info, and a second asserts the kwarg is omitted when absent so jf-ingest's default applies. Pushed in 08565f5.
Asserts that JFIngestGitConfig receives the kwarg when the server endpoint provides it, and that the kwarg is omitted when absent so the jf_ingest default applies. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace `/tmp/agent-output` literal in the new tests' mock `config.outdir` with a relative string to silence the SonarCloud "publicly writable directories" finding. The path is mock-only — no file is created. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|



Summary
backpopulation_window_daysfield newly surfaced by Jellyfish's_get_git_info()and pass it through toJFIngestGitConfig.jf_ingest.config.GitConfigdataclass default of 60 days, despite Jellyfish's Direct Connect path setting 365 days for GitLab.🤖 Generated with Claude Code