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

Backwards compatibility for color references #200

Merged

Conversation

cronik
Copy link
Contributor

@cronik cronik commented Oct 11, 2024

This change improves the backwards compatibility for legacy badge color references that are not jenkins color classes. Colors that reference defined jenkins palette or semantic names are converted to their respective css variable references.

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

@cronik cronik requested a review from a team as a code owner October 11, 2024 22:12
@cronik cronik force-pushed the feature/migrate-color-references branch 2 times, most recently from a9893c7 to c819518 Compare October 11, 2024 23:40
@strangelookingnerd
Copy link
Contributor

Looking at the code I’m having a hard time to follow what is actually improved here. Would you be able to give some examples of before and after this change?

@cronik
Copy link
Contributor Author

cronik commented Oct 13, 2024

I have loads of pipelines that use color references from the jenkins palette or semantic names which used to be mapped properly to jenkins color classes.

addBadge(icon: 'symbol-star plugin-ionicons-api', color: 'yellow')

addBadge(icon: 'symbol-rocket plugin-ionicons-api', color: 'success')

The translation code fails to properly convert these colors to the variable reference so the colors look off or are not found in the case of 'success'.

@strangelookingnerd
Copy link
Contributor

Thanks for the clarification. I was indeed unaware of this incompatibility but I guess it’s reasonable to keep the original behavior. I’ll take a closer look at the code to get this merged soon.

Copy link
Contributor

@mPokornyETM mPokornyETM left a comment

Choose a reason for hiding this comment

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

improve test coverage, everthink else LGTM

This change improves the backwards compatibility for legacy badge
color references that are not jenkins color classes. Colors that reference defined jenkins palette or semantic names are converted to
their respective css variable references.
@strangelookingnerd strangelookingnerd force-pushed the feature/migrate-color-references branch from c819518 to cb1afcc Compare October 15, 2024 13:11
@strangelookingnerd strangelookingnerd added the enhancement New feature or request label Oct 15, 2024
@strangelookingnerd strangelookingnerd enabled auto-merge (squash) October 23, 2024 12:33
@strangelookingnerd strangelookingnerd merged commit 60a6d3e into jenkinsci:master Oct 23, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants