Skip to content

refactor: cleanup backend code#2252

Draft
kmendell wants to merge 1 commit intomainfrom
refactor/cleanup-code
Draft

refactor: cleanup backend code#2252
kmendell wants to merge 1 commit intomainfrom
refactor/cleanup-code

Conversation

@kmendell
Copy link
Copy Markdown
Member

@kmendell kmendell commented Apr 6, 2026

Checklist

  • This PR is not opened from my fork’s main branch

What This PR Implements

Fixes:

Changes Made

Testing Done

  • Development environment started: ./scripts/development/dev.sh start
  • Frontend verified at http://localhost:3000
  • Backend verified at http://localhost:3552
  • Manual testing completed (describe):
  • No linting errors (e.g., just lint all)
  • Backend tests pass: just test backend

AI Tool Used (if applicable)

AI Tool:
Assistance Level:
What AI helped with:
I reviewed and edited all AI-generated output:
I ran all required tests and manually verified changes:

Additional Context

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

To have Greptile Re-Review the changes, mention greptileai.

Greptile Summary

This PR applies large-scale backend cleanup across 96 files, primarily adding the Internal suffix to unexported Go functions per the team's naming convention and extracting utilities. The convention is applied consistently in most service files, but a few newly introduced/modified files in pkg/pagination (filters.go, search.go) and internal/services/container_service.go still contain unexported free functions without the required suffix.

Confidence Score: 5/5

Safe to merge; all findings are style/naming P2 issues with no functional impact.

No logic bugs, security issues, or data-integrity problems were found. All remaining comments are P2 naming convention violations — the exact convention this PR is introducing — which do not block merge.

backend/pkg/pagination/filters.go, backend/pkg/pagination/search.go, backend/internal/services/container_service.go (naming convention consistency)

Comments Outside Diff (2)

  1. backend/pkg/pagination/filters.go, line 39-88 (link)

    P2 Missing Internal suffix on unexported functions

    Per the repo's naming convention, all unexported functions must have the Internal suffix. The functions filterFn, itemMatches, getAccessor, and matchValue in this file — and searchFn in search.go — are all unexported but lack the suffix. Since this PR is specifically applying that convention across the backend, these should be renamed to filterFnInternal, itemMatchesInternal, getAccessorInternal, matchValueInternal, and searchFnInternal.

    Rule Used: What: All unexported functions must have the "Inte... (source)

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: backend/pkg/pagination/filters.go
    Line: 39-88
    
    Comment:
    **Missing `Internal` suffix on unexported functions**
    
    Per the repo's naming convention, all unexported functions must have the `Internal` suffix. The functions `filterFn`, `itemMatches`, `getAccessor`, and `matchValue` in this file — and `searchFn` in `search.go` — are all unexported but lack the suffix. Since this PR is specifically applying that convention across the backend, these should be renamed to `filterFnInternal`, `itemMatchesInternal`, `getAccessorInternal`, `matchValueInternal`, and `searchFnInternal`.
    
    **Rule Used:** What: All unexported functions must have the "Inte... ([source](https://app.greptile.com/review/custom-context?memory=306fc233-4d2f-4ac4-bdf7-8059588e8a43))
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Codex

  2. backend/internal/services/container_service.go, line 1066-1094 (link)

    P2 filterInternalContainers / collectImageIDs violate the Internal suffix convention

    filterInternalContainers uses "Internal" as a semantic descriptor for "Arcane-internal containers," not as the naming-convention suffix. A reader following the convention would misread this as compliant when it isn't. It should be filterArcaneInternalContainersInternal (or a shorter equivalent). collectImageIDs similarly lacks the required suffix.

    Rule Used: What: All unexported functions must have the "Inte... (source)

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: backend/internal/services/container_service.go
    Line: 1066-1094
    
    Comment:
    **`filterInternalContainers` / `collectImageIDs` violate the `Internal` suffix convention**
    
    `filterInternalContainers` uses "Internal" as a semantic descriptor for "Arcane-internal containers," not as the naming-convention suffix. A reader following the convention would misread this as compliant when it isn't. It should be `filterArcaneInternalContainersInternal` (or a shorter equivalent). `collectImageIDs` similarly lacks the required suffix.
    
    **Rule Used:** What: All unexported functions must have the "Inte... ([source](https://app.greptile.com/review/custom-context?memory=306fc233-4d2f-4ac4-bdf7-8059588e8a43))
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Codex

Fix All in Codex

Prompt To Fix All With AI
This is a comment left during a code review.
Path: backend/pkg/pagination/filters.go
Line: 39-88

Comment:
**Missing `Internal` suffix on unexported functions**

Per the repo's naming convention, all unexported functions must have the `Internal` suffix. The functions `filterFn`, `itemMatches`, `getAccessor`, and `matchValue` in this file — and `searchFn` in `search.go` — are all unexported but lack the suffix. Since this PR is specifically applying that convention across the backend, these should be renamed to `filterFnInternal`, `itemMatchesInternal`, `getAccessorInternal`, `matchValueInternal`, and `searchFnInternal`.

**Rule Used:** What: All unexported functions must have the "Inte... ([source](https://app.greptile.com/review/custom-context?memory=306fc233-4d2f-4ac4-bdf7-8059588e8a43))

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: backend/internal/services/container_service.go
Line: 1066-1094

Comment:
**`filterInternalContainers` / `collectImageIDs` violate the `Internal` suffix convention**

`filterInternalContainers` uses "Internal" as a semantic descriptor for "Arcane-internal containers," not as the naming-convention suffix. A reader following the convention would misread this as compliant when it isn't. It should be `filterArcaneInternalContainersInternal` (or a shorter equivalent). `collectImageIDs` similarly lacks the required suffix.

**Rule Used:** What: All unexported functions must have the "Inte... ([source](https://app.greptile.com/review/custom-context?memory=306fc233-4d2f-4ac4-bdf7-8059588e8a43))

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "refactor: cleanup backend code" | Re-trigger Greptile

Context used:

  • Rule used - What: All unexported functions must have the "Inte... (source)

Copy link
Copy Markdown
Member Author

kmendell commented Apr 6, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@getarcaneappbot
Copy link
Copy Markdown
Contributor

getarcaneappbot commented Apr 6, 2026

Container images for this PR have been built successfully!

  • Manager: ghcr.io/getarcaneapp/arcane:pr-2252
  • Agent: ghcr.io/getarcaneapp/arcane-headless:pr-2252

Built from commit acfd0c9

@kmendell kmendell force-pushed the refactor/cleanup-code branch 13 times, most recently from af93fc7 to 82b9c9d Compare April 9, 2026 21:02
@kmendell kmendell force-pushed the refactor/cleanup-code branch from 82b9c9d to 0f8102c Compare April 10, 2026 22:07
@kmendell kmendell force-pushed the refactor/cleanup-code branch 12 times, most recently from b19bd78 to c8fa901 Compare April 17, 2026 01:12
@kmendell kmendell force-pushed the refactor/cleanup-code branch 10 times, most recently from bd3a77d to 6113d3a Compare April 24, 2026 23:00
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@kmendell kmendell force-pushed the refactor/cleanup-code branch from 6113d3a to 417b9f0 Compare April 25, 2026 05:43
@kmendell kmendell force-pushed the refactor/cleanup-code branch 5 times, most recently from 10321c2 to 1fd30eb Compare April 29, 2026 00:05
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants