Coder Social home page Coder Social logo

machine-learning-apps / issue-label-bot Goto Github PK

View Code? Open in Web Editor NEW
323.0 29.0 102.0 10.5 MB

Code For The Issue Label Bot, an App that automatically labels issues using machine learning, available on the GitHub Marketplace. This is also code for the blog article: "How to automate tasks on GitHub with machine learning for fun and profit"

Home Page: https://github.com/marketplace/issue-label-bot

License: MIT License

Python 5.93% Jupyter Notebook 9.11% Dockerfile 0.20% HTML 1.65% Shell 0.20% CSS 16.01% Makefile 0.21% JavaScript 8.03% Less 27.91% SCSS 30.75%
machine-learning kubernetes deep-learning github-app nlp flask bootstrap tensorflow keras bigquery

issue-label-bot's People

Contributors

abcdefgs0324 avatar dependabot[bot] avatar hamelsmu avatar jlewi avatar jsoref avatar shunkakinoki avatar yupbank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

issue-label-bot's Issues

Option to customize the message for each label

When this bot identifies a enhancement then I could want to add a message on how feature requests are handled in a given project.

When this bot identifies a bug then I could want to add a message which reminds users what information should a proper bug report contain and how the developers handle them.

etc.

All this and more specific use cases could be handled by this bot if only in its config file it would allow us to specify a message template for each label which would be used by this bot for its first comment under an issue.

Change default labels globally

Hamel's Edit

After the below discussion, I came to the conclusion that the most reasonable way to handle this would be to provide an option for the user to specify a global configuration file that applies to all repos.

</end Hamel's Edit>

I have a problem with the "feature_request" as a label.

GitHub uses (even in this repo) the synonym "enhancement" for that, so this is likely more often used (actually around 4 million times at the time of writing) than "feature_request" (around 4,3 thousand times).

As such, I'd argue to change the default label for a feature from "feature_request" to "enhancement" to match the default from GitHub.

Use case

The underlying problem is that I do not like to out that YAML for configuration in each of my repos, just to correct this "mistake".
When one has reconfigured their repo/label on GitHub to use "feature_request" instead, then they may have a good reason (like the word better or so) and thus I can assume that they would also place an extra file there just to configure it.

But for all other's I guess I want a "drop in" (works out of the box) solution that uses the default/same labels as GitHub does.

Flask App Error

You can see the logs on this URL

ValueError: argument: pem_path must be a valid filename. /var/secrets/github/kf-label-bot-prod.private-key.pem was not found.

I am not really sure what is happening I might need some help to debug or how to debug this in Kubernetes, its abstracted enough where I'm not sure what the best route to debug this is

Thanks, @jlewi

image

Thread with @DevAvanCodes

Lets move move the conversation here....

I am wondering how could I use different labels for recognized EX. Invalid Questions It puts invalid as a label @hamelsmu

@DevAvanCodes can you tell me what you mean by this? What is EX?

502s and readiness check failrues

@hamelsmu is reporting occasional 502s.

I'm noticing that most of the pods aren't reporting a steady health metric

