Skip to content
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

Improve Embeds, Major Refactor/Cleanup #138

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

solonovamax
Copy link

@solonovamax solonovamax commented Oct 20, 2024

Improves embeds and a major refactor/cleanup of basically everything.

This improves embeds based off of the suggestions provided via #27

Here's a list of relevant issues

Here are the changes to the embed:

  • Move everything to embed fields
  • Shortened the artifacts list by using inline links
  • Some other misc cleanup

For the refactors/cleanup:

  • Remove code for discord webhook, instead use discord-webhooks
  • Move all the code for building embeds to a shared util class

Testing done

Honestly I have no clue how to do testing with Jenkins plugins. Would love feedback for that if tests are needed, however since there were already basically no tests I felt it wasn't super needed.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Copy link

@Andre601 Andre601 left a comment

Choose a reason for hiding this comment

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

Just some comments

Comment on lines +162 to +165
StringBuilder descriptionBuilder = new StringBuilder();
for (Map.Entry<String, String> entry : matrixConfiguration.getCombination().entrySet())
descriptionBuilder.append(String.format("- %s: %s", entry.getKey(), entry.getValue()))
.append('\n');
Copy link

Choose a reason for hiding this comment

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

Wouldn't it be simpler to use a StringJoiner("\n") here instead of a StringBuilder that will have a trailing newline?

Copy link
Author

Choose a reason for hiding this comment

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

I just prefer StringBuilder as everyone is able to immediately recognize what it is. Even as someone who is rather experienced with java, I did not initially recognize StringJoiner as being a class in the standard library. But if desired, I could replace it with StringJoiner. I would however personally prefer StringBuilder.

Comment on lines +194 to +197
StringBuilder changesDescription = new StringBuilder();
for (String changeEntry : changesList)
changesDescription.append(changeEntry)
.append('\n');
Copy link

Choose a reason for hiding this comment

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

See previous comment.

Signed-off-by: solonovamax <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestions: Improve display of webhook Feature Request: Parity with pipeline implementation
2 participants