Skip to content

repo: support unlisted but publicly accessible repositories#6176

Merged
unknwon merged 14 commits intogogs:mainfrom
achilleas-k:unlisted-repositories
Sep 3, 2020
Merged

repo: support unlisted but publicly accessible repositories#6176
unknwon merged 14 commits intogogs:mainfrom
achilleas-k:unlisted-repositories

Conversation

@achilleas-k
Copy link
Contributor

@achilleas-k achilleas-k commented May 27, 2020

This PR adds support for publicly accessible but unlisted (secret) repositories (issue #5733).

Forms and UI

I'm including screenshots to show how the new checkbox appears in all relevant forms.

Creation

new-repository
new-fork
new-migration

Settings

repo-settings

Settings (forked)

repo-settings-with-fork

Icon

Note that, as I mentioned in the relevant issue, I included the icon for testing but it should probably be replaced by something more appropriate, like the eye-closed octicon in newer versions, or anything you might feel is more appropriate..

repo-home
repo-list


Behaviour

Unlisted repositories behave like Private repositories on pages that list repositories. The difference is that users who know the URL are allowed to view and clone them. The general idea is that Unlisted repositories should be "secret", in that no user should be able to discover them, but users who know about them can read them. In the interest of clarity and posterity, below I list how Unlisted repositories behave in all relevant cases.

For the owner of an unlisted repository:

  • They appear on the owner's repository list page.
  • They appear on the explore page (and search results).

For a collaborator of an unlisted repository:

  • They do not appear on the owner's repository list page.
  • They appear on the explore page (and search results).

For owners of organisations with unlisted repositories:

  • They appear on an organisation's repository list page.

For organisation team members with access to unlisted repositories:

  • They appear on an organisation's repository list page.

For other users and guest (non-logged-in) users:

  • They do not appear on the owner's repository list page.
  • They do not appear on the explore page (and search results).

General:

  • They do not appear in the owner's public activity (actions).
  • Repositories can be created unlisted.
  • Migrations can be created unlisted.
  • Forking an unlisted repository copies the unlisted property and the property can't be changed in the fork.
  • Changing a repository's unlisted status changes the status for all forks of the repository.
  • Changing a repository's unlisted status changes the visibility of associated actions.

API

Adding the Unlisted property to the API requires editing the structs in the go-gogs-client, which I'll do later and then reflect the changes here as necessary.

@codecov
Copy link

codecov bot commented May 27, 2020

Codecov Report

Merging #6176 into main will increase coverage by 0.25%.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##            main   #6176      +/-   ##
========================================
+ Coverage   8.65%   8.91%   +0.25%     
========================================
  Files         99      99              
  Lines      17767   17821      +54     
========================================
+ Hits        1537    1588      +51     
- Misses     16073   16074       +1     
- Partials     157     159       +2     

@unknwon
Copy link
Member

unknwon commented May 28, 2020

Thanks for the PR!

image

This seems much more than needed?

@achilleas-k
Copy link
Contributor Author

image

That's mostly the last commit that regenerates static assets.

@unknwon
Copy link
Member

unknwon commented May 28, 2020

Can you fix it? I can’t view these diffs on GitHub UI. (What I meant was the numbers look wrong)

@unknwon
Copy link
Member

unknwon commented May 28, 2020

Please refer to https://github.com/gogs/gogs/blob/master/docs/dev/local_development.md and make sure you’re using the correct go-bindata. https://github.com/kevinburke/go-bindata

@achilleas-k
Copy link
Contributor Author

Hm, it's possible I did a full regen while switching branches. I'll clean it up and rebase.

@achilleas-k achilleas-k force-pushed the unlisted-repositories branch from f597682 to 6e899d5 Compare May 28, 2020 06:36
@achilleas-k
Copy link
Contributor Author

Regenerated only required _gen files with the proper go-bindata. Sorry about that.

@unknwon
Copy link
Member

unknwon commented Jun 11, 2020

Thanks for the follow up! I'll have this review when I have more bandwidth :)

@unknwon unknwon changed the base branch from master to main August 27, 2020 11:29
@boooong123
Copy link

When will this be live? Looks promising, just what a lot of people are looking for!

Thanks for adding this @achilleas-k

@unknwon unknwon added this to the 0.13 milestone Aug 30, 2020
Repositories are shown for users with access (owners, collaborators).
- Add to form (needs restyling)
- Trigger visibility change when Unlisted is toggled
- Copy Unlisted option when Forking and Migrating.
- Update forks with Unlisted state when changed.
- Change visibility of Actions when Unlisted state changes.
Visibility label for a box which includes Private and Unlisted options.
- Add option for creating repository as Unlisted on new repos and
  migrations.
- Transfer the Unlisted setting when forking.
Unlisted option in forms for new repositories, migrations, and forks
(read only).
Probably temporary.  Should use something more appropriate, like the
eye-closed from newer versions of octicon.
@unknwon
Copy link
Member

unknwon commented Aug 30, 2020

When will this be live? Looks promising, just what a lot of people are looking for!

Thanks for adding this @achilleas-k

@TheRealJP It is :) Can't guarantee when though, but just added to my current 0.13 pipeline.

@achilleas-k
Copy link
Contributor Author

Rebasing on main now to keep the PR up to date.

@achilleas-k achilleas-k force-pushed the unlisted-repositories branch from 6e899d5 to 22c9229 Compare August 30, 2020 12:37
Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that it's been a while! The code generally LGTM, just one little thing that we probably want to find a better icon later 😁 But not a blocker to me.

@unknwon unknwon linked an issue Sep 3, 2020 that may be closed by this pull request
@unknwon unknwon changed the title Unlisted, publicly accessible repositories repo: support unlisted but publicly accessible repositories Sep 3, 2020
@unknwon unknwon merged commit c436074 into gogs:main Sep 3, 2020
@unknwon
Copy link
Member

unknwon commented Sep 3, 2020

Thanks again and congrats!

@achilleas-k achilleas-k deleted the unlisted-repositories branch September 3, 2020 19:41
sandianyiyuan added a commit to sandianyiyuan/gogs that referenced this pull request Apr 26, 2022
更新未列出存储库的翻译配置  
gogs#5733  
gogs#6176
@sandianyiyuan sandianyiyuan mentioned this pull request Apr 26, 2022
3 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unlisted repositories

3 participants