Skip to content

Code-Actions improvements #682

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

Merged
merged 4 commits into from
Nov 10, 2022
Merged

Conversation

Zabuzard
Copy link
Member

@Zabuzard Zabuzard commented Nov 9, 2022

Motivation

We recently added code-actions with auto-detection on all code messages. The feature is cool, but triggers too often and hence annoys.

This PR attempts to fix most of the problems.

Overview

The PR essentially adds 3 features:

  1. the auto-detection is reduced to
    • only detect messages in help threads
    • only detect code with at least 3 lines of code
  2. therefore, add a message context command for helpers to manually register code messages
  3. add a delete button

Auto-detection

The changes on the auto-detection are straightforward. To improve the code a bit, it has been moved out into its own class.

Command

The main advantages of the context command are:

  • allows adding messages outside of help-threads if desired
  • allows adding messages in help threads with less than 3 lines, if desired
  • allows adding messages without any code-block (this is huge)

command
response

Delete

Further, a delete-button has been added to get rid of the message if it appears albeit not wanted:

delete

* moved to dedicated class
* only detect code in help threads
* only detect code with at least 3 LoC
@Zabuzard Zabuzard added new command Add a new command or group of commands to the bot enhance command Modify or improve an existing command or group of commands of the bot priority: major labels Nov 9, 2022
@Zabuzard Zabuzard self-assigned this Nov 9, 2022
@Zabuzard Zabuzard requested review from a team as code owners November 9, 2022 09:16
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Zabuzard
Copy link
Member Author

Speeding this up a bit since its annoying people lol. Tais review is enough, cheers

@Zabuzard Zabuzard merged commit b424c2f into develop Nov 10, 2022
@Zabuzard Zabuzard deleted the feature/codeactions_improvements branch November 10, 2022 07:14
@Zabuzard Zabuzard mentioned this pull request Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhance command Modify or improve an existing command or group of commands of the bot new command Add a new command or group of commands to the bot priority: major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants