Skip to content

Instantly share code, notes, and snippets.

View spiffxp's full-sized avatar
💭
I may be slow to respond.

Aaron Crickenberger spiffxp

💭
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env bash
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#

Commented out https://github.com/kubernetes/kubernetes/blob/master/test/images/image-util.sh#L91

spiffxp@spiffxp-macbookpro:images (test-images/centralize-image-to-agnhost-part-3 %)$ make all-push WHAT=agnhost
./image-util.sh build agnhost
Building image for agnhost ARCH: amd64...
../image-util.sh bin agnhost
~/w/kubernetes/kubernetes/_tmp/test-images-build.bybb9W ~/w/kubernetes/kubernetes/test/images
Sending build context to Docker daemon  33.84MB
Step 1/10 : FROM alpine:3.6

I was curious how consistently we're using milestone names and such across all repos in the kubernetes orgs

Sadly I didn't reach for python as my first tool on this one, bash+hub+jq it is

for o in kubernetes{,-client,-csi,-incubator,-sigs}; do \
  for r in $(hub api orgs/$o/repos?per_page=100 | jq -r .[].full_name | sort); do \
    echo ### $r:;
    hub api repos/$r/milestones | jq -r '.[] | "- \(.title): \(.state) \"\(.description)\" (due: \(.due_on))"'; 
  done; 
done

Intent is to create my prow instance to service my own github org as a testbed / staging area for changes I would want to make to prow.k8s.io

Made GitHub things

  • Created [@bashfire] org
  • Reusing [@spiffxp-bot] user
  • Invited [@spiffxp-bot] to [@bashfire]
  • Setup [@spiffxp-bot] as an Owner of [@bashfire]

Followed Getting Started Guide

#!/usr/bin/env python3
import json
from pathlib import Path
from sh import bash, git
if __name__ == "__main__":
# Set to True to run ./hack/update-import-aliases.sh and generate a git commit per import alias
@spiffxp
spiffxp / k-k-files.json
Created June 11, 2019 01:59
What files are most touched by PRs, what PRs are most likely to hit merge conflicts
{
"hack/.golint_failures": [
"https://github.com/kubernetes/kubernetes/pull/78810",
"https://github.com/kubernetes/kubernetes/pull/78764",
"https://github.com/kubernetes/kubernetes/pull/78744",
"https://github.com/kubernetes/kubernetes/pull/78718",
"https://github.com/kubernetes/kubernetes/pull/78634",
"https://github.com/kubernetes/kubernetes/pull/78620",
"https://github.com/kubernetes/kubernetes/pull/78618",
"https://github.com/kubernetes/kubernetes/pull/78616",
@spiffxp
spiffxp / k8s-api-import-aliases.md
Created June 4, 2019 01:59
consistent alias name when importing k8s apis

I was trying to audit whether we had caught everything for kubernetes/kubernetes#78614

Then went down a silly rabbit hole of gee it seems like we're close to being consistent but not quite on how we alias imports when we're importing k8s api packages

cd w/kubernetes/kubernetes
ag --no-filename '^\t*[a-z0-9 ]*\"[.a-z0-9/]*v1[a-z0-9]*\"' cmd pkg staging test | sort | uniq -c

Some noise has been manually filtered out because, well, regexes.

@spiffxp
spiffxp / README.md
Last active August 2, 2019 22:26
OWNERS and GitHub analysis that does not scale at all

I'm trying to figure out how to use data to drive contributor ladder nomination / promotion (and possibly pruning)

Someone asked me if they could get promoted in an OWNERS file. I wanted to know, had they reviewed enough PRs relevant to that OWNERS file?

I can (sortof) now answer whether spiffxp should be in cluster/OWNERS because they're saying /lgtm on relevant PRs

eg:

./last-100-merged-prs.py spiffxp --repo kubernetes/kubernetes --file-regex ^cluster/ --comment /lgtm
# ...
{
"count": 33,
"next": null,
"previous": null,
"results": [
{
"user": "kubernetes",
"name": "pause",
"namespace": "kubernetes",
"repository_type": null,
@spiffxp
spiffxp / yaml-roundtripping-is-hard.md
Last active June 4, 2019 01:42
yaml-roundtripping-is-hard

I wanted to be able to automatically format yaml as follows:

  • preserves comments
  • modifies sequence order (sort by key or val)
  • modifies key order (alpha sort? manual key order? decl key order?)

Here's what I've tried

Use python