View base_job.py
class BaseJobResource(Resource):
def dispatch_request(
self, provider: str, owner_name: str, repo_name: str, build_number: int, job_number: int, *args, **kwargs
) -> Response:
queryset = Job.query.join(Build, Build.id == Job.build_id).join(
Repository, Repository.id == Build.repository_id
).filter(
Repository.provider == RepositoryProvider(provider),
Repository.owner_name == owner_name,
Repository.name == repo_name,
View componentToString.js
import ReactDOM from 'react-dom';
const componentToString = function(node) {
let el = document.createElement('div');
ReactDOM.render(node, el);
return el.innerHTML;
};
View gist:93a088759f532c3a398f
>>> import subprocess
>>> proc = subprocess.Popen(['git', 'clone', 'git@github.com:getsentry/sentry.git', '/tmp/ds-repo-1'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>>> print(proc.communicate())
("Cloning into '/tmp/ds-repo-1'...\n", None)
View gist:099511a7a8f9efab7517
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'handlers': {
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'simple',
},
'sentry': {
View gist:f825896f3acfea9b5b73
api.assign() =>
AssignAction(...)
this.request('...')
.success(() => AssignSuccessAction())
.error(() => AssignErrorAction())
ThingStore =>
onAssign:
// we want to emulate a Set() for this
View mailgun.py
import logging
from django.http import HttpResponse
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods
from email_reply_parser import EmailReplyParser
from email.utils import parseaddr
from sentry.tasks.email import process_inbound_email
View cleanup_redis_tsdb.py
#!/usr/bin/env python
from sentry.utils.runner import configure
configure()
from datetime import datetime, timedelta
from sentry.app import tsdb
def cleanup_connection(connection, epoch):
def delete(key):
View foo.md

Item List => Item => ItemStatusSelector

  • Need to maintain certain state in ItemStatusSelector (specifically have we "saved" the change, this is to avoid passing useless properties all over the place like itemStatusIsSaving)
  • Currenlty Item List controls item via prop, which controls item status via prop. This means we pass an onStatusChange all the way back to Item List.
  • [Re]flux seems to resolve this by using some store/action combo, but unclear if "Item" is in an "item list" store or if each item should be its own store, or how "change item status" should actually flow
View gulpfile.js
'use strict';
var gulp = require('gulp'),
gp_changed = require('gulp-changed'),
gp_clean = require('gulp-clean'),
gp_concat = require('gulp-concat'),
gp_filesize = require('gulp-filesize'),
gp_less = require('gulp-less'),
gp_rename = require('gulp-rename'),
gp_uglify = require('gulp-uglify'),
View pgbouncer.rb
class PgbouncerStats < Scout::Plugin
# need the ruby-pg gem
needs 'pg'
OPTIONS=<<-EOS
user:
name: Pgbouncer username
notes: Specify the username to connect with
password:
name: Pgbouncer password