kubectl -n mlapp get pods
NAME                             READY     STATUS    RESTARTS   AGE
ml-github-app-86676c7c4c-2tphc   0/1       Running   0          17m
ml-github-app-86676c7c4c-57ssv   0/1       Running   0          17m
ml-github-app-86676c7c4c-h8wlb   0/1       Running   0          17m
ml-github-app-86676c7c4c-ljz9w   0/1       Running   0          10h
ml-github-app-86676c7c4c-lr2jx   0/1       Running   0          17m
ml-github-app-86676c7c4c-p2jzp   0/1       Running   0          17m
ml-github-app-86676c7c4c-xc2jg   0/1       Running   0          10h
ml-github-app-86676c7c4c-xhcgs   1/1       Running   0          17m
ml-github-app-86676c7c4c-xzg44   0/1       Running   0          10h
jlewi@jlewi-carbon-glaptop:~/git_kubeflow-testing/test-infra/ks_app$ kubectl -n mlapp get pods
NAME                             READY     STATUS    RESTARTS   AGE
ml-github-app-86676c7c4c-2tphc   0/1       Running   0          17m
ml-github-app-86676c7c4c-57ssv   0/1       Running   0          17m
ml-github-app-86676c7c4c-h8wlb   0/1       Running   0          17m
ml-github-app-86676c7c4c-ljz9w   1/1       Running   0          10h
ml-github-app-86676c7c4c-lr2jx   1/1       Running   0          17m
ml-github-app-86676c7c4c-p2jzp   0/1       Running   0          17m
ml-github-app-86676c7c4c-xc2jg   0/1       Running   0          10h
ml-github-app-86676c7c4c-xhcgs   0/1       Running   0          17m
ml-github-app-86676c7c4c-xzg44   0/1       Running   0          10h
jlewi@jlewi-carbon-glaptop:~/git_kubeflow-testing/test-infra/ks_app$ kubectl -n mlapp get pods
NAME                             READY     STATUS    RESTARTS   AGE
ml-github-app-86676c7c4c-2tphc   0/1       Running   0          17m
ml-github-app-86676c7c4c-57ssv   0/1       Running   0          17m
ml-github-app-86676c7c4c-h8wlb   0/1       Running   0          17m
ml-github-app-86676c7c4c-ljz9w   0/1       Running   0          10h
ml-github-app-86676c7c4c-lr2jx   1/1       Running   0          17m
ml-github-app-86676c7c4c-p2jzp   0/1       Running   0          17m
ml-github-app-86676c7c4c-xc2jg   1/1       Running   0          10h
ml-github-app-86676c7c4c-xhcgs   0/1       Running   0          17m
ml-github-app-86676c7c4c-xzg44   0/1       Running   0          10h

Need to add better logging

I think we need better logging to know:

  • when app decides not to make no prediction at all b/c not confident enough
  • anytime a user installs the app.

Let me know if you can think of any other items to log.

cc: @jlewi @inc0

Setup new staging and prod environments

Opening this issue to document the setup of new staging and prod environments.

