This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
import logging | |
from rest_framework.viewsets import ViewSet | |
from rest_framework.parsers import JSONParser | |
from rest_framework.response import Response | |
from rest_framework.status import HTTP_200_OK, HTTP_500_INTERNAL_SERVER_ERROR, HTTP_403_FORBIDDEN, HTTP_400_BAD_REQUEST | |
from ..RepositoryClient import RepositoryClient | |
from ..PerformanceGuardBot import PerformanceGuardBot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from abc import ABCMeta, abstractmethod, abstractproperty | |
# This is a string that is the name of the status context that is updated | |
# when the CI pipeline completes | |
from .constants import CI_STATUS_CONTEXT #'continuous-integration/jenkins/pr-merge' | |
logger = logging.getLogger() | |
# Github API keywords used to define the check's conclusion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import requests | |
from github3 import GitHub | |
from jwt import JWT, jwk_from_pem | |
import logging | |
from .constants import REPO_OWNER, REPO_NAME, GITHUB_BASE_URL | |
logger = logging.getLogger() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# GitHub Integration | |
GITHUB_APP_ID = 12345 # This value can be found on your GitHub App overview page | |
# My secrets are environment variables | |
# The webhook secret you chose for the GitHub App | |
GITHUB_APP_WEBHOOK_SECRET = os.environ.get('GITHUB_APP_WEBHOOK_SECRET') | |
# The private key that was generated when you created the GitHub App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################### | |
# From oltpbench/reporting/parsers/summary_parser.py | |
from oltpbench.reporting.utils import get_value_by_pattern | |
from oltpbench.reporting.constants import LATENCY_ATTRIBUTE_MAPPING | |
# NOTE: What we wanted to do was to reuse this function to parse the latency data | |
# from the res file as well. | |
def parse_latency_data(latency_dict): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isCycle(arr){ | |
let i = 0 | |
let itemsToTouch = arr.length | |
while(arr[i]!==0){ | |
itemsToTouch-- | |
const val = arr[i] | |
arr[i]=0 | |
if(i +val >=arr.length){ | |
i = (i + val) % arr.length | |
}else if(i+val <0){ |