Commit Graph

50 Commits

Author SHA1 Message Date
GitLab Bot 71da5de44f Add latest changes from gitlab-org/gitlab@master 2020-08-05 15:09:59 +00:00
GitLab Bot 8827c1d184 Add latest changes from gitlab-org/gitlab@master 2020-07-27 12:09:50 +00:00
GitLab Bot 6cf1f4c521 Add latest changes from gitlab-org/gitlab@master 2020-06-16 09:08:27 +00:00
GitLab Bot 0f59ad0c29 Add latest changes from gitlab-org/gitlab@master 2020-04-28 09:09:34 +00:00
GitLab Bot e33f87ac0f Add latest changes from gitlab-org/gitlab@master 2020-04-21 15:21:10 +00:00
GitLab Bot 32fd4cd5e2 Add latest changes from gitlab-org/gitlab@master 2020-02-25 21:09:23 +00:00
GitLab Bot eac0da9a47 Add latest changes from gitlab-org/gitlab@master 2019-11-29 15:06:43 +00:00
GitLab Bot d15180e00b Add latest changes from gitlab-org/gitlab@master 2019-11-06 09:06:23 +00:00
GitLab Bot 133924c6cc Add latest changes from gitlab-org/gitlab@master 2019-10-11 00:06:24 +00:00
GitLab Bot bd860c22f6 Add latest changes from gitlab-org/gitlab@master 2019-09-17 12:06:48 +00:00
GitLab Bot b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
charlieablett c3c84ff8ea Tidy up conditional message 2019-09-02 17:52:11 +12:00
charlieablett 23bb9424c0 Handle projectless `help` commands to chatops
- Pass in a nil project to Gitlab::SlashCommands::ApplicationHelp.new
if the chatops command is help.
- Modify the Gitlab::SlashCommands::Presenters::Help message to skip
printing out project information.
2019-09-02 17:35:45 +12:00
Nick Thomas a8a10a0038 Merge branch 'improve-chatops-help' into 'master'
Improve chatops help output

See merge request gitlab-org/gitlab-ce!32208
2019-09-01 12:42:22 +00:00
Sarah Yasonik 94720682a1 Add a close issue slack slash command
Adds a slash command in slach for closing issues. See
https://docs.gitlab.com/ee/integration/slash_commands.html
for documentation on the wider feature set.
2019-08-29 20:27:38 +00:00
Yorick Peterse e8dd299e7c
Improve chatops help output
This improves the output produced when running an unknown command,
running the "help" command, and when trying to run a command you are not
allowed to run. The new help output includes links to the project of the
chatops integration, and a link to the chatops documentation.
2019-08-29 16:11:42 +02:00
Stan Hu f93b2e02a5 Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
James Fargher 2d19b1adef Move ChatOps to Core
ChatOps used to be in the Ultimate tier.
2019-02-20 21:29:48 +00:00
gfyoung f93f8f569d Enable even more frozen string for lib/gitlab
Enables frozen string for the following:

* lib/gitlab/patch/**/*.rb
* lib/gitlab/popen/**/*.rb
* lib/gitlab/profiler/**/*.rb
* lib/gitlab/project_authorizations/**/*.rb
* lib/gitlab/prometheus/**/*.rb
* lib/gitlab/query_limiting/**/*.rb
* lib/gitlab/quick_actions/**/*.rb
* lib/gitlab/redis/**/*.rb
* lib/gitlab/request_profiler/**/*.rb
* lib/gitlab/search/**/*.rb
* lib/gitlab/sherlock/**/*.rb
* lib/gitlab/sidekiq_middleware/**/*.rb
* lib/gitlab/slash_commands/**/*.rb
* lib/gitlab/sql/**/*.rb
* lib/gitlab/template/**/*.rb
* lib/gitlab/testing/**/*.rb
* lib/gitlab/utils/**/*.rb
* lib/gitlab/webpack/**/*.rb

Partially addresses gitlab-org/gitlab-ce#47424.
2018-11-19 18:24:22 -08:00
George Tsiolis 733ae94921 Fix typos in comments and specs 2018-11-01 08:59:20 +02:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Robert Speicher c9ecf49d8c
Correct "autorize" typos 2018-06-27 15:16:18 -05:00
Mark Chao 4f20bf956a Backport EE SlashCommand Refactor 2018-06-04 12:42:02 +00:00
Sean McGivern 0fa139dfda Add slash command for moving an issue
Carried over from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8857
2018-03-15 13:09:11 +00:00
Gabriel Mazetto 5c7a738105 [CE] Add Naming/FileName rule checking expected class/module per filename 2018-03-08 12:56:54 +00:00
Dmitriy Zaporozhets aeab4e6263
Use Project#full_name instead of name_with_namespace
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-03-07 16:07:09 +02:00
Yorick Peterse 57719d34d3
Expose ChatName objects to slash commands
Instead of only exposing a User to slash commands we now also expose the
ChatName object that the User object is retrieved from. This is
necessary for GitLab Chatops as we need for example the user ID of the
chat user.
2018-02-23 14:37:53 +01:00
Lin Jen-Shin 9ac0c76b78 Use StrongMemoize and enable/disable cops properly 2017-11-18 01:01:53 +08:00
Lin Jen-Shin 6a4ee9aa71 Allow simple ivar ||= form. Update accordingly 2017-09-19 01:29:32 +08:00
Lin Jen-Shin 9ae92b8caa Add cop to make sure we don't use ivar in a module 2017-09-18 21:23:45 +08:00
Robert Speicher 4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Grzegorz Bizon 07bcabb305 Improve wording related to deploy chatops command 2017-07-28 12:16:07 +02:00
Grzegorz Bizon 29a8827752 Improve deploy environment chatops slash command
We now match deployment actions better. If there is more than one
deployment action matched, we check if there is an action which name
equals to environment name, instead of raising an error about too many
actions defined.
2017-07-28 10:56:50 +02:00
Jarka Kadlecova 7bee7b848a Support both internal and external issue trackers 2017-07-24 08:13:43 +02:00
Douwe Maan c81928cfa7 Include new URL helpers retroactively into includers of Gitlab::Routing 2017-07-07 10:43:37 -05:00
Eric Eastwood ea090291bb Rename "Slash commands" to "Quick actions"
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/27070

Deprecate "chat commands" in favor of "slash commands"

We looked for things like:

 - `slash commmand`
 - `slash_command`
 - `slash-command`
 - `SlashCommand`
2017-06-15 09:01:56 -05:00
Valery Sizov 223b87d7b1 Backport Fix '/unassign' slash command 2017-06-07 09:47:26 +03:00
Rares Sfirlogea 45e4c66565 Display slash commands outcome when previewing Markdown
Remove slash commands from Markdown preview and display their outcome next to
the text field.
Introduce new "explanation" block to our slash commands DSL.
Introduce optional "parse_params" block to slash commands DSL that allows to
process a parameter before it is passed to "explanation" or "command" blocks.
Pass path for previewing Markdown as "data" attribute instead of setting
a variable on "window".
2017-05-04 17:02:25 +02:00
Rémy Coutable 5a0027236b
Allow slashes in slash command arguments
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-02-17 10:34:43 +01:00
Douwe Maan 2703330a19 Fix behavior around commands with optional arguments 2016-08-18 14:29:49 -05:00
Douwe Maan 3e7eeefc93 Address feedback 2016-08-17 18:58:44 -05:00
Douwe Maan 8b8a4626c6 Fix specs and implement fixes based on failing specs 2016-08-17 17:54:24 -05:00
Douwe Maan 029b7d2e92 Fixed specs and fixes based on failing specs 2016-08-16 17:42:34 -05:00
Douwe Maan 5a07b760df Refactor slash command definition 2016-08-12 20:17:18 -05:00
Rémy Coutable f393f2dde0
Simplify the slash commands DSL to store action blocks instead of creating methods
Other improvements:
- Ensure slash commands autocomplete doesn't break when noteable_type is not given
- Slash commands: improve autocomplete behavior and /due command
- We don't display slash commands for note edit forms.
- Add tests for reply by email with slash commands
- Be sure to execute slash commands after the note creation in Notes::CreateService

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:36:47 +02:00
Rémy Coutable 42e30a5012 Accept blocks for `.desc` and `.condition` slash commands DSL
Also, pass options as instance variables, making the DSL more
user-friendly / natural.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 65349c2212 Make slash commands contextual
- Return only slash commands that make sense for the current noteable
- Allow slash commands decription to be dynamic

Other improvements:

- Add permission checks in slash commands definition
- Use IssuesFinder and MergeRequestsFinder
- Use next if instead of a unless block, and use splat operator instead of flatten

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 23db644954 Add support for no-op slash commands that appear in autocomplete
The first one is /cc

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable e021604454 Don't extract slash commands inside blockcode, blockquote or HTML tags
Improve slash command descriptions, support /due tomorrow

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 0eea8c8857 Support slash commands in noteable description and notes
Some important things to note:

- commands are removed from noteable.description / note.note
- commands are translated to params so that they are treated as normal
  params in noteable Creation services
- the logic is not in the models but in the Creation services, which is
  the right place for advanced logic that has nothing to do with what
  models should be responsible of!
- UI/JS needs to be updated to handle notes which consist of commands
  only
- the `/merge` command is not handled yet

Other improvements:

- Don't process commands in commit notes and display a flash is note is only commands
- Add autocomplete for slash commands
- Add description and params to slash command DSL methods
- Ensure replying by email with a commands-only note works
- Use :subscription_event instead of calling noteable.subscribe
- Support :todo_event in IssuableBaseService

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:05:57 +02:00