Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Private README.md for organization #32872

Merged
merged 24 commits into from
Dec 31, 2024

Conversation

changchaishi
Copy link
Contributor

@changchaishi changchaishi commented Dec 17, 2024

Implemented #29503

Changes:

  1. Since individual users and organizations use the same .profile repository name for README.md, adding the private one, I rename the contexts with Public and Private inside them.
  2. I wanted to load the private profile the same as GitHub, which uses the view_as query parameter. Still, the existing query scheme is quite limited due to the integration with the search form and the repository paginator, so my workaround is to forcefully bring augmented query strings of member/public to the tmpl file.
  3. The drop-down is adopted from the search box's sort by component, we need to discuss the stylings.

Things lack and need further guidance (update: all done)

  1. At the create repository page, the ideal user experience is when the repo name is entered .profile the make repository private checkbox should be disabled and stay unchecked, whereas .profile-private, the checkbox should be disabled and force checked.
  2. Follow 1., Tool tips should be added.
  3. The translation and CSS for the current drop box and view as public/member feature.

Screenshots:

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 17, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 17, 2024
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels Dec 17, 2024
templates/org/home.tmpl Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 23, 2024
@changchaishi changchaishi marked this pull request as draft December 23, 2024 06:02
@changchaishi
Copy link
Contributor Author

changchaishi commented Dec 23, 2024

Hi, I listed the behaviors that this PR implemented as below:

  • hints to create .profile and .profile-private repos (if users do not follow the hint, profile may not show)

private_hint

  • view_as drop down only shows when the user is member in organization and both public and member profiles exist

only_shows_when_2_present

  • If there is no profile repo, not showing overview tab

no_profiles_no_overview

  • When user is a member of org and logged in, and only 1 profile is present, show that profile

public_only_show_public
private_shows_private

  • When user is not logged in, or not a member, only public profile will show if it is present

non_member_can_show

@changchaishi changchaishi marked this pull request as ready for review December 23, 2024 06:10
@wxiaoguang
Copy link
Contributor

Could you add some tests in tests/integration/org_*.go to verify the "view as public" and "view as member" outputs?

If I understand correctly: view as public: private repositories won't be listed.

@changchaishi
Copy link
Contributor Author

If I understand correctly: view as public: private repositories won't be listed.

In this design view as is only to select profiles. The permission system decides whether the doer can access the README.md. Nothing has changed.

So viewing as public does not mean that a member user will not see private repos listed if he/she already has permission.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Dec 27, 2024

If I understand correctly: view as public: private repositories won't be listed.

In this design view as is only to select profiles. The permission system decides whether the doer can access the README.md. Nothing has changed.

Maybe GitHub also changed their behavior: You are viewing the README and **pinned** repositories as a public user. vs You are viewing the README and repositories as a public user. I wouldn't say it is good but it doesn't block since GitHub does so.

While I still think it needs to add some tests in tests/integration/org_*.go to verify the "view as public" and "view as member" outputs, to cover the new code's behavior.

@changchaishi
Copy link
Contributor Author

While I still think it needs to add some tests in tests/integration/org_*.go to verify the "view as public" and "view as member" outputs, to cover the new code's behavior.

I'm working on it. Trying to get familiar with the integration tests.

@lunny lunny added this to the 1.24.0 milestone Dec 29, 2024
templates/repo/create.tmpl Outdated Show resolved Hide resolved
@wxiaoguang wxiaoguang linked an issue Dec 30, 2024 that may be closed by this pull request
@wxiaoguang wxiaoguang marked this pull request as ready for review December 30, 2024 15:25
@lunny
Copy link
Member

lunny commented Dec 31, 2024

Looks like the dropdown is not in the right place.

image

@wxiaoguang
Copy link
Contributor

Looks like the dropdown is not in the right place.

It is #32872 (comment) :

I think we need to move the view-as dropdown to the sidebar (just like GitHub) then we could have more spaces for hints and we could add more features to it in the future.

@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 31, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 31, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 31, 2024
@wxiaoguang wxiaoguang enabled auto-merge (squash) December 31, 2024 03:58
@wxiaoguang wxiaoguang added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 31, 2024
@wxiaoguang wxiaoguang merged commit 0387195 into go-gitea:main Dec 31, 2024
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 31, 2024
@wxiaoguang
Copy link
Contributor

Then we can add "org profile wiki" link easily: Add profile wiki to org home #32947

@wxiaoguang wxiaoguang mentioned this pull request Dec 31, 2024
@changchaishi changchaishi deleted the private-readme branch December 31, 2024 06:09
wxiaoguang added a commit that referenced this pull request Dec 31, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 2, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  unset XDG_HOME_CONFIG as gitea manages configuration locations (go-gitea#33067)
  Refactor repo-new.ts (go-gitea#33070)
  Refactor pull-request compare&create page (go-gitea#33071)
  feat: link to nuget dependencies (go-gitea#26554)
  Remove some unnecessary template helpers (go-gitea#33069)
  Inherit submodules from template repository content (go-gitea#16237)
  [skip ci] Updated translations via Crowdin
  feat(action): issue change title notifications (go-gitea#33050)
  Use project's redirect url instead of composing url (go-gitea#33058)
  Fix unittest and repo create bug (go-gitea#33061)
  Fix locale type (go-gitea#33059)
  Refactor maven package registry (go-gitea#33049)
  Optimize the installation page (go-gitea#32994)
  [Feature] Private README.md for organization (go-gitea#32872)
  Make issue suggestion work for new PR page (go-gitea#33035)
  Add IntelliJ Gateway's .uuid to gitignore (go-gitea#33052)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support a member-only organisation profile README
4 participants