Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Read the change list and its counts from the index

b739915c0941be0f97cef8b96fd28d8f4c4685ae · Keenan Nemetz · 10d ago · parent 7f547ca3

Read the change list and its counts from the index

The header, the change list and the release artifact list now come from
the derived rows instead of the metadata branch:

- The header's open-changes badge is one COUNT, so a page that only shows
  the badge no longer reads `ls-tree`, `batch-check` and `batch` on every
  view. That is the read that grew with the repository's issues and
  comments.
- The change list, its state chips and its approval counts are queries.
  An approval still only counts when it names the request's current head
  and base, and eligibility is still the ACL's decision, so a stale
  approval is shown as history exactly as before.
- The release page's artifact list is the indexed pointer set.
- A change page reads its one request rather than every request; the
  conversation page keeps reading git, so the record it renders is
  authoritative rather than a copy.

On the fixture (40 files, 30 issues, 30 changes), git calls per page:

  issues list    5 -> 2        change list   6 -> 3
  releases       6 -> 3        commits       7 -> 4
  overview      19 -> 6 (repeat)  code       12 -> 9
  change view   14 -> 12

The remaining calls are the one `rev-parse` the refresh needs, the branch
and tree reads the page itself shows, and the detail pages' own git read.

server/web/memo.go +11−8

@@ -174,17 +174,20 @@ func (w *Web) requestsAt(memo *requestMemo, m *repo.Meta) ([]*metadata.Request,
174 174 return list, err
175 175 }
176 176
177 // requestAt returns one change request from the request's list. It is the
178 // memoised form of metadata.GetRequest, which reads every request to find one.
177 // requestAt returns one change request, reading that request's files rather
178 // than every request on the branch. It uses the request's resolved metadata
179 // commit, so a page that also refreshes the index resolves the ref once.
179 180 func (w *Web) requestAt(memo *requestMemo, m *repo.Meta, id string) (*metadata.Request, error) {
180 list, err := w.requestsAt(memo, m)
181 head, err := w.metadataHead(memo, m)
181 182 if err != nil {
182 183 return nil, err
183 184 }
184 for _, req := range list {
185 if req.ID == id {
186 return req, nil
187 }
185 req, found, err := metadata.LoadRequestAt(m.Git(), head, id)
186 if err != nil {
187 return nil, err
188 }
189 if !found {
190 return nil, fmt.Errorf("requests: no request %s", id)
188 191 }
189 return nil, fmt.Errorf("requests: no request %s", id)
192 return req, nil
190 193 }