-
Notifications
You must be signed in to change notification settings - Fork 0
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
expansion of gitea api to handle crud operations for projects #1
base: main
Are you sure you want to change the base?
Conversation
We have some instances that only allow using an external authentication source for authentication. In this case, users changing their email, password, or linked OpenID connections will not have any effect, and we'd like to prevent showing that to them to prevent confusion. Included in this are several changes to support this: * A new setting to disable user managed authentication credentials (email, password & OpenID connections) * A new setting to disable user managed MFA (2FA codes & WebAuthn) * Fix an issue where some templates had separate logic for determining if a feature was disabled since it didn't check the globally disabled features * Hide more user setting pages in the navbar when their settings aren't enabled --------- Co-authored-by: Kyle D <kdumontnu@gmail.com>
…#31564) Gitea 1.22.1 was supposed to allow for team names of length 255 (up from 30) after the following PR was merged in: go-gitea#31410. However, the length of team names was still limited to 30 as described in this issue: go-gitea#31554. One more change to _gitea_ needs to be made to allow for the longer team names, as there is a 30 character limit here: https://github.com/go-gitea/gitea/blob/2c92c7c5226e29636a1d47a277130f477fa2037b/services/forms/org.go#L65 This PR changes that value to 255.
A more complete fix for go-gitea#31588 1. Make "generic" code more readable 2. Clarify HTML or Markdown for the payload content
Adds types for `window.config` and jQuery/htmx globals, eliminating 48 `tsc` errors.
Result of `make update-js`. Tested all dependencies. Lockfile diff is because of npm/cli#7475.
I changed the title of the registation email from "Welcome to Gitea" to "Welcome to (appname)". I did this by substituting 'Gitea' in register_notify to %s and formating the registration title in mail.go. I changed this for all the languages I could, but I struggled to changed the translation file for Farsi. I have attached the screenshots of before and after and the related issue below. Related issue: go-gitea#31108 Before change: ![Screenshot from 2024-07-04 22-32-17](https://github.com/go-gitea/gitea/assets/94445569/4178b51c-1acc-45f4-9750-dff41564a709) After: ![Screenshot from 2024-07-04 22-32-01](https://github.com/go-gitea/gitea/assets/94445569/9cd7a58d-c0f5-4a3c-a66c-805c55411eaa) --------- Signed-off-by: Sunny Wan <Sunnywan2020@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
…ts and crud operations create endpoints for each operation in the web router and corresponding handler and tested them manually
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.
good job ya eyad. i have some comments/questions.
services/convert/project.go
Outdated
|
||
// ToProject converts a models.Project to api.Project | ||
func ToProject(ctx context.Context, project *project_model.Project) *api.Project { | ||
if project == nil { |
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.
why it could be nil? this validation should be outside of this function
routers/api/v1/api.go
Outdated
@@ -942,6 +1017,127 @@ func Routes() *web.Router { | |||
}, context.UserAssignmentAPI(), individualPermsChecker) | |||
}, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryUser)) | |||
|
|||
// Users (requires user scope) | |||
m.Group("users/{username}/-", func() { |
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.
/users
?
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.
note to discuss:
in web it is structured like this:
/{username}/{reponame}/project
for repo projects/{username}/-/project
for individual projects
username is either a user or org
) | ||
|
||
// CreateProject creates a new project | ||
func CreateProject(ctx *context.APIContext) { |
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.
How much is the difference between these handlers and the handlers for the repo/project? if not much we could move the logic to a util functions and wrap it by handles for both org/repo projects
edit project api response format to include more fields
Replace go-gitea#32001. To prevent the context cache from being misused for long-term work (which would result in using invalid cache without awareness), the context cache is designed to exist for a maximum of 10 seconds. This leads to many false reports, especially in the case of slow SQL. This PR increases it to 5 minutes to reduce false reports. 5 minutes is not a very safe value, as a lot of changes may have occurred within that time frame. However, as far as I know, there has not been a case of misuse of context cache discovered so far, so I think 5 minutes should be OK. Please note that after this PR, if warning logs are found again, it should get attention, at that time it can be almost 100% certain that it is a misuse.
…o-gitea#31852) This will allow instance admins to view signup pattern patterns for public instances. It is modelled after discourse, mastodon, and MediaWiki's approaches. Note: This has privacy implications, but as the above-stated open-source projects take this approach, especially MediaWiki, which I have no doubt looked into this thoroughly, it is likely okay for us, too. However, I would be appreciative of any feedback on how this could be improved. --------- Co-authored-by: Giteabot <teabot@gitea.io>
Close go-gitea#31801. Follow go-gitea#31761. Since there are so many benefits of compression and there are no reports of related issues after weeks, it should be fine to enable compression by default.
This PR adds support for migrating repos from [AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html). The access key ID and secret access key are required to get repository information and pull requests. And [HTTPS Git credentials](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html) are required to clone the repository. <img src="https://github.com/user-attachments/assets/82ecb2d0-8d43-42b0-b5af-f5347a13b9d0" width="680" /> The AWS CodeCommit icon is from [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/). <img src="https://github.com/user-attachments/assets/3c44d21f-d753-40f5-9eae-5d3589e0d50d" width="320" />
…ng `previous_filename` (go-gitea#32017) --- `status == "rename"` should have read `status == "renamed"`. The typo means that file.PreviousFilename would never be populated, which e.g. breaks usage of the Github Action at https://github.com/dorny/paths-filter.
PR for issue go-gitea#31968 Replaces PR go-gitea#31983 to comply with gitea's error definition Failed authentications are now logged to level `Warning` instead of `Info`.
) Works in both organization and repository project boards Fixes go-gitea#21846 Replaces go-gitea#21963 Replaces go-gitea#27117 ![image](https://github.com/user-attachments/assets/1837ace8-3de2-444f-a153-e166bd0da2c0) **Note** that implementation was made intentionally to work same as in issue list so that URL can be bookmarked for quick access with predefined filters in URL
A 500 status code was thrown when passing a non-existent target to the create release API. This snapshot handles this error and instead throws a 404 status code. Discovered while working on go-gitea#31840.
…o-gitea#31726) In Projects, columns heights are defined by the sum of all contents height of the biggest column, rather than a fraction of the viewport height. It default to 60vh when there is no cards to display. Fix go-gitea#31666
Fixes go-gitea#32021 Do not escape the relative path.
Resolves go-gitea#31998 The first screenshot shows the tag page without any filter being applied: ![image](https://github.com/user-attachments/assets/eac0e51c-9e48-42b2-bb1c-a25896ca40cb) The second one, shows the page when the given filter returns no tag: ![image](https://github.com/user-attachments/assets/98df191e-1a7b-4947-b0ef-4987a0293c3e) The last one shows a single tag being filtered: ![image](https://github.com/user-attachments/assets/79c7e05e-8c86-4f06-b17e-15818b7b9291) Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com>
Fixes go-gitea#31937 - Add missing comment reply handling - Use `onGiteaRun` in the test because the fixtures are not present otherwise (did this behaviour change?) Compare without whitespaces.
Remove unused CSRF options, decouple "new csrf protector" and "prepare" logic, do not redirect to home page if CSRF validation falis (it shouldn't happen in daily usage, if it happens, redirecting to home doesn't help either but just makes the problem more complex for "fetch")
…2073) A regression in go-gitea#31924 caused there to be two `issues.review.comment` keys in the English language locale file, leading to a problem when reading PR review histories that contain comments. This snapshot addresses this by making the newer key unique.
…go-gitea#32040) link: https://codeberg.org/forgejo/forgejo/issues/4274 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
pr for threefoldtech/home#1558