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: switch visibility with update_repo_settings #2537

Closed
Wauplin opened this issue Sep 13, 2024 · 2 comments
Closed

Feature: switch visibility with update_repo_settings #2537

Wauplin opened this issue Sep 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Wauplin
Copy link
Contributor

Wauplin commented Sep 13, 2024

Follow-up PR after #2502.

Now that we have a generic update_repo_settings, we can add the option to switch visibility status of a repo. This would be a drop-in replacement for update_repo_visibility:

- update_repo_visibility(repo_id, private=True)
+ update_repo_settings(repo_id, private=True)

TODO:

  • add a private attribute to update_repo_settings
  • make both gated and private attributes optional (default to None)
  • check update_repo_settings inputs => either gated is passed, or private, or both. If both gated and private are None, raise a ValueError.
  • add gated and private to the request payload only if not None
  • update update_repo_settings docstring
  • update all references of update_repo_visibility in docs
  • add @_deprecate_method decorator to update_repo_visibility (will be removed in 0.29.x)
@WizKnight
Copy link
Contributor

Hey @Wauplin :), I'd be happy to take on this PR!😊

Wauplin added a commit that referenced this issue Sep 26, 2024
* Enhance `update_repo_settings` to manage repo visibility

* Enhance `update_repo_settings` to manage repo visibility

* Enhance `update_repo_settings` to manage repo visibility

* Enhance `update_repo_settings` to manage repo visibility

* Enhance `update_repo_settings` to manage repo visibility

* Apply suggestions from code review

---------

Co-authored-by: Lucain <lucainp@gmail.com>
@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 26, 2024

Closed by #2502 and #2541 from @WizKnight !

@Wauplin Wauplin closed this as completed Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants