TK blocking

attemptAtTagsRenovation
Jack Jackson 1 year ago
parent d48756de6f
commit 7dc7cc47da
  1. 25
      .drone.yml
  2. 2
      blog/content/posts/grafana-oncall.md
  3. 28
      blog/content/posts/tk-block.md

@ -7,9 +7,9 @@ platform:
arch: arm64
steps:
# - name: block-posts-containing-tk
# image: busybox
# commands:
- name: block-posts-containing-tk
image: busybox
commands:
# # This is necessary because, if `grep ...` doesn't find anything, it will _return_ (not print) a value of 1
# # (non-zero return codes indicating errors in Unix - since there are many more ways for something to go wrong
# # than there are for it to go right!), and so the `files=` assignment will also return 1, and the whole operation
@ -19,18 +19,18 @@ steps:
# # if the first one errors out. So, this line can be translated to English as:
# # "Set the variable `files` to a list of all the files that contain `TK` - unless there aren't any, in which case
# # set it to `FILES NOT FOUND"
# - files=$(grep -rl 'TK' blog/content/posts || echo "FILES NOT FOUND")
- files=$(grep -rl 'TK' blog/content/posts || echo "FILES NOT FOUND")
# # We have to filter out (`grep -v`) the "marker" value of `FILES NOT FOUND`, otherwise the no-matches case would
# # be recorded as having 1 matching file, leading to an error-out below.
# # (I guess _technically_ there's an edge case in that, if I ever make a blog post titled "FILES NOT FOUND" _which also_
# # contains the string `TK`, it would slip through this check. But that feels pretty unlikely - not least because spaces
# # are very rare in my filesystem names - so I'm ok taking that risk)
# - count=$(wc -l <(echo "$files" | grep -v "FILES NOT FOUND") | awk '{print $1}')
# - if [[ "$count" -gt "0" ]]; then
# - echo "Found TK in $count files:"
# - echo $files
# - exit 1 # TODO - and alerting via Matrix!
# - fi
- count=$(wc -l <(echo "$files" | grep -v "FILES NOT FOUND") | awk '{print $1}')
- if [[ "$count" -gt "0" ]]; then
- echo "Found TK in $count files:"
- echo $files
- exit 1 # TODO - and alerting via Matrix!
- fi
- name: build-blog
image: alpine
# Very unlikely to need updates, and pulling images seems slow on this setup -
@ -84,11 +84,16 @@ steps:
- "curl -s -X POST \"https://api.cloudflare.com/client/v4/zones/c86d55d225ed973d5da45239beac2f99/purge_cache\" -H \"Authorization: Bearer ${CLOUDFLARE_TOKEN}\" -H \"Content-Type:application/json\" -d '{\"files\":[\"https://blog.scubbo.com\"]}'"
- name: telegram_notification
image: appleboy/drone-telegram
when:
status:
- failure
- success
settings:
token:
from_secret: telegram_token
to:
from_secret: telegram_convo_id
image_pull_secrets:
- dockerconfigjson

@ -185,7 +185,7 @@ Connected to OnCall (OpenSource, v1.0.32)
I haven't actually set up any monitoring or notifications yet! The main monitor I want to set up is for low disk space on the nodes, as that seems to be the primary issue that I'm running into - but I'll look around for some suggestions of health metrics and share any good configurations that I find. Regarding notifications, I managed to get a [Matrix](https://matrix.org/) server running a few weeks back, and have made some decent progress on allowing bots to post to rooms - it would be really cool if I could contribute a Matrix integration to OnCall.
I'd also like to put in some alerting for if any CI/CD pipelines are blocked - in fact, what prompted this observability improvement in the first place was experimenting with a CI/CD step that would intentionally block publication of this blog if any pages contained the string [TK](https://en.wikipedia.org/wiki/To_come_(publishing)), and then realising that it wouldn't be great to have a pipeline that could be intentionally blocked without some notification of that fact.
I'd also like to put in some alerting for if any CI/CD pipelines are blocked - in fact, what prompted this observability improvement in the first place was experimenting with a CI/CD step that would intentionally block publication of this blog if any pages contained the string [TK](https://en.wikipedia.org/wiki/To_come_(publishing)), and then realising that it wouldn't be great to have a pipeline that could be intentionally blocked without some notification of that fact. (EDIT: having introduced Telegram notifications to the pipeline, the TK-blocking is now in effect!)
I'd also like to build some iSCSI-based network storage, since I've heard that [hosting databases on NFS can be problematic](https://serverfault.com/a/789110).

@ -1,8 +1,8 @@
---
title: "TK Block"
date: 2022-08-23T21:46:40-07:00
draft: true
date: 2023-03-05T21:45:00-08:00
tags:
- CI/CD
- meta
---
@ -16,27 +16,21 @@ One use of this is as a "placeholder", when you know _roughly_ what will go in a
In the traditional publishing world, an Editor would be responsible for the final pass over the work to make sure all TKs have been caught before sending the content out to readers. In the thrilling world of the future where we have taught sand to think by blasting it with lightning, we can automate that process! Look at the changes to `.drone.yml` in the commit that introduced this blog post to see how.
## What about alerting?
Watch this space. I want the original commit to _only_ include the `.drone.yml` update and minimal blog post, to check it works. I'll post a follow-up with description of alerting (via Matrix) next.
If you're seeing this, then congratulations, you caught the blog post before it was meant to be published. But wait...this whole blog post was about how we'd now made that impossible, right? That's right!
## Wait, but...this blog contains the characters TK?
I know! See if you can figure it out :)
[^1]: Alright, you know I couldn't resist checking:
```
$ cat /usr/share/dict/words | wc -l
235886
$ cat /usr/share/dict/words | grep -i 'tk' | wc -l
40
$ echo "100*40/235886" | bc -l
.01695734380166690689
```
```
$ cat /usr/share/dict/words | wc -l
235886
$ cat /usr/share/dict/words | grep -i 'tk' | wc -l
40
$ echo "100*40/235886" | bc -l
.01695734380166690689
```
So, _about 0.017%_ of common English words contain those characters. Some stand-outs include "_boatkeeper_", "_giantkind_", and "_outknave_".
So, _about 0.017%_ of common English words contain those characters. Some stand-outs include "_boatkeeper_", "_giantkind_", and "_outknave_".
[^2]: Though, see also George's thoughts on [Being Creative Uphill](https://www.georgelockett.com/shards/2022/7/28/being-creative-uphill) and [How To Write When You Can't](https://www.georgelockett.com/shards/2022/6/16/how-to-write-when-you-cant)

Loading…
Cancel
Save