Skip to content

Sync repo visibility with forge as new default option - #7602

Merged
6543 merged 15 commits into
woodpecker-ci:mainfrom
6543-forks:sync-visibility
Nov 22, 2026
Merged

6543 merged 15 commits into
woodpecker-ci:mainfrom
6543-forks:sync-visibility

Conversation

@6543

@6543 6543 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

close #1220

we had inconsistencies in visibility modes.

for example gitlab do since #6544 take the visibility from the forge if the forge sends one ...
... the rest does no sync at all.

so a repo made private on the forge stays public in woodpecker, and on gitlab every hook overwrites the visibility set in woodpecker :/

this adds a repo option visibility_sync. if enabled we sync the visibility on hook, repair and move, else we keep what is set in woodpecker and only update the forge private flag used for cloning.

Since woodpecker-ci#6544 a repo only takes the visibility from the forge when the
forge sends one, which only GitLab does. A repo made private on the
forge stays public in Woodpecker, and on GitLab every hook overwrites a
visibility set in Woodpecker.

Store per repo whether its visibility follows the forge. Without the
flag the visibility set in Woodpecker is kept, while the forge privacy
used for clones is still updated. Also drop the unused ResetVisibility.
Explain the new sync setting, that read access only follows the forge
visibility when it is synced, and that admins should repair all repos
so existing ones get the sync.
Only GitLab reported a visibility, so the sync could not follow the
other forges. GitHub and Bitbucket map their private flag, Bitbucket
Datacenter its public flag. Gitea and Forgejo also map an owner with
limited visibility to internal, as only signed in users see its repos.
Bitbucket Datacenter hooks still return the stored repo, so it only
syncs on repair and move.
New repos sync their visibility by default, and the add repo list shows
that default. Repair enables the sync so existing repos move to it;
re-activation keeps the visibility settings of a repo. A patch that
enables the sync ignores the visibility, the next sync overwrites it.
While the sync is enabled the visibility radio only shows the current
value, as the next sync would overwrite a change.
Let repo update enable or disable the sync and expose the flag on the
repo of the Go client.
@6543 6543 added server enhancement improve existing features security labels Nov 20, 2026
@6543

6543 commented Nov 20, 2026

Copy link
Copy Markdown
Member Author
image image image image

@6543
6543 requested a review from a team November 20, 2026 00:46
@woodpecker-bot

woodpecker-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Surge PR preview deployment was removed

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.37%. Comparing base (98bc123) to head (0ed11a9).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
cli/repo/repo_update.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7602      +/-   ##
==========================================
+ Coverage   66.99%   67.37%   +0.38%     
==========================================
  Files         451      451              
  Lines       22690    22722      +32     
==========================================
+ Hits        15201    15309     +108     
+ Misses       7489     7413      -76     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread server/api/repo.go Resolved
6543 and others added 2 commits November 20, 2026 10:08
Repair should only fix the repo, not change its settings. Turning the
sync on there silently made repos public that are private in
Woodpecker but public on the forge.
@6543
6543 requested a review from qwerty287 November 20, 2026 11:39
Comment thread docs/src/pages/migrations.md Resolved
@6543
6543 requested a review from qwerty287 November 21, 2026 15:12
Comment thread server/api/user.go Resolved
Comment thread server/api/repo.go Resolved
@6543

6543 commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

@qwerty287 last open question, should a re-enable set default values or keep legacy ones?

@6543

6543 commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

this then should also affect other settings ...

@qwerty287

qwerty287 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

As I wrote, it should keep the old value I think

And if sync was enabled before it should stay enabled and then we also have to sync the visibility on re-activation

@6543

6543 commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

sorry dont saw your reply till jet

@qwerty287

Copy link
Copy Markdown
Contributor

No problem. All the other settings are also kept right now

@6543

6543 commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

for your suggestion to order repo settings etc... e.g. DTO, I'll create a discussion

@6543
6543 enabled auto-merge (squash) November 22, 2026 16:10
@6543
6543 merged commit e1cc4d5 into woodpecker-ci:main Nov 22, 2026
7 checks passed
@6543
6543 deleted the sync-visibility branch November 22, 2026 16:25
@woodpecker-bot woodpecker-bot mentioned this pull request Nov 22, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement improve existing features security server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option for server-wide default repository visibility

4 participants