summaryrefslogtreecommitdiffstats
path: root/models/action.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential bugs (#10513)65432020-02-271-1/+1
| | | | | | | * use e if it is an option * potential nil so check err first * check err first * m == nil already checked
* Show the username as a fallback on feeds if full name is blank (#10438)James Lakin2020-02-261-2/+5
| | | | | Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Ensure that feeds are appropriately restricted (#10018)zeripath2020-01-281-2/+2
| | | | | | | | | | * Always limit results by what is accessible to the user * Change signature of AccessibleRepoIDsQuery * Ensure that user with ID <= 0 is handled * Update models/repo_list.go
* Restricted users (#6274)Manush Dodunekov2020-01-131-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Restricted users (#4334): initial implementation * Add User.IsRestricted & UI to edit it * Pass user object instead of user id to places where IsRestricted flag matters * Restricted users: maintain access rows for all referenced repos (incl public) * Take logged in user & IsRestricted flag into account in org/repo listings, searches and accesses * Add basic repo access tests for restricted users Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Mention restricted users in the faq Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert unnecessary change `.isUserPartOfOrg` -> `.IsUserPartOfOrg` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Remove unnecessary `org.IsOrganization()` call Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert to an `int64` keyed `accessMap` * Add type `userAccess` * Add convenience func updateUserAccess() * Turn accessMap into a `map[int64]userAccess` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * or even better: `map[int64]*userAccess` * updateUserAccess(): use tighter syntax as suggested by lafriks * even tighter * Avoid extra loop * Don't disclose limited orgs to unauthenticated users * Don't assume block only applies to orgs * Use an array of `VisibleType` for filtering * fix yet another thinko * Ok - no need for u * Revert "Ok - no need for u" This reverts commit 5c3e886aabd5acd997a3b35687d322439732c200. Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Add owner_name column for table repository for maintaince reason (#9717)Lunny Xiao2020-01-121-1/+1
| | | | | | | | | | | | | | * Add owner_name column for table repository for maintaince reason * refactor * Fix tests * fix test * fix bug when fork repository Co-authored-by: zeripath <art27@cantab.net>
* Move push commits from models to modules/repository (#9370)Lunny Xiao2020-01-101-126/+0
| | | | | | | | | | | | | | | | * Move push commits from models to modules/repository * fix test * fix test * fix test * fix test * fix test Co-authored-by: zeripath <art27@cantab.net>
* Add ActionCommentPull action (#9456)mrsdizzie2019-12-221-0/+1
| | | | | | | | | | | * Add ActionCommentPull action Adds ActionCommentPull action to distinguish between a comment on an issue and on a pull request * Update modules/notification/action/action.go Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Move UpdateIssuesCommit from models to repofiles (#9276)Lunny Xiao2019-12-071-128/+0
|
* Fix permission checks for close/reopen from commit (#8875)guillep2k2019-11-151-16/+29
| | | | | * Fix checks for close/reopen from commit * Fix permission order
* Move transfer repository and rename repository on a service package and ↵Lunny Xiao2019-11-151-46/+0
| | | | | | | | | | | | | | | | | | | | | | start action notification (#8573) * move transfer repository and rename repository on a service package and start action notification * remove unused codes * fix lint * fix bugs * fix test * fix test * fix test * fix lint * update go mod and sum
* Update dashboard context for PR reviews (#8995)John Olheiser2019-11-151-20/+22
| | | | | | | | | | | | | | | | | | * Update dashboard context for PR reviews Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Only append head action if it has content or is approval/rejection Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Move some actions to notification/action (#8779)Lunny Xiao2019-11-081-43/+0
| | | | | | | | * Move some actions to notification/action * Fix test * fix test
* Move sync mirror actions to mirror service package (#8518)Lunny Xiao2019-10-161-74/+0
| | | | | | | | | | * move sync mirror actions to mirror service * fix go.mod * fix lint * fix lint
* Rewrite reference processing code in preparation for opening/closing from ↵guillep2k2019-10-131-140/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comment references (#8261) * Add a markdown stripper for mentions and xrefs * Improve comments * Small code simplification * Move reference code to modules/references * Fix typo * Make MarkdownStripper return [][]byte * Implement preliminary keywords parsing * Add FIXME comment * Fix comment * make fmt * Fix permissions check * Fix text assumptions * Fix imports * Fix lint, fmt * Fix unused import * Add missing export comment * Bypass revive on implemented interface * Move mdstripper into its own package * Support alphanumeric patterns * Refactor FindAllMentions * Move mentions test to references * Parse mentions from reference package * Refactor code to implement renderizable references * Fix typo * Move patterns and tests to the references package * Fix nil reference * Preliminary rendering attempt of closing keywords * Normalize names, comments, general tidy-up * Add CSS style for action keywords * Fix permission for admin and owner * Fix golangci-lint * Fix golangci-lint
* feat: highlight issue references with : (#8101)Rinat2019-09-051-1/+1
| | | | | | | | | | | * feat: highlight issue references with : e.g. #1287: my commit msg e.g. ABC-1234: my commit msg * ref: update model regex to consistent with issueNumericPattern * test: check highlight issue with : in commits messages
* Use gitea forked macaron (#7933)Tamal Saha2019-08-231-1/+1
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Add file status on API (#7671)Lunny Xiao2019-08-211-3/+16
| | | | | | | | | | * add file status on API * fix tests * fix tests * fix tests
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-151-4/+4
| | | | | | | | | | | | | | | | | | * 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
* Move commit repo action from models to repofiles package (#7645)Lunny Xiao2019-07-301-195/+3
| | | | | | * move commit repo action from models to repofiles package * fix unit tests
* SetDefaultBranch on pushing to empty repository (#7610)zeripath2019-07-301-0/+11
|
* Removed unnecessary conversions (#7557)Christian Muehlhaeuser2019-07-231-4/+4
| | | No need to convert to the same type.
* Fix regex for issues in commit messages (#7444)mrsdizzie2019-07-141-1/+2
| | | | | | | | | | * Fix regex for issues in commit messages Use same regex as markup for matching in commits. Fixes #7438 * make fmt
* Fix mirror sync not automatically sending webhook requests (#7366)Drew2019-07-061-0/+5
|
* Fix error log when loading issues caused by a xorm bug (#7271)Lunny Xiao2019-06-231-1/+1
| | | | | | | | | | | | * fix error log when loading issues caused by a xorm bug * upgrade packages * fix fmt * fix Consistency * fix tests
* Allow colon between fixing word and issue (#7207)zeripath2019-06-151-1/+1
| | | | | | * Allow colon between fixing word and issue * update test
* Move sdk structs to modules/structs (#6905)Lunny Xiao2019-05-111-1/+1
| | | | | | | | | | | | * move sdk structs to moduels/structs * fix tests * fix fmt * fix swagger * fix vendor
* Escape the commit message on issues update and title in telegram hook (#6901)zeripath2019-05-101-1/+2
|
* Show full name if DefaultShowFullName setting activated (#6710)Wim2019-05-081-0/+16
| | | | | Adds a new key DEFAULT_SHOW_FULL_NAME (default false) to the [ui] section. If enabled the full name will be shown (unless it's empty, then the default username will be used)
* Improve issue reference on commit (#6694)mrsdizzie2019-05-011-9/+85
| | | | | | | | | | | | | | * Improve issue reference on commit Allow commits to properly reference issues in other repositories and also to close/reopen those issues if user has code permission. Should match Github behavior described here: https://help.github.com/en/articles/closing-issues-using-keywords Fixes 6664 * Fix missing return * Match user/repo directly in regex
* Better logging (#6038) (#6095)zeripath2019-04-021-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move code.gitea.io/git to code.gitea.io/gitea/modules/git * fix imports * fix fmt * fix misspell * remove wrong tests data * fix unit tests * fix tests * fix tests * fix tests * fix tests * fix tests * enable Debug to trace the failure tests * fix tests * fix tests * fix tests * fix tests * fix tests * comment commit count tests since git clone depth is 50 * fix tests * update from code.gitea.io/git * revert change to makefile
* Copyedit docs (#6275)Aidan Fitzgerald2019-03-091-1/+1
|
* Add option to close issues via commit on a non master branch (#5992)Lanre Adelowo2019-02-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fixes #5957 * add tests to make sure config option is respected * use already defined struct * - use migration to make the flag repo wide not for the entire gitea instance Also note that the config value can still be set so as to be able to control the value for new repositories that are to be created - fix copy/paste error in copyright header year and rearrange import - use repo config instead of server config value to determine if a commit should close an issue - update testsuite * use global config only when creating a new repository * allow repo admin toggle feature via UI * fix typo and improve testcase * fix fixtures * add DEFAULT prefix to config value * fix test
* Automatically clear stopwatch on merging a PR (#4327)Lanre Adelowo2019-02-051-2/+14
| | | | | | | | | | | | | | | | | | | | * Don't display buttons if there are no notices * clear stopwatch on merging a PR * remove redundant gt check * use ctx.Flash as per @bkcsoft comment * stop timer on closing issues/PRs too * updated translation as per review * redirect to login page after successfully activating account * remove unrelated changes * stop timer for issues that are closed via commits too..Not just the 'close' UI button
* Refactor repo.isBare to repo.isEmpty #5629 (#5714)zeripath2019-01-171-4/+4
| | | | | | | | * Refactor repo.isBare to repo.isEmpty #5629 Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove Sync call
* Don't close issues via commits on non-default branch. (#5622)Harshit Bansal2019-01-041-39/+35
| | | | | | | | Adds a small check to close the issues only if the referencing commits are on the default branch. Fixes: #2314.
* Improve performance of dashboard (#4977)Lunny Xiao2018-12-131-13/+53
|
* Fix bug when repo remained bare if multiple branches pushed (#4923)SagePtr2018-09-131-2/+4
|
* Add push webhook support for mirrored repositories (#4127)Lauris BH2018-09-061-0/+68
|
* Added dependencies for issues (#2196) (#2531)kolaente2018-07-171-0/+4
|
* Implemented hover text showing user FullName (#4261)Guido Diepen2018-07-051-0/+6
| | | | | | | For each action that is displayed in either the public activity overview of a user, or in the dashboard overview, the link to the username is now extended with a title attribute to show the FullName as hover text Signed-off-by: Guido Diepen <site-github@guidodiepen.nl>
* Add more webhooks support and refactor webhook templates directory (#3929)Lunny Xiao2018-05-161-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | * add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * update vendor Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * load attributes when created release * update comparsion doc
* Set default branchname on first push (#3715)Bwko2018-03-251-1/+5
|
* refactor: reduce sql query in retrieveFeeds (#3547)Bo-Yi Wu2018-02-211-1/+10
|
* Refactor struct's time to remove unnecessary memory usage (#3142)Lunny Xiao2017-12-111-10/+5
| | | | | | | | | | | | | | * refactor struct's time to remove unnecessary memory usage * use AsTimePtr simple code * fix tests * fix time compare * fix template on gpg * use AddDuration instead of Add
* Fix ref parsing in commit messages (#3067)Ethan Koenig2017-12-031-70/+57
|
* Use RelAvatarLink() in GetActAvatar() (#2800)cstyles2017-10-311-1/+1
|
* Use AfterLoad instead of AfterSet on Structs (#2628)Lunny Xiao2017-10-011-7/+3
| | | | | | | | * use AfterLoad instead of AfterSet on Structs * fix the comments on AfterLoad * fix the comments on action AfterLoad
* Complete push webhooks (#2530)David Schneiderbauer2017-09-211-16/+41
| | | | | | | | | | | | | | | | | * implemented missing 'delete' push webhooks moreover created ActionDeleteBranch and ActionDeleteTag * add CommitRepoAction tests for tag/branch creation/deletion * fixed error where push webhook not called if is new branch or tag removed unnecessary code * moved prepare unit test environment into separate method to be used across unit tests * add missing if clause in pushUpdate Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
* Use named ActionType constants in template helper (#2545)Ethan Koenig2017-09-201-3/+2
|