Skip to content

Set repo visibility in Gitea and Forgejo converters - #7630

Closed
Sun-Wukhan wants to merge 1 commit into
woodpecker-ci:mainfrom
Sun-Wukhan:fix/gitea-forgejo-repo-visibility
Closed

Sun-Wukhan wants to merge 1 commit into
woodpecker-ci:mainfrom
Sun-Wukhan:fix/gitea-forgejo-repo-visibility

Conversation

@Sun-Wukhan

Copy link
Copy Markdown

Fixes #7584

The Gitea and Forgejo toRepo converters set IsSCMPrivate but never set Visibility. Repo.Update only propagates visibility when the source supplies it (guard added in #6544), so a repo whose privacy changed on the forge never had its stored visibility synced, in either direction.

Both converters now derive Visibility from the privacy flag via the existing Repo.ResetVisibility() helper. IsSCMPrivate semantics are untouched.

Tests:

  • New TestToRepoVisibility and TestToRepoVisibilityUpdatePropagation in both forge packages (private repo, non-public owner, public repo; Update propagation in both directions). They fail on the unpatched converters and pass with the fix.
  • Parser expectations in both packages updated for the now-populated Visibility field.
  • go test -tags test ./server/forge/gitea/... ./server/forge/forgejo/... ./server/model/... passes, as does the full ./server/forge/... tree; gofmt and go vet clean.

This PR was prepared with AI assistance.

Fixes woodpecker-ci#7584

Signed-off-by: Navid Khan (Ali) <60997541+Sun-Wukhan@users.noreply.github.com>
@6543

6543 commented Nov 24, 2026

Copy link
Copy Markdown
Member

should be addressed by #7602 already

@6543 6543 closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gitea and Forgejo repository converters omit visibility required by Repo.Update

2 participants