Functions | Variables
python_utils.check_on_pr Namespace Reference

Functions

def _access_token ()
 
def _call (url, method='GET', json=None)
 
def _jwt_token ()
 
def _latest_commit ()
 
def check_on_pr (name, summary, success=True)
 
def label_increase_decrease_on_pr (name, change, significant)
 
def label_significance_on_pr (name, change, labels=_CHANGE_LABELS)
 

Variables

 _ACCESS_TOKEN_CACHE = None
 
int _ACCESS_TOKEN_FETCH_RETRIES = 6
 
int _ACCESS_TOKEN_FETCH_RETRIES_INTERVAL_S = 15
 
dictionary _CHANGE_LABELS
 
string _GITHUB_API_PREFIX = 'https://api.github.com'
 
int _GITHUB_APP_ID = 22338
 
string _GITHUB_REPO = 'grpc/grpc'
 
dictionary _INCREASE_DECREASE
 
int _INSTALLATION_ID = 519109
 

Function Documentation

◆ _access_token()

def python_utils.check_on_pr._access_token ( )
private

Definition at line 65 of file check_on_pr.py.

◆ _call()

def python_utils.check_on_pr._call (   url,
  method = 'GET',
  json = None 
)
private

Definition at line 99 of file check_on_pr.py.

◆ _jwt_token()

def python_utils.check_on_pr._jwt_token ( )
private

Definition at line 51 of file check_on_pr.py.

◆ _latest_commit()

def python_utils.check_on_pr._latest_commit ( )
private

Definition at line 109 of file check_on_pr.py.

◆ check_on_pr()

def python_utils.check_on_pr.check_on_pr (   name,
  summary,
  success = True 
)
Create/Update a check on current pull request.

The check runs are aggregated by their name, so newer check will update the
older check with the same name.

Requires environment variable 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' to indicate which pull request
should be updated.

Args:
  name: The name of the check.
  summary: A str in Markdown to be used as the detail information of the check.
  success: A bool indicates whether the check is succeed or not.

Definition at line 116 of file check_on_pr.py.

◆ label_increase_decrease_on_pr()

def python_utils.check_on_pr.label_increase_decrease_on_pr (   name,
  change,
  significant 
)

Definition at line 203 of file check_on_pr.py.

◆ label_significance_on_pr()

def python_utils.check_on_pr.label_significance_on_pr (   name,
  change,
  labels = _CHANGE_LABELS 
)
Add a label to the PR indicating the significance of the check.

Requires environment variable 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' to indicate which pull request
should be updated.

Args:
  name: The name of the label.
  value: A str in Markdown to be used as the detail information of the label.

Definition at line 164 of file check_on_pr.py.

Variable Documentation

◆ _ACCESS_TOKEN_CACHE

python_utils.check_on_pr._ACCESS_TOKEN_CACHE = None
private

Definition at line 32 of file check_on_pr.py.

◆ _ACCESS_TOKEN_FETCH_RETRIES

int python_utils.check_on_pr._ACCESS_TOKEN_FETCH_RETRIES = 6
private

Definition at line 33 of file check_on_pr.py.

◆ _ACCESS_TOKEN_FETCH_RETRIES_INTERVAL_S

int python_utils.check_on_pr._ACCESS_TOKEN_FETCH_RETRIES_INTERVAL_S = 15
private

Definition at line 34 of file check_on_pr.py.

◆ _CHANGE_LABELS

dictionary python_utils.check_on_pr._CHANGE_LABELS
private
Initial value:
1 = {
2  -1: 'improvement',
3  0: 'none',
4  1: 'low',
5  2: 'medium',
6  3: 'high',
7 }

Definition at line 36 of file check_on_pr.py.

◆ _GITHUB_API_PREFIX

string python_utils.check_on_pr._GITHUB_API_PREFIX = 'https://api.github.com'
private

Definition at line 27 of file check_on_pr.py.

◆ _GITHUB_APP_ID

int python_utils.check_on_pr._GITHUB_APP_ID = 22338
private

Definition at line 29 of file check_on_pr.py.

◆ _GITHUB_REPO

string python_utils.check_on_pr._GITHUB_REPO = 'grpc/grpc'
private

Definition at line 28 of file check_on_pr.py.

◆ _INCREASE_DECREASE

dictionary python_utils.check_on_pr._INCREASE_DECREASE
private
Initial value:
1 = {
2  -1: 'decrease',
3  0: 'neutral',
4  1: 'increase',
5 }

Definition at line 44 of file check_on_pr.py.

◆ _INSTALLATION_ID

int python_utils.check_on_pr._INSTALLATION_ID = 519109
private

Definition at line 30 of file check_on_pr.py.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:42