Skip to content

Conversation

SquidXTV
Copy link
Member

Closes #856

About

This feature adds links to the source of a log message forwarded to Discord.
Only happens if source is from org.togetherjava.tjbot otherwise ignored.

image

Config

Adds sourceCodeBaseUrl to the config.
It's used to link the source package + file name e.g. org.togetherjava.tjbot.features.help.HelpThreadAutoArchiver to its source.

Example:
sourceCodeBaseUrl = https://github.com/Together-Java/TJ-Bot/blob/master/application/src/main/java/
source = org.togetherjava.tjbot.features.help.HelpThreadAutoArchiver

-->
https://github.com/Together-Java/TJ-Bot/blob/master/application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadActivityUpdater.java

@SquidXTV SquidXTV added enhancement New feature or request priority: low labels Jul 15, 2023
@SquidXTV SquidXTV self-assigned this Jul 15, 2023
@SquidXTV SquidXTV requested review from a team as code owners July 15, 2023 22:31
Copy link
Contributor

@Nxllpointer Nxllpointer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

Nxllpointer
Nxllpointer previously approved these changes Jul 16, 2023
@surajkumar
Copy link
Contributor

surajkumar commented Jul 17, 2023

Would it be worth adding the source method? If so, we can append it to the end of the URL using #:~:text=function_name

e.g. https://github.com/Together-Java/TJ-Bot/blob/master/application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadActivityUpdater.java#:~:text=createSchedule

Can ignore this suggestion though if we're not proving HTTP links though it might be nice to still have source methods. Up for discussion.

@SquidXTV
Copy link
Member Author

Would it be worth adding the source method? If so, we can append it to the end of the URL using #:~:text=function_name

e.g. https://github.com/Together-Java/TJ-Bot/blob/master/application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadActivityUpdater.java#:~:text=createSchedule

Can ignore this suggestion though if we're not proving HTTP links though it might be nice to still have source methods. Up for discussion.

ah thats nice, I tried to find out how to add the method name as well, but couldnt find a way,
gonna implement it real quick

@SquidXTV
Copy link
Member Author

Would it be worth adding the source method? If so, we can append it to the end of the URL using #:~:text=function_name

e.g. https://github.com/Together-Java/TJ-Bot/blob/master/application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadActivityUpdater.java#:~:text=createSchedule

Can ignore this suggestion though if we're not proving HTTP links though it might be nice to still have source methods. Up for discussion.

it doesnt work for me though?

@sonarqubecloud
Copy link

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 Zabuzard requested a review from Taz03 July 18, 2023 08:14
@SquidXTV SquidXTV merged commit 2279bf2 into develop Jul 19, 2023
@SquidXTV SquidXTV deleted the feature/linkable-title branch July 19, 2023 21:50
@Zabuzard Zabuzard mentioned this pull request Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: low
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logging - Make title linkable to github file
5 participants