-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Do not force creation of _cargo-index repo on publish #27266
Conversation
I noticed in a instance of mine that a |
Hello, from what I understood only 3 actions can trigger the repo creation: cargo publish or use of the Settings > Packages > Initialize/Rebuild Index. |
Ah, yes it might have been the |
Could we know the protocol of the client side? maybe we should obey the client side protocol to do that. Sparse or not. |
We can't know this this unfortunately, I think we should push users toward using exclusively httpregistry, maybe remove all instructions to setup git registry and make it optional, then disable it entirely in a future version ? |
I would like the idea. As this PR, maybe we can have an option to enable/disable git registry. Maybe the default value could be |
I think this is basically what this PR does: users will have to click "Init Index" in the org/user package settings to have the registry enabled. They can just remove the repo if they no longer want to use git registry and it should not create it again. Please note that the authorization support for the cargo registry just made it to the nightly branch (on the client) so there should not be too much gitea users using this package registry yet, so we can probably remove the git version before too much people start using it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change the method name from AddOrUpdatePackageIndex
to just UpdatePackageIndex
then? (or a better name? TryUpdatePackageIndex
, UpdateExistingPackageIndex
, ...?)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Thanks for the feedback, I renamed it to UpdatePackageIndexIfExists. |
Hello there, Cargo Index over HTTP is now prefered over git for package updates: we should not force users who do not need the GIT repo to have the repo created/updated on each publish (it can still be created in the packages settings). The current behavior when publishing is to check if the repo exist and create it on the fly if not, then update it's content. Cargo HTTP Index does not rely on the repo itself so this will be useless for everyone not using the git protocol for cargo registry. This PR only disable the creation on the fly of the repo when publishing a crate. This is linked to go-gitea#26844 (error 500 when trying to publish a crate if user is missing write access to the repo) because it's now optional. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* giteaofficial/main: Do not force creation of _cargo-index repo on publish (go-gitea#27266) Upgrade to golangci-lint@v1.55.0 (go-gitea#27756) Fix incorrect "tab" parameter for repo search sub-template (go-gitea#27755) Fix label render containing invalid HTML (go-gitea#27752) Fix duplicate project board when hitting `enter` key (go-gitea#27746) Fix `link-action` redirect network error (go-gitea#27734)
Backport #27266 by @merlleu Hello there, Cargo Index over HTTP is now prefered over git for package updates: we should not force users who do not need the GIT repo to have the repo created/updated on each publish (it can still be created in the packages settings). The current behavior when publishing is to check if the repo exist and create it on the fly if not, then update it's content. Cargo HTTP Index does not rely on the repo itself so this will be useless for everyone not using the git protocol for cargo registry. This PR only disable the creation on the fly of the repo when publishing a crate. This is linked to #26844 (error 500 when trying to publish a crate if user is missing write access to the repo) because it's now optional. Co-authored-by: merlleu <r.langdorph@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Hello there, Cargo Index over HTTP is now prefered over git for package updates: we should not force users who do not need the GIT repo to have the repo created/updated on each publish (it can still be created in the packages settings). The current behavior when publishing is to check if the repo exist and create it on the fly if not, then update it's content. Cargo HTTP Index does not rely on the repo itself so this will be useless for everyone not using the git protocol for cargo registry. This PR only disable the creation on the fly of the repo when publishing a crate. This is linked to go-gitea#26844 (error 500 when trying to publish a crate if user is missing write access to the repo) because it's now optional. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Hello there,
Cargo Index over HTTP is now prefered over git for package updates: we should not force users who do not need the GIT repo to have the repo created/updated on each publish (it can still be created in the packages settings).
The current behavior when publishing is to check if the repo exist and create it on the fly if not, then update it's content.
Cargo HTTP Index does not rely on the repo itself so this will be useless for everyone not using the git protocol for cargo registry.
This PR only disable the creation on the fly of the repo when publishing a crate.
This is linked to #26844 (error 500 when trying to publish a crate if user is missing write access to the repo) because it's now optional.