My team uses Dependabot to keep software dependencies up to date. The tool submits PRs against our repositories and we use a checklist/decision tree to help us judge how deeply to review and provide an audit trail of the decision.
Patch-level updates of company-internal packages might be just waved in if the tests pass, for example, but a major update of an external library could require us to review or redo a risk analysis.
For reasons, the Markdown source for the tree is not automatically added to the PR so we pick it up from another repo, copy it, and paste it into the PR we're looking at. This has got sufficiently irritating to me that I looked for another way.
I know about bookmarklets and I've made them before, so I first tried to make one that would paste the text into a comment box on the PR. The checklist is long and I needed to escape various characters and retain line breaks and it was tricky to edit and debug in a simple URL field, so I aborted.
I wondered if there was perhaps a way to turn a bookmarklet into a Chrome extension. I did a bit of searching and found that it's actually pretty easy (in principle!) to make an extension and load it locally.
And I did, by hacking some example code from Google and looking at the docs and StackOverflow when I got stuck.
And, reasonably quickly, I got it working!
Well, reasonably quickly, I got it "working".
That is, it does enough for what I need right now in the way I need it to. I found that some routes to the PR page mean that the button doesn't appear without a refresh. I don't know why and as the route I tend to use for these tasks does populate the button, and I couldn't find a quick fix, I just left it.
Was the effort worth it? Yes, it reduces friction for me and adds another tool to my testing arsenal for that future occasion when I need it.
In case it's interesting or helpful, I made a copy of the bare bones of the extension and put in on GitHub in this repo. My daughter helped with the commit message...
Comments
Post a Comment