Skip to content

fix(woodpecker): log SetPerm permission refresh duration (RIG-11816) - #224

Merged
rigel-nemo[bot] merged 1 commit into
mainfrom
ci-pipelines/rig-11816-log-setperm-permission-refresh-duration
Nov 23, 2026
Merged

rigel-nemo[bot] merged 1 commit into
mainfrom
ci-pipelines/rig-11816-log-setperm-permission-refresh-duration

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What does this do

Ports RigelBuild/woodpecker#188 into the nebula fork. SetPerm now logs each forge permission refresh with its duration, the age of the stored permission, the repo, the user, and the error. A refresh over 5 s also logs a WARN line.

Why do we need it

RIG-11816 reports /config requests stalling 31 to 100 s. One suspect is the _forge.Repo call in SetPerm. It has no timeout, and it runs when the stored permission is over an hour old. These logs show the duration after deploy, so the suspect can be confirmed or ruled out. Orion#8810 removes the fork's release minter, so fixes ship from nebula now.

Summary

  • forks/woodpecker/server/router/middleware/session/repo.go: timing and two log lines around _forge.Repo. No control-flow, timeout, or error-handling change.

Verification

Off-box on macpro2013, Go 1.27.3, CGO_ENABLED=1 go test -tags test -count=1:

  • ./server/router/middleware/session/... ok. TestSetPerm passes, and its stale-permission subtest logs SetPerm refresh with duration and synced_age.
  • ./server/router/... ok for the packages that have tests.
  • gofmt -l clean on the touched package.
  • go vet -tags test ./server/router/middleware/session/ clean.

Risks

One INFO line per stale-permission refresh, at most one per user and repo per hour. The WARN line fires only past 5 s.

Spec impact

Spec-impact: none

Checks skipped: nebula has no pre-push hook config; GitHub Actions ci.yaml runs its checks

Refs RIG-11816

Co-authored-by: Matt Wilkinson matt@rigel.build

## What does this do

Ports RigelBuild/woodpecker#188 into the fork. `SetPerm` now logs each
forge permission refresh with its duration, the age of the stored
permission, the repo, the user, and the error. A refresh over 5 s also
logs a WARN line.

## Why do we need it

RIG-11816 reports `/config` requests stalling 31 to 100 s. One suspect is
the `_forge.Repo` call in `SetPerm`. It has no timeout, and it runs when
the stored permission is over an hour old. These logs show the duration
after deploy, so the suspect can be confirmed or ruled out.

## Summary

- `forks/woodpecker/server/router/middleware/session/repo.go`: timing
  and two log lines around `_forge.Repo`. No control-flow, timeout, or
  error-handling change.

## Verification

- `gofmt -l` clean on the touched file.
- Test run off-box on macpro2013 (`go test -tags test`), see the PR body.

## Risks

One INFO line per stale-permission refresh, at most one per user and
repo per hour.

Ports RigelBuild/woodpecker#188.

## Spec impact

Spec-impact: none

Refs RIG-11816

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Nov 22, 2026

Copy link
Copy Markdown

RIG-11816

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

All-clear at c19032f
Base: main

Review round: all-clear

Reviewed head: c19032f

Verdict: all-clear. No high or medium findings.

Low, out of scope by design: when no permission row exists, perm.Synced is 0, so synced_age logs about 56 years. It reads as "never synced". Harmless.

@rigel-nemo

rigel-nemo Bot commented Nov 23, 2026

Copy link
Copy Markdown

Checks read:

@rigel-nemo
rigel-nemo Bot merged commit 7d1626b into main Nov 23, 2026
6 of 10 checks passed
@rigel-nemo
rigel-nemo Bot deleted the ci-pipelines/rig-11816-log-setperm-permission-refresh-duration branch November 23, 2026 00:50

This branch had an error being deployed

1 failed deployment
ci — c19032f7 Deployed Nov 22, 2026 by rigel-mintaka via CI (aarch64-darwin) #1053
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.

1 participant