We'd like to roll out some changes to the label bot frontend (see kubeflow/code-intelligence#90).
Trying to figure out how to roll things safely is revealing some areas for improvement in the way
our staging and prod clusters are setup.

  • We recently created a new GitHub App kf-label-bot-dev (see kubeflow/code-intelligence#84) to correspond to the dev/staging instance of the label bot

  • We also cleaned up the deployment of the backend (See kubeflow/code-intelligence#70) so we have separate namespaces for dev vs. prod

  • We'd like a similar setup for the label bot frontend with a dev instance using the dev label bot and the prod instance using the prod instance.

It looks like the prod instance is currently running in

  • project: github-probots
  • cluster: kf-ci-ml
  • namespace: mlapp

It looks like there are two separate ingresses in this namespace

kubectl get ingress 
NAME        HOSTS               ADDRESS         PORTS     AGE
ml-gh-app   predict.mlbot.net   35.190.23.225   80, 443   264d
mlbot-net   mlbot.net           34.95.77.230    80        264d
  • The predict.mlbot.net endpoint is handling the webhook for the issue-label-bot GitHub App
  • mlbot.net is handling the web app
  • They are both pointing at the same flask app/ K8s service
    • Looks like there are two ingresses just to allow provisioning two SSL certificates corresponding to two domains

Here's my plan

  • Create namespace label-bot-dev with a dev instance of the label bot
  • Configure the domain label-bot-dev.mlbot.net to use this server
  • Configure namespace label-bot-prod with a prod instance
  • Configure the domain label-bot-prod.mlbot.net to use this server
  • Update the label bot webhook to use label-bot-prod.mlbot.net
  • Update mlbot.net to point to the service in label-bot-prod namespace

Main.Run

Skip to content
naveenk2k
/
[Type-Attack]

(

https://github.com/naveenk2k/Type-Attack)
Public
Code
Issues
Pull requests
Actions
Projects
Security
Insights
Type-Attack/main.c
@naveenk2k
naveenk2k Resolved file name issues
3 contributors
317 lines (276 sloc) 5 KB
#include <ncurses.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#include "gameplay.c"

#define WIDTH 30 // Of window
#define HEIGHT 5 // Of window

int startx = 0;
int starty = 0;

char *choices[] = {
"START"
};
int n_choices = sizeof(choices) / sizeof(char *);
void print_menu(WINDOW *menu_win, int highlight);
void T();
void Y();
void P();
void E();
void A();
void C();
void K();
int main()
{
WINDOW *menu_win;
int highlight = 1;
int choice = 0;
int c;

initscr();
clear();
noecho();
cbreak();	/* Line buffering disabled. pass on everything */
startx = (80 - WIDTH) / 2;
starty = (24 - HEIGHT) / 2;

start_color();
init_pair(1, COLOR_WHITE, COLOR_BLACK);
init_pair(2, COLOR_YELLOW, COLOR_BLACK);
init_pair(3, COLOR_GREEN, COLOR_BLACK);
init_pair(4, COLOR_RED, COLOR_BLACK);
init_pair(5, COLOR_CYAN, COLOR_BLACK);
menu_win = newwin(HEIGHT, WIDTH, starty, startx);
keypad(menu_win, TRUE);
//attron(A_BLINK);

attron(COLOR_PAIR(5));
T();

attroff(COLOR_PAIR(5));

attron(COLOR_PAIR(3));
A();
attroff(COLOR_PAIR(3));

attron(COLOR_PAIR(4));
Y();
attroff(COLOR_PAIR(4));

attron(COLOR_PAIR(2));
P();
E();
attroff(COLOR_PAIR(2));

attron(COLOR_PAIR(4));
K();
attroff(COLOR_PAIR(4));

//attroff(A_BLINK);

refresh();
print_menu(menu_win, highlight);
while(1)
{	c = wgetch(menu_win);
	switch(c)
	{	case KEY_UP:
			if(highlight == 1)
				highlight = n_choices;
			else
				--highlight;
			break;
		case KEY_DOWN:
			if(highlight == n_choices)
				highlight = 1;
			else
				++highlight;
			break;
		case 10:
			choice = highlight;
			break;
		default:
			mvprintw(24, 0, "Charcter pressed is = %3d Hopefully it can be printed as '%c'", c, c);
			refresh();
			break;
	}
	print_menu(menu_win, highlight);
	if(choice != 0)	/* User did a choice come out of the infinite loop */
		start();
		break;

}

return 0;

}

void print_menu(WINDOW *menu_win, int highlight)
{
int x, y, i;

x = 2;
y = 2;
box(menu_win, 0, 0);
for(i = 0; i < n_choices; ++i)
{	if(highlight == i + 1) /* High light the present choice */
	{	wattron(menu_win, A_REVERSE);
		mvwprintw(menu_win, y, x, "%s", choices[i]);
		wattroff(menu_win, A_REVERSE);
	}
	else
		mvwprintw(menu_win, y, x, "%s", choices[i]);
	++y;
}
wrefresh(menu_win);

}

void T()
{
// For first T
mvprintw(1,1, "");
mvprintw(1,2, "
");
mvprintw(1,3, "");
mvprintw(1,4, "
");
mvprintw(1,5, "");
mvprintw(2,5, "
");
mvprintw(3,5, "");
mvprintw(4,5, "
");
mvprintw(5,5, "");
mvprintw(6,5, "
");
mvprintw(7,5, "");
mvprintw(1,6, "
");
mvprintw(1,7, "");
mvprintw(1,8, "
");
mvprintw(1,9, "*");

// For 2nd T
mvprintw(1,41,"*");
mvprintw(1,42,"*");
mvprintw(1,43,"*");
mvprintw(1,44,"*");
mvprintw(1,45,"*");
mvprintw(2,45,"*");
mvprintw(3,45,"*");
mvprintw(4,45,"*");
mvprintw(5,45,"*");
mvprintw(6,45,"*");
mvprintw(7,45,"*");
mvprintw(1,46,"*");
mvprintw(1,47,"*");
mvprintw(1,48,"*");
mvprintw(1,49,"*");

//For 3rd T
mvprintw(1,51,"*");
mvprintw(1,52,"*");
mvprintw(1,53,"*");
mvprintw(1,54,"*");
mvprintw(1,55,"*");
mvprintw(2,55,"*");
mvprintw(3,55,"*");
mvprintw(4,55,"*");
mvprintw(5,55,"*");
mvprintw(6,55,"*");
mvprintw(7,55,"*");
mvprintw(1,56,"*");
mvprintw(1,57,"*");
mvprintw(1,58,"*");
mvprintw(1,59,"*");

}

void Y()
{
mvprintw(1,11, "");
mvprintw(2,12, "
");
mvprintw(3,13, "");
mvprintw(4,14, "
");
mvprintw(5,14, "");
mvprintw(6,14, "
");
mvprintw(7,14, "");
//mvprintw(7,14, "
");
mvprintw(3,15, "");
mvprintw(2,16, "
");
mvprintw(1,17, "*");
}

void P()
{
mvprintw(1,19, "");
mvprintw(1,20, "
");
mvprintw(1,21, "");
mvprintw(1,22, "
");
mvprintw(1,23, "");
mvprintw(2,23, "
");
mvprintw(3,23, "");
mvprintw(4,23, "
");
mvprintw(4,22, "");
mvprintw(4,21, "
");
mvprintw(4,20, "");
mvprintw(4,19, "
");
mvprintw(3,19, "");
mvprintw(2,19, "
");
mvprintw(5,19, "");
mvprintw(6,19, "
");
mvprintw(7,19, "*");
}

void E()
{
int i =0;
int j=25;
int x=25;
int y=25;
for( i = 0; i < 8; i++)
{
mvprintw(1,j, "*");
j++;
}

for( i = 1; i < 8; i++)
{
	mvprintw(i,25, "*");
}

for( i = 0; i < 8; i++)
{
	mvprintw(7,x, "*");
	x++;
}

for( i = 0; i < 6; i++)
{
	mvprintw(4,y, "*");
	y++;
}

}

void A()
{
//First A
int i=0;
for(i=1 ; i<8 ; i++)
{
mvprintw(i,34,"*");
}

mvprintw(1,35,"*");
mvprintw(1,36,"*");
mvprintw(1,37,"*");
mvprintw(1,38,"*");
mvprintw(1,39,"*");

for(i=2 ; i<8 ; i++)
{
	mvprintw(i,39,"*");
}
mvprintw(4,35,"*");
mvprintw(4,36,"*");
mvprintw(4,37,"*");
mvprintw(4,38,"*");

//Second A

for(i=1 ; i<8 ; i++)
{
	mvprintw(i,61,"*");
}

mvprintw(1,62,"*");
mvprintw(1,63,"*");
mvprintw(1,64,"*");
mvprintw(1,65,"*");
mvprintw(1,66,"*");

for(i=2 ; i<8 ; i++)
{
	mvprintw(i,66,"*");
}
mvprintw(4,62,"*");
mvprintw(4,63,"*");
mvprintw(4,64,"*");
mvprintw(4,65,"*");

}

void K()
{
int i;
for(i=1; i<8 ; i++)
{
mvprintw(i,69,"*");
}

mvprintw(3,70,"*");
mvprintw(2,71,"*");
mvprintw(1,72,"*");
mvprintw(5,70,"*");
mvprintw(6,71,"*");
mvprintw(7,72,"*");

}
Footer
ยฉ 2022 GitHub, Inc.
Footer navigation
Terms
Privacy
Security
Status
Docs
Contact GitHub
Pricing
API
Training
Blog
About
Type-Attack/main.c at master ยท naveenk2k/Type-Attack

Customer Feedback - Requested Features

This is the feedback I got from customers so far:

  • Want to see a dry run of predictions on existing issues before feeling comfortable installing this.
  • The bot should say "I am not sure" instead of staying completely silent when it is not sure about a label so that the user doesn't end up wondering if the bot is working or not.
  • Can the bot respond in situations where the title change or more comments are added?
  • Redirect fromt http to https incase someone types in the wrong address
  • Have sandbox repo for users to test things out on
  • Added ability to alias the name of the labels for example "#bug" instead of "bug"

cc: @inc0 @jlewi @rand @jessfraz please provide feedback and add more ideas here please, and invite others to make suggestions on features as well!

Make feature_request label configurable

I'm already using "Enhancement" as label for feature requests plus don't personally like the look of the _ in the name as it does not match other label's style. Searching the codebase for feature_request didn't return any results- would be great to understand where this comes from plus make it configurable.

Option to choose no message

It would be great if users could decide whether they:

  1. Want Issue Label Bot to label the issues and post the message with details about confidence, thumbs up, links, etc. (default)
  2. Want Issue Label Bot to only label the issue silently without the message

Right now, (1) is default and not optional.

can we add custom labels?

Can we add cutom label instead of these predefined categories feature request, bug or question? like adding labels based on keywords in the issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.