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

refactor - usage renderVersionBadge - part 2 [amo archlinux aur bower cdnjs chromewebstore cocoapods conan conda cookbook cpan cran crates ctan curseforge debian docker dub eclipsemarketplace elmpackage f-droid factorio fedora feedz flathub galaxytoolshed gem gitea github gitlab greasyfork hackage hexpm homebrew itunes jenkins jetbrains jitpack jsr mavenmetadata modrinth nexus npm nuget openvsx opm ore packagist piwheels polymart pub puppetforge pypi ros scoop snapcraft spack spiget thunderstore twitch ubuntu vaadindirectory vcpkg visualstudioappcenter visualstudiomarketplace vpm wordpress] #10615

Merged
merged 9 commits into from
Oct 20, 2024

Conversation

jNullj
Copy link
Collaborator

@jNullj jNullj commented Oct 16, 2024

This pull request refactors the codebase to use the renderVersionBadge function for rendering version badges.
Refactored services are wordpress, conda and aur.
The pull request also includes tests for all the new options.
This change is part of the ongoing work to address issue #2026 - refactor all versions to use renderVersionBadge
And also helps archive user override for version prefix as mentioned in #10574

new optoins for renderVersionBadge added in this PR are prefix and postfix for the renderVersionBadge message.

we need to run tests for all services that use renderVersionBadge as i changed the function.

As we refactor the codebase to use renderVersionBadge.
some badges need to show default label regardless of tag existance.
This is usefull for cases where the label is dynamic.

This change requires fixing test for npm, not sure how it worked before.
add defaultLabel without tag test
add postfix test
add test for all options together
adds tests for all options with prefix as well

used for badges#2026 but also usefull for usage letting people override v prefix for versions all over the project once badges#2026 is done as requested for example in badges#10574
Copy link
Contributor

Warnings
⚠️ This PR modified service code for aur but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for conda but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for wordpress but not its test code.
That's okay so long as it's refactoring existing code.
Messages
📖 ✨ Thanks for your contribution to Shields, @jNullj!

Generated by 🚫 dangerJS against c19f8c1

@jNullj jNullj added developer-experience Dev tooling, test framework, and CI core Server, BaseService, GitHub auth, Shared helpers javascript [dependabot only] Pull requests that update Javascript packages labels Oct 16, 2024
@jNullj
Copy link
Collaborator Author

jNullj commented Oct 16, 2024

Docker cloud failed due to #10247, not related to this PR should not block merge
Fix for archlinux test failure at #10616, not related to this PR should not block merge

@jNullj jNullj changed the title refactor - usage renderVersionBadge - part 2 [*****] refactor - usage renderVersionBadge - part 2 [amo archlinux aur bower cdnjs chrome-web-store cocoapods conan conda cookbook cpan cran crates ctan curseforge debian docker dub eclipse-marketplace elm-package f-droid factorio-mod-portal fedora feedz flathub galaxytoolshed gem gitea github gitlab greasyfork hackage hexpm homebrew itunes jenkins jetbrains jitpack jsr maven-metadata modrinth nexus npm nuget open-vsx opm ore packagist piwheels polymart pub puppetforge pypi ros scoop snapcraft spack spiget thunderstore twitch ubuntu vaadin-directory vcpkg visual-studio-app-center visual-studio-marketplace vpm wordpress] Oct 16, 2024
@jNullj jNullj changed the title refactor - usage renderVersionBadge - part 2 [amo archlinux aur bower cdnjs chrome-web-store cocoapods conan conda cookbook cpan cran crates ctan curseforge debian docker dub eclipse-marketplace elm-package f-droid factorio-mod-portal fedora feedz flathub galaxytoolshed gem gitea github gitlab greasyfork hackage hexpm homebrew itunes jenkins jetbrains jitpack jsr maven-metadata modrinth nexus npm nuget open-vsx opm ore packagist piwheels polymart pub puppetforge pypi ros scoop snapcraft spack spiget thunderstore twitch ubuntu vaadin-directory vcpkg visual-studio-app-center visual-studio-marketplace vpm wordpress] refactor - usage renderVersionBadge - part 2 [amo archlinux aur bower cdnjs chromewebstore cocoapods conan conda cookbook cpan cran crates ctan curseforge debian docker dub eclipsemarketplace elmpackage fdroid factoriomodportal fedora feedz flathub galaxytoolshed gem gitea github gitlab greasyfork hackage hexpm homebrew itunes jenkins jetbrains jitpack jsr mavenmetadata modrinth nexus npm nuget openvsx opm ore packagist piwheels polymart pub puppetforge pypi ros scoop snapcraft spack spiget thunderstore twitch ubuntu vaadindirectory vcpkg visualstudioappcenter visualstudiomarketplace vpm wordpress] Oct 16, 2024
@jNullj jNullj changed the title refactor - usage renderVersionBadge - part 2 [amo archlinux aur bower cdnjs chromewebstore cocoapods conan conda cookbook cpan cran crates ctan curseforge debian docker dub eclipsemarketplace elmpackage fdroid factoriomodportal fedora feedz flathub galaxytoolshed gem gitea github gitlab greasyfork hackage hexpm homebrew itunes jenkins jetbrains jitpack jsr mavenmetadata modrinth nexus npm nuget openvsx opm ore packagist piwheels polymart pub puppetforge pypi ros scoop snapcraft spack spiget thunderstore twitch ubuntu vaadindirectory vcpkg visualstudioappcenter visualstudiomarketplace vpm wordpress] refactor - usage renderVersionBadge - part 2 [amo archlinux aur bower cdnjs chromewebstore cocoapods conan conda cookbook cpan cran crates ctan curseforge debian docker dub eclipsemarketplace elmpackage f-droid factorio fedora feedz flathub galaxytoolshed gem gitea github gitlab greasyfork hackage hexpm homebrew itunes jenkins jetbrains jitpack jsr mavenmetadata modrinth nexus npm nuget openvsx opm ore packagist piwheels polymart pub puppetforge pypi ros scoop snapcraft spack spiget thunderstore twitch ubuntu vaadindirectory vcpkg visualstudioappcenter visualstudiomarketplace vpm wordpress] Oct 16, 2024
Copy link
Member

@PyvesB PyvesB left a comment

Choose a reason for hiding this comment

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

Thanks @jNullj, looks good to me 👍🏻

Tests failures look unrelated, gonna merge as is.

@PyvesB PyvesB merged commit e7d76b1 into badges:master Oct 20, 2024
22 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Server, BaseService, GitHub auth, Shared helpers developer-experience Dev tooling, test framework, and CI javascript [dependabot only] Pull requests that update Javascript packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants