sagemath / sage_trac_plugin

Trac plugin used to support Sage development at trac.sagemath.org
5 stars 6 forks source link

Add new [sage_trac:status_badges] config #24

Closed embray closed 3 years ago

embray commented 3 years ago

Alternate to #22, allowing adding status badges through the config file.

The current implement meets all the needs of the existing patchbot status badges, as well as the new one proposed in https://github.com/sagemath/sage_trac_plugin/pull/22

We could further extend the feature if more needs arise.

This also obsoletes the patchbot_url option in the [sage_trac] config, since it was currently only used for generating the status badges. But I kept it for now.

To give an example of how the config file works, here is the configuration reproducing the existing patchbot status badges, and adding the github one from #22:

[sage_trac:status_badges]
patchbot_base.link_url = https://patchbot.sagemath.org/ticket/{ticket_id}
patchbot_base.img_url = https://patchbot.sagemath.org/ticket/{ticket_id}/base.svg?nonce={nonce}
patchbot_base.height = 32
patchbot_base.order = 0
patchbot_status.link_url = https://patchbot.sagemath.org/ticket/{ticket_id}
patchbot_status.img_url = https://patchbot.sagemath.org/ticket/{ticket_id}/status.svg?nonce={nonce}
patchbot_status.height = 32
patchbot_status.order = 1
github_lint.link_url = https://github.com/sagemath/sagetrac-mirror/actions?query=workflow%3ALint+branch%3{ticket_branch}
github_lint.img_url = https://github.com/sagemath/sagetrac-mirror/workflows/Lint/badge.svg?branch={ticket_branch}
github_lint.margin_left = 1em
github_lint.order = 2
embray commented 3 years ago

@tobiasdiez how does this work? You can test it out on the test server at https://35.225.24.56/ticket/30375

However , patchbot.sagemath.org seems to have been down for some time.

embray commented 3 years ago

Made some slight HTML improvements; it's still not great but I think this is as good as it'll likely get unless anyone has any other ideas:

Screenshot from 2021-02-25 13-59-39

tobiasdiez commented 3 years ago

Thanks, that's a nice refactoring and looks reasonably good to me.

(If there are more status badges coming, one might consider moving them further below, e.g. below the ticket description similar to how the PR status checks on github are displayed.)

embray commented 3 years ago

(If there are more status badges coming, one might consider moving them further below, e.g. below the ticket description similar to how the PR status checks on github are displayed.)

I've been worrying about that as well.

I sort of like that we have them high up on the ticket where it's harder to miss, but I'll try something...

embray commented 3 years ago

With the new updates it now looks like this. It will be surprising to some people that they've moved, but I think I've also highlighted it fairly clearly, and there's a lot of room to grow now.

I also added a simple feature to enable grouping of related badges (so the patchbot badges are right next to each other, but the GitHub one isn't right up against them).

Screenshot from 2021-02-25 19-40-25

fchapoton commented 3 years ago

looks good for me, I have not enough energy to investigate more

tobiasdiez commented 2 years ago

@embray Would you please be so nice to also add a link to the gitpod badge (as part of https://trac.sagemath.org/ticket/33113):

Image: https://img.shields.io/badge/-Gitpod-908a85?logo=gitpod 
Link: https://gitpod.io/#https://github.com/sagemath/sagetrac-mirror/tree/<branch>

Thanks! 🚀

embray commented 2 years ago

@tobiasdiez What doe this do for us? I think @dimpase and some others have access to modify the trac config. As I documented here others can be added just by editing the config.

dimpase commented 2 years ago

@tobiasdiez - would you like to change the trac configs yourself? I can give you assess to the VM it runs on.

tobiasdiez commented 2 years ago

@dimpase Thanks, if that's easier for you! You can contact me at code@tobiasdiez.com. @embray Gitpod gives you a full development environment in the browser with the target branch fully build. So for review of a ticket you just the start the gitpod and check that everything is working as expected. In this way, you don't need to checkout the branch locally and build it. Have a look at https://trac.sagemath.org/ticket/33103 for more details.

I just noticed that my request to add the config was maybe a bit early. One should wait until the ticket above is merged (currently it has only a positive review).