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
Alternative Badge SVG File as report for use in Gitlab and private Repositories #1915
Comments
Thanks for the proposal! It's a bit hard to decide on that like that, would it be possible to have a rough idea of what the code and result looks like? |
So the logger would write this SVG into a file and then you can include this file content or extract it to display the badge? |
Exactly. So you have control about your data and no need for using a third party service in order to display it. |
Sounds like a good idea to me; But let's wait another team member opinion before getting started :) |
I'm eagerly looking forward to discovering the response, and I appreciate your input. Thank you :) |
Hello, I have a question: can't you just use already existing So, instead of Infection being responsible for SVG generation, your userland code will be responsible for SVG generation, getting MSI score from generated by Infection JSON file. Probably I missed the benefit of creating specific SVG logger, could you please explain? |
Thank you for your feedback and for engaging with my proposal. I see the merit in the point regarding leveraging existing functionalities like the SummaryLogger for extracting the MSI score and generating the SVG badge externally. This approach indeed aligns with the principle of keeping InfectionPHP focused on its core functionalities without branching into badge generation. This is the original shell script I used, which illustrates how I've been extracting the MSI score from the JSON file generated by infection and using it to update the badge file.
While this method was a quick solution for my specific use case, I recognize the potential inefficiency of generating an additional JSON file in case the ultimate requirement is just the badge. My initial thought was that incorporating badge generation into InfectionPHP could streamline processes for users with similar needs. This approach would have been particularly beneficial for projects hosted in private repositories, where external badge generation services might not be accessible or preferred due to privacy concerns. However, I also understand the importance of maintaining a clear separation of concerns and avoiding feature creep that could detract from the tool's primary objectives. So if my suggestion is beyond the scope of responsibilities of InfectionPHP, I am open to exploring other methods or tools that can achieve the desired functionality without imposing additional burdens on the core project. Thank you once again for taking the time to consider my proposal and engage in such constructive dialogue. I'm looking forward to any more thoughts or suggestions on how we can address this need in a manner that stays true to InfectionPHP's objectives. |
Ok, that makes sense, thanks for the detailed answer. I'm fine with adding it to Infection. The only one thing I would ask is to properly document it, so future readers can benefit from this new SVG logger as well, understanding why it's needed and how it can be used. Thank you! |
Since the company I am working for is using a private Gitlab Repository and my supervisor did not want to use Stryker for the badge, I came up with a different way of displaying a badge with the MSI score. I created a svg badge file which gets updated with the score calculated. This could be used as an alternative way of displaying a badge and could be hooked into the existing logic of choosing between report and badge, adding a local badge file option.
If accepted I would be willing to integrate this feature request, by myself.
I would be grateful for any feedback.
The text was updated successfully, but these errors were encountered: