Resolve "`/tag` quick action on Commit comments"
What does this MR do?
Implements the /tag quick action on commit comments as described in #45663 (closed).
Are there points in the code the reviewer needs to double check?
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conforms to the code review guidelines
-
Has been reviewed by a UX Designer -
Has been reviewed by a Frontend maintainer -
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qamanual pipeline job)
What are the relevant issue numbers?
Closes #45663 (closed)
Notes
TODOs
-
Implement Commits::TagServiceCommits::UpdateService-
Tag the actual commit (aka git tagequivalent) usingTags::CreateService -
Unit tests -
Check authorization
-
-
Add new tagcommand inInterpretService-
Define conditionbased on typeCommit -
Check authorization
-
-
Feature tests (equivalent to issues/user_uses_slash_command_spec.rb)-
Add some more ❓
-
-
Make sure that "Preview" is working -
Refactor find/building noteables -
Move building noteables from AutocompleteService#commandsinAutocompleteSourcesController#target -
Build issues/merge_request ( @project.issues.build) if providedtype_idis empty or could not be found (inAutocompleteSourcesController#target)- This will solve inconsistent behavior when passing
type=issuevstype=Issue
- This will solve inconsistent behavior when passing
-
Remove Issueabletype-check fromAutocompleteService#commands
-
- Do not show
Command appliedif tagging fails- Currently, errors from commands are discarded
- Example:
/move non_existent_repowon't show an error norCommand applied
- Example:
- Should errors be shown?
-
➡ already addressed in #21580 (moved)
-
- Currently, errors from commands are discarded
-
Verify that users are allowed to tag commits ( push_code?)-
CommitPolicyis empty❎ -
Auto complete /tagonly if user is authorized -
Authorize user before executing Commits::TagService-
➡ Not needed because it's already done inTag::CreateService.
-
-
- Tag commits asynchronously?
-
➡ Yes, from the UX point of view
-
- A
Commitis notIssueable- Avoid type checks (
is_a?(Issuable)) inQuickActions::IntepretService - Introduce some kind of presenter to wrap
Issue,MergeRequestandCommit - Adding methods like
Commit#to_ability_namefeels wrong -
➡ Type checks are fine and the presenter is not needed
- Avoid type checks (
