* Add API for Repo Advanced Settings of wiki and issue tracker
Signed-off-by: David Svantesson <[email protected]>
* Add some integration tests for tracker and wiki settings through API
* Should return StatusUnprocessableEntity in case of invalid API values.
* Add tests for invalid URLs for external tracker and wiki.
* Do not set inital values if they are default of type
* Make issue tracker and wiki units separate structures in Repository API structure.
Signed-off-by: David Svantesson <[email protected]>
* Fix comment of structures
Signed-off-by: David Svantesson <[email protected]>
* Rewrite API to use struct for setting tracker and wiki settings.
* LetOnlyContributorsTrackTime -> AllowOnlyContributorsToTrackTime
* Api endpoint for searching teams.
Signed-off-by: dasv <[email protected]>
* Move API to /orgs/:org/teams/search
Signed-off-by: David Svantesson <[email protected]>
* Regenerate swagger
Signed-off-by: David Svantesson <[email protected]>
* Fix search is Get
Signed-off-by: David Svantesson <[email protected]>
* Add test for search team API.
Signed-off-by: David Svantesson <[email protected]>
* Update routers/api/v1/org/team.go
grammar
Co-Authored-By: Richard Mahn <[email protected]>
* Fix review comments
Signed-off-by: David Svantesson <[email protected]>
* Fix some issues in repo collaboration team search, after changes in this PR.
Signed-off-by: David Svantesson <[email protected]>
* Remove teamUser which is not used and replace with actual user id.
Signed-off-by: David Svantesson <[email protected]>
* Remove unused search variable UserIsAdmin.
* Add paging to team search.
* Re-genereate swagger
Signed-off-by: David Svantesson <[email protected]>
* Fix review comments
Signed-off-by: David Svantesson <[email protected]>
* fix
* Regenerate swagger
* Add logging for when user requested attachment doesn't belong to the specified release.
* Fix API to use correct variable for release asset (attachment)
* extract actions on new pull request from models to pulls service
* improve code
* move code.gitea.io/gitea/modules/pull to code.gitea.io/gitea/services/pull
* fix fmt
* Rename pulls.go to pull.go
* move all mail related codes from models to modules/mailer
* fix lint
* use DBContext instead Engine
* use WithContext not WithEngine
* Use DBContext instead of Engine
* don't use defer when sess.Close()
* move DBContext to context.go and add some methods
* move mailer from modules/ to services
* fix lint
* fix tests
* fix fmt
* add gitea copyright
* fix tests
* don't expose db functions
* make code clear
* add DefaultDBContext
* fix build
* fix bug
* Add teams to repo on collaboration page.
Signed-off-by: David Svantesson <[email protected]>
* Add option for repository admins to change teams access to repo.
Signed-off-by: David Svantesson <[email protected]>
* Add comment for functions
Signed-off-by: David Svantesson <[email protected]>
* Make RepoAdminChangeTeamAccess default false in xorm and make it default checked in template instead.
Signed-off-by: David Svantesson <[email protected]>
* Make proper language strings and fix error redirection.
* Add unit tests for adding and deleting team from repository.
Signed-off-by: David Svantesson <[email protected]>
* Add database migration
Signed-off-by: David Svantesson <[email protected]>
* Fix redirect
Signed-off-by: David Svantesson <[email protected]>
* Fix locale string mismatch.
Signed-off-by: David Svantesson <[email protected]>
* Move team access mode text logic to template.
* Move collaborator access mode text logic to template.
* refuse merge until ci successfully
* deny merge request when required status checkes not succeed on merge Post and API
* add database migration for added columns on protected_branch
* fix migration
* fix protected branch check bug
* fix protected branch settings
* remove duplicated code on check pull request's required commit statuses pass
* remove unused codes
* fix migration
* add newline for template file
* fix go mod
* rename function name and some other fixes
* fix template
* fix bug pull view
* remove go1.12 wrong dependencies
* add administrator bypass when protected branch status check enabled
* fix bug
* improve the codes
* move create release from models to a standalone package
* fix lint
* fix comment year
* fix lint
* fix lint
* fix package import name
* fix vendor
* fix go mod
* some refactors
* fix vendor
* use go1.12 make vendor
* fix vendor
* Create API endpoints for repo topics.
Signed-off-by: David Svantesson <[email protected]>
* Generate swagger
Signed-off-by: David Svantesson <[email protected]>
* Add documentation to functions
Signed-off-by: David Svantesson <[email protected]>
* Grammar fix
Signed-off-by: David Svantesson <[email protected]>
* Fix function comment
Signed-off-by: David Svantesson <[email protected]>
* Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match
Signed-off-by: David Svantesson <[email protected]>
* Add PUT /repos/{owner}/{repo}/topics and remove GET /repos/{owner}/{repo}/topics
* Ignore if topic is sent twice in same request, refactoring.
Signed-off-by: David Svantesson <[email protected]>
* Fix topic dropdown with api changes.
Signed-off-by: David Svantesson <[email protected]>
* Style fix
Signed-off-by: David Svantesson <[email protected]>
* Update API documentation
Signed-off-by: David Svantesson <[email protected]>
* Better way to handle duplicate topics in slice
Signed-off-by: David Svantesson <[email protected]>
* Make response element TopicName an array of strings, instead of using an array of TopicName
Signed-off-by: David Svantesson <[email protected]>
* Add test cases for API Repo Topics.
Signed-off-by: David Svantesson <[email protected]>
* Fix format of tests
Signed-off-by: David Svantesson <[email protected]>
* Fix comments
Signed-off-by: David Svantesson <[email protected]>
* Fix unit tests after adding some more topics to the test fixture.
Signed-off-by: David Svantesson <[email protected]>
* Update models/topic.go
Limit multiple if else if ...
Co-Authored-By: Antoine GIRARD <[email protected]>
* Engine as first parameter in function
Co-Authored-By: Antoine GIRARD <[email protected]>
* Replace magic numbers with http status code constants.
Signed-off-by: David Svantesson <[email protected]>
* Fix variable scope
Signed-off-by: David Svantesson <[email protected]>
* Test one read with login and one with token
Signed-off-by: David Svantesson <[email protected]>
* Add some more tests
Signed-off-by: David Svantesson <[email protected]>
* Apply suggestions from code review
Use empty struct for efficiency
Co-Authored-By: Lauris BH <[email protected]>
* Add test case to check access for user with write access
Signed-off-by: David Svantesson <[email protected]>
* Fix access, repo admin required to change topics
Signed-off-by: David Svantesson <[email protected]>
* Correct first test to be without token
Signed-off-by: David Svantesson <[email protected]>
* Any repo reader should be able to access topics.
* No need for string pointer
Signed-off-by: David Svantesson <[email protected]>
* Add description in repository search.
Signed-off-by: David Svantesson <[email protected]>
* Refactor SearchRepositoryByName with a general function SearchRepository
Signed-off-by: David Svantesson <[email protected]>
* Allow to specify if description shall be included in API repo search.
Signed-off-by: David Svantesson <[email protected]>
* Add new app.ini setting for whether to search within repo description.
Signed-off-by: David Svantesson <[email protected]>
* Search keyword in description (if setting enabled) on:
- Explore page
- Organization profile page
- User profile page
- Admin repo page
Do not search keyword in description on:
- Any non-keyword search (not relevant)
- Incremental search (uses API)
Signed-off-by: David Svantesson <[email protected]>
* Put parameters related to keyword directly after it
Signed-off-by: David Svantesson <[email protected]>
* Add test cases for including (and not including) repository description in search.
Signed-off-by: David Svantesson <[email protected]>
* Rename test function from TestSearchRepositoryByName to TestSearchRepository.
Signed-off-by: David Svantesson <[email protected]>
* Make setting SEARCH_REPO_DESCRIPTION default to true
Signed-off-by: David Svantesson <[email protected]>
* display ui time with customize time location
* fix lint
* rename UILocation to DefaultUILocation
* move time related functions to modules/timeutil
* fix tests
* fix tests
* fix build
* fix swagger
when you use gitea as OAuth2 provider, the /api/v1/user should return
user primary email as identifier, which is unique in OAuth2 clients.
this patch use convert.ToUser replace all u.APIFormat in api requests,
return primary email when caller is yourself or admin.
On merge we walk the merge history and ensure that all lfs objects pointed to in
the history are added to the base repository. This switches from relying on having git-lfs installed on the server, (and in fact .gitattributes being correctly installed.)
* Fixes#2738 - /git/tags API
* proper URLs
* Adds function comments
* Updates swagger
* Removes newline from tag message
* Removes trailing newline from commit message
* Adds integration test
* Removed debugging
* Adds tests
* Fixes bug where multiple tags of same commit show wrong tag name
* Fix formatting
* Removes unused varaible
* Fix to annotated tag function names and response
* Update modules/git/repo_tag.go
Co-Authored-By: Lauris BH <[email protected]>
* Uses TagPrefix
* Changes per review, better error handling for getting tag and commit IDs
* Fix to getting commit ID
* Fix to getting commit ID
* Fix to getting commit ID
* Fix to getting commit ID
* Supports tags when comparing commits or branches
Signed-off-by: Mario Lubenka <[email protected]>
* Hide headline when only comparing and don't load unused data
Signed-off-by: Mario Lubenka <[email protected]>
* Merges compare logics to allow comparing branches, commits and tags with eachother
Signed-off-by: Mario Lubenka <[email protected]>
* Display branch or tag instead of commit when used for comparing
Signed-off-by: Mario Lubenka <[email protected]>
* Show pull request form after click on button
Signed-off-by: Mario Lubenka <[email protected]>
* Transfers relevant pull.go changes from master to compare.go
Signed-off-by: Mario Lubenka <[email protected]>
* Fixes error when comparing forks against a commit or tag
Signed-off-by: Mario Lubenka <[email protected]>
* Removes console.log from JavaScript file
Signed-off-by: Mario Lubenka <[email protected]>
* Show icon next to commit reference when comparing branch or tag
Signed-off-by: Mario Lubenka <[email protected]>
* Updates css file
Signed-off-by: Mario Lubenka <[email protected]>
* Fixes import order
* Renames template variable
* Update routers/repo/compare.go
Co-Authored-By: zeripath <[email protected]>
* Update from master
Signed-off-by: Mario Lubenka <[email protected]>
* Allow short-shas in compare
* Renames prInfo to compareInfo
Signed-off-by: Mario Lubenka <[email protected]>
* Check PR permissions only if compare is pull request
Signed-off-by: Mario Lubenka <[email protected]>
* Adjusts comment
Signed-off-by: Mario Lubenka <[email protected]>
* Use compareInfo instead of prInfo
* Feature - #5960 - API Endpoint for Repo Editing
* Revert from merge
* Adds integration testing
* Updates to integration tests
* Revert changes
* Update year in file header
* Misspell fix
* XORM = test
* XORM = test
* revert XORM = file
* Makes RepoUnit.ID be pk and autoincr
* Fix to units
* revert header
* Remove print statement
* Adds other responses
* Improves swagger for creating repo
* Fixes import order
* Better Unit Type does not exist error
* Adds editable repo properties to the response repo structure
* Fix to api_repo_edit_test.go
* Fixes repo test
* Changes per review
* Fixes typo and standardizes comments in the EditRepoOption struct for swagger
* Fixes typo and standardizes comments in the EditRepoOption struct for swagger
* Actually can unarchive through the API
* Unlike delete, user doesn't have to be the owner of the org, just admin to the repo
* Fix to swagger comments for field name change
* Update to swagger docs
* Update swagger
* Changes allow_pull_requests to has_pull_requests