Skip to content

Remove unused RangeSearchBufferMeters constant - #1896

Merged
aaronbrethorst merged 1 commit into
OneBusAway:mainfrom
chikolavosaki-sys:chore/1895-remove-range-search-buffer
Nov 2, 2026
Merged

aaronbrethorst merged 1 commit into
OneBusAway:mainfrom
chikolavosaki-sys:chore/1895-remove-range-search-buffer

Conversation

@chikolavosaki-sys

@chikolavosaki-sys chikolavosaki-sys commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1895

What it does

Deletes the unused models.RangeSearchBufferMeters constant and its comment from internal/models/constants.go. No behavior or response changes.

Root cause

The constant's only caller was getDistanceAlongShapeInRange in internal/restapi/trips_helper.go, where it widened the shape-segment search window by 50 m to tolerate GPS noise. #1873 (2f0e23a6) removed that function as dead code, which left the constant orphaned. Go doesn't report unused exported package-level constants, so nothing flagged it.

Testing

  • Test failing on main before this change: n/a (dead code removal)
  • Manual check:
    • git grep -n "RangeSearchBuffer" on this branch: no matches (code, tests or docs)
    • go build ./...: passes
    • go vet ./... (compiles _test.go files too): passes
    • go test ./internal/models/...: ok maglev.onebusaway.org/internal/models 0.018s
    • gofmt -l internal/models: no output

Checklist

Ready-for-review requirement: Every box must be checked. If any statement is not true, keep the pull request
as Draft.

  • This PR addresses one issue.
  • It is under ~200 changed lines, or the description says why it can't be split.
  • This PR is not a bug fix, or the new or changed test fails on main and passes on this branch.
  • Each commit is one logical change with a clear message.
  • I did not hand-edit sqlc-generated files under gtfsdb/ (db.go, models.go, query.sql.go) or testdata/openapi.yml (synced from upstream).
  • This PR changes no handler, or handlers pass r.Context() to DB/service calls, not context.Background().
  • The response comparison above is filled in, or this PR doesn't change a Java-served response.
  • This PR adds no endpoint, or each new endpoint matches testdata/openapi.yml, has an issue open on OneBusAway/sdk-config, or is outside the SDK and the description says why.
  • I read every line of this diff and can explain it if asked.

Summary by CodeRabbit

  • Chores
    • No user-facing changes are included in this update. The available features and behavior of the product remain unchanged. This release does not add new functionality, alter existing workflows, or change what users can access. It contains no visible updates to the interface or user experience.

Copilot AI balanced review requested due to automatic review settings October 31, 2026 08:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b12e1fa4-8fd3-4c8d-b016-8b33cfebdc43
Commits

Reviewing files that changed from the base of the PR and between 8cae50c and 2acd051.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 981e4123-2203-47a8-ab64-ddeb20910204
Commits

Reviewing files that changed from the base of the PR and between b37503d and 8cae50c.

Files selected for processing: 1
  • internal/models/constants.go
Files with no reviewable changes: 1
  • internal/models/constants.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The exported RangeSearchBufferMeters constant was removed from internal/models/constants.go.

Changes: Range constant cleanup

Layer / File(s) Summary
Remove unused constant
internal/models/constants.go
The exported RangeSearchBufferMeters constant was removed.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Refactor

Possibly related PRs

Suggested labels: follows-template

Suggested reviewers: 3rabiii, aaronbrethorst

Merge Risk: Minimal · previous review 8cae5

No merge-blocking risk is identified for this constant removal.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: removing the unused RangeSearchBufferMeters constant.
Description check Passed The description includes the issue reference, change summary, root cause, testing details, and completed checklist. It correctly omits the response comparison because the change does not affect Java-s…
Linked Issues check Passed Issue #1895 requires deletion of models.RangeSearchBufferMeters and its comment from internal/models/constants.go. The whole-PR summary records removal of the constant and its three-line declarati…
Out of Scope Changes check Passed The reported change only removes the unused constant and its comment from internal/models/constants.go. This change directly implements issue #1895 and shows no unrelated code, test, or documentatio…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Description check

Explanation

The description includes the issue reference, change summary, root cause, testing details, and completed checklist. It correctly omits the response comparison because the change does not affect Java-served responses. The testing section summarizes results rather than including full command output, but the description is otherwise complete.

Full details: Linked Issues check

Explanation

Issue #1895 requires deletion of models.RangeSearchBufferMeters and its comment from internal/models/constants.go. The whole-PR summary records removal of the constant and its three-line declaration, which includes the comment. No additional coding requirements are defined.

Full details: Out of Scope Changes check

Explanation

The reported change only removes the unused constant and its comment from internal/models/constants.go. This change directly implements issue #1895 and shows no unrelated code, test, or documentation changes.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the follows-template The PR description follows the PR template label Oct 31, 2026
Its only caller, getDistanceAlongShapeInRange, was removed in OneBusAway#1873.

Fixes OneBusAway#1895
@aaronbrethorst
aaronbrethorst force-pushed the chore/1895-remove-range-search-buffer branch from 8cae50c to 2acd051 Compare November 2, 2026 19:46
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@aaronbrethorst aaronbrethorst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @chikolavosaki-sys, this is a nice, clean follow-up to #1873. I checked that nothing else still uses the constant. That includes the open GTFS-Flex stack (#1481-#1485) and the other open PRs. The only references are in branches cut before #1873, and they come from the getDistanceAlongShapeInRange that #1873 already deleted, not from anything those branches add. Removing it here won't break any of them on rebase. Approving.

@aaronbrethorst
aaronbrethorst merged commit 922e759 into OneBusAway:main Nov 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

follows-template The PR description follows the PR template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unused RangeSearchBufferMeters constant

3 participants