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

Fix the wrong HTTP response status code for duplicate packages #27480

Merged
merged 16 commits into from
Oct 10, 2023

Conversation

lng2020
Copy link
Member

@lng2020 lng2020 commented Oct 6, 2023

fix #27470
(hope there is nothing missing 😢 )

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 6, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 6, 2023
@github-actions github-actions bot added type/docs This PR mainly updates/creates documentation modifies/api This PR adds API routes or modifies them topic/packages labels Oct 6, 2023
Copy link
Member

@delvh delvh left a comment

Choose a reason for hiding this comment

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

@KN4CK3R do you know if this breaks any package manager?

@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 Oct 6, 2023
@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 7, 2023

I only know about NuGet and Docker which really specify the HTTP status codes. All/most other clients just do a is not 2xx check.

@delvh
Copy link
Member

delvh commented Oct 7, 2023

In other words, it's not breaking. Great!

Copy link
Member

@KN4CK3R KN4CK3R left a comment

Choose a reason for hiding this comment

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

docs/content/usage/packages/cargo.en-us.md Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 7, 2023
@pull-request-size pull-request-size bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 8, 2023
@lng2020
Copy link
Member Author

lng2020 commented Oct 8, 2023

Update:

  1. for those who don't use curl to publish packages, simply delete the HTTP status code part
  2. align content in 400 bad request to "package is invalid" because there are so many parameters that can't be easily covered.

Copy link
Member

@KN4CK3R KN4CK3R left a comment

Choose a reason for hiding this comment

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

I'm not really a fan of the table alignment because that will be outdated sooner or later. And your alignment tool/script messed up whitespaces infront of links.

docs/content/usage/packages/container.en-us.md Outdated Show resolved Hide resolved
docs/content/usage/packages/generic.en-us.md Outdated Show resolved Hide resolved
docs/content/usage/packages/vagrant.en-us.md Outdated Show resolved Hide resolved
docs/content/usage/packages/pypi.en-us.md Outdated Show resolved Hide resolved
docs/content/usage/packages/nuget.en-us.md Outdated Show resolved Hide resolved
docs/content/usage/packages/alpine.en-us.md Outdated Show resolved Hide resolved
docs/content/usage/packages/alpine.en-us.md Show resolved Hide resolved
docs/content/usage/packages/alpine.en-us.md Outdated Show resolved Hide resolved
docs/content/usage/packages/debian.en-us.md Outdated Show resolved Hide resolved
docs/content/usage/packages/rpm.en-us.md Outdated Show resolved Hide resolved
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
@lng2020
Copy link
Member Author

lng2020 commented Oct 9, 2023

Thanks for your careful review.

Update:

  1. Add a new line between every If you are using 2FA... and You cannot ....
  2. Fix incorrect You cannot ... as reviewed above
  3. Add whitespace before link(sorry for the mess up due to my markdown viewer, I didn't notice it will auto format)

PS:
I tried to find out the lint rules for the markdown table but those rules(MD055, 056, 057) seem not suitable for my situation.

@techknowlogick
Copy link
Member

@lng2020 thank you for your PR!
I agree with @KN4CK3R in that formatting the tables in such a way will add additional manual work when editing (as unlike w/ go, there is no automatic formatting tool built in such a way as gofmt that has integration with IDEs).
Other than the tables, though, I'm happy to give this a +1 :)

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 10, 2023
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 10, 2023
@lng2020
Copy link
Member Author

lng2020 commented Oct 10, 2023

Update:
Revert the md table format introduced by my editor(sorry again)

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Oct 10, 2023
@KN4CK3R KN4CK3R added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 10, 2023
@KN4CK3R KN4CK3R merged commit 5b6258a into go-gitea:main Oct 10, 2023
25 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Oct 10, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 10, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 11, 2023
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Fix attachment download bug (go-gitea#27486)
  Make actions default enabled for newly created repository if global configuraion enabled (go-gitea#27482)
  Fix the wrong HTTP response status code for duplicate packages (go-gitea#27480)
  Increase queue length (go-gitea#27555)
@lng2020 lng2020 deleted the fix/http_status branch October 11, 2023 09:52
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jan 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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/docs size/M Denotes a PR that changes 30-99 lines, ignoring generated files. topic/packages type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] debian package repo: HTTP response status for duplicate package is 400, not 409
6 participants