Skip to content

[OJ-54951] Honor backpopulation_window_days from server endpoint#457

Merged
lheureuxe13 merged 4 commits into
masterfrom
OJ-54951-gl-agent-bp
May 21, 2026
Merged

[OJ-54951] Honor backpopulation_window_days from server endpoint#457
lheureuxe13 merged 4 commits into
masterfrom
OJ-54951-gl-agent-bp

Conversation

@lheureuxe13
Copy link
Copy Markdown
Contributor

@lheureuxe13 lheureuxe13 commented May 21, 2026

Summary

  • Consume the per-instance backpopulation_window_days field newly surfaced by Jellyfish's _get_git_info() and pass it through to JFIngestGitConfig.
  • Without this, GitLab agent customers silently fall back to the jf_ingest.config.GitConfig dataclass default of 60 days, despite Jellyfish's Direct Connect path setting 365 days for GitLab.
  • Backward-compatible: when the field is absent from the endpoint payload, the kwarg is left unset and the dataclass default applies (same behavior as today).

🤖 Generated with Claude Code

lheureuxe13 and others added 2 commits May 21, 2026 10:15
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_days from endpoint_git_instance_info when provided by the server.
  • Pass backpopulation_window_days through to JFIngestGitConfig while keeping backward compatibility when the field is absent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 560 to +567
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'
]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Comment thread tests/test_config_file.py Fixed
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>
@sonarqubecloud
Copy link
Copy Markdown

@lheureuxe13 lheureuxe13 merged commit da48a9e into master May 21, 2026
7 checks passed
@lheureuxe13 lheureuxe13 deleted the OJ-54951-gl-agent-bp branch May 21, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants