Skip to content

Instantly share code, notes, and snippets.

View timmc-edx's full-sized avatar

Tim McCormack timmc-edx

  • Somerville, MA, USA
  • 09:13 (UTC -04:00)
View GitHub Profile
@timmc-edx
timmc-edx / notify_rebase.py
Created June 25, 2021 14:45
ARCHBOM-1819
#!/usr/bin/env python3
# This script records an action we took to leave a comment on (almost)
# every open edx-platform PR to let people know that they needed to
# rebase onto master (or merge it into their branch) to avoid breaking
# the build.
#
# The script requires a Github access token and finds all open PRs
# against master on edx-platform which do not have a specific commit
# in their ancestors, then leaves a comment on each one. This should
# be done from a bot account; the bot will then be subscribed to all
#!/usr/bin/python3
import collections
import datetime
import os
import sys
tz = datetime.timezone(offset=datetime.timedelta(hours=-5))
logfile = os.path.expanduser("~/context-switches.log")
# Place in a Python package with this in the setup.py:
#
# entry_points={
# 'console_scripts': [
# 'make = SOME_MODULE.instrument_make:wrapper',
# ],
# },
import re
  • Why did [mistaken action] seem like the correct action at the time?
  • Why was the problem not detected automatically?
    • Why was the mistake caught late, not early?
  • Why was the problem not fixed automatically?
    • Why did this require manual intervention?
    • Why did this require human detection?
  • Were any of the contributing factors already known problems?
    • Why were they not addressed earlier?
    • Have we seen these in previous RCAs?
@timmc-edx
timmc-edx / pr-checklist.md
Last active January 27, 2021 14:14
Code review checklist, edX version

Have the following been addressed in the branch, if appropriate?

  • Tests (unit, API, integration)
  • Docs (source comments, doc directory, elsewhere)
  • Changelog
  • Compatibility with previous versions (calls, shared files or DBs, data formats -- backward and forward compatibility)
  • Rollback friendly?
  • Feature switches?

edX-specific considerations:

@timmc-edx
timmc-edx / first.py
Last active June 2, 2020 13:50
terrible scope example in python
# python3 ./first.py
import second
import builtins
builtins.magic = "wow"
second.some_func()