Skip to content

Housekeeping for the HTTP client and the serve history view - #22

Merged
pjbgf merged 4 commits into
mainfrom
push-options-redirect-fix
Oct 20, 2026
Merged

pjbgf merged 4 commits into
mainfrom
push-options-redirect-fix

Conversation

@pjbgf

@pjbgf pjbgf commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

https://entire.io/gh/entireio/forgemark/trails/11

Redirects

  • All forge requests (pushes, clones, the ref sweep and the push-options
    probe) now share one redirect policy instead of per-call handling. Like
    git's default for the initial info/refs request, a redirect within the
    configured origin (same scheme, host and port) is followed. One that
    leaves it stops the run with a clear error.
  • -push-options now works with forges that redirect within their own
    origin, such as GitLab's repo to repo.git.

History

  • The history listing decodes only what a summary needs (run fields,
    target names and levels) and skips the per-second series, so listing
    stays about one read per file as runs get longer. Legacy docs are
    summarized exactly as before.
  • Docs whose levels can't be loaded are skipped from the listing, as
    before, so everything listed can be opened. A doc damaged only in its
    series still lists, and opening it reports the error.
  • At most two history reads run at once, which keeps server memory
    predictable.

Note

Medium Risk
Changes credential-bearing HTTP redirect handling and history API behavior; mistakes could leak auth or change which runs appear in history, but behavior is covered by new tests.

Overview
Unifies forge HTTP behavior around a same-origin redirect policy on the shared client: redirects that keep scheme, hostname, and port are followed (matching git for cases like GitLab repo → repo.git); anything that would leave the configured origin is refused so Basic auth is not forwarded to another host, port, or subdomain. The push-options probe drops its ad-hoc “no redirect” check and uses that client, so -push-options works on same-origin redirects while startup and ref cleanup still fail closed on cross-origin redirects.

History listing and server reads are tightened for large result files: List decodes only summary fields via readSummary (skipping per-second Series), with the same legacy normalization and exclusion of docs whose levels would fail Load. History routes are wrapped with a two-slot concurrency limit so exposed binds cannot spike memory on parallel full-doc reads.

Reviewed by Cursor Bugbot for commit 9531340. Configure here.

pjbgf added 3 commits October 20, 2026 12:32
The probe used the generic client, which follows redirects and Go
forwards Authorization to same-host and subdomain targets. It now hands
redirects back, like Entire discovery, so a redirect fails the run
instead of carrying the credential.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Gomes <paulo@entire.io>
Entire-Checkpoint: 59f1733d7cbd
History reads whole result docs, and a long multi-target run makes them
large. Remote viewers can reach history on an exposed bind. The listing
now decodes only the summary fields, not every per-second series point,
and at most two history reads run at once.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Gomes <paulo@entire.io>
Every request on the generic path carries Basic auth up front, and Go
copies it to a redirect target on any port of the same hostname or on a
subdomain. The previous commit kept the push-options probe on the
configured origin. Pushes, clones and the stale-ref sweep share the same
client, so the policy now lives there. A redirect within the origin is
followed, as git does for the initial info/refs request. One that changes
scheme, hostname or port is refused.

This also lets -push-options work against forges that redirect within
their own origin, such as GitLab's repo to repo.git.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Gomes <paulo@entire.io>
Entire-Checkpoint: c0928221bbee
@pjbgf

pjbgf commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

The history summary decoded levels as raw JSON, so a doc with malformed
levels was listed and then failed to open. Levels are small, so the
summary now decodes them as bench.LevelResult like Load does. Skipping
Series still keeps a listing to about one read of the file.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paulo Gomes <paulo@entire.io>
@pjbgf

pjbgf commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9531340. Configure here.

@pjbgf
pjbgf merged commit 654e95a into main Oct 20, 2026
4 of 5 checks passed
@pjbgf
pjbgf deleted the push-options-redirect-fix branch October 20, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant