smuzzy-waiii / bunsamosa-bot Goto Github PK
View Code? Open in Web Editor NEWThis project forked from anirudhrowjee/bunsamosa-bot
BunSamosa Bot is the official bot for ACM PESUECC's Hacknight 2023
This project forked from anirudhrowjee/bunsamosa-bot
BunSamosa Bot is the official bot for ACM PESUECC's Hacknight 2023
Currently the list of maintainers in hardcoded and therefore requires committing to git whenever a new maintainer is to be added and the bot needs to be restarted. Implement a better way to handle maintainer list so that maintainer list can be updated in runtime. Current proposed idea is to take maintainer list from a text file and have a endpoint for refreshing maintainer list.
Current Response looks like this:
[
{
"ID": 0,
"CreatedAt": "0001-01-01T00:00:00Z",
"UpdatedAt": "0001-01-01T00:00:00Z",
"DeletedAt": null,
"Contributor_name": "Smuzzy-waiii",
"Maintainer_name": "Smuzzy-waiii",
"Pullreq_url": "https://github.com/acmpesuecc/bigboard/pull/28",
"Points_allotted": 345
},
...
]
The sql query seems to not incorporate the update_at field create by gorm in the ContributorRecordModel table. Fix this so that the endpoint returns the results with proper values of UpdatedAt
Integrate Prometheus to send traces of GitHub events (comments/issues/PRs) and integrate with grafana to know how many events we are processing with beautiful graphs
The /leaderboard endpoint is supposed to give the current bounty for all users (i.e sum of all records) instead it gives the last bounty for each user
/lb_all:
[
{
"ID": 1,
"CreatedAt": "2023-09-18T16:09:27.711134386+05:30",
"UpdatedAt": "2023-09-18T16:09:27.711134386+05:30",
"DeletedAt": null,
"Contributor_name": "sid-008",
"Maintainer_name": "Smuzzy-waiii",
"Pullreq_url": "https://github.com/acmpesuecc/bigboard/pull/27",
"Points_allotted": 30
},
{
"ID": 2,
"CreatedAt": "2023-09-18T16:28:46.085613237+05:30",
"UpdatedAt": "2023-09-18T16:28:46.085613237+05:30",
"DeletedAt": null,
"Contributor_name": "sid-008",
"Maintainer_name": "Smuzzy-waiii",
"Pullreq_url": "https://github.com/acmpesuecc/bigboard/pull/27",
"Points_allotted": 23
},
{
"ID": 3,
"CreatedAt": "2023-09-18T16:31:50.524530828+05:30",
"UpdatedAt": "2023-09-18T16:31:50.524530828+05:30",
"DeletedAt": null,
"Contributor_name": "Smuzzy-waiii",
"Maintainer_name": "Smuzzy-waiii",
"Pullreq_url": "https://github.com/acmpesuecc/bigboard/pull/28",
"Points_allotted": 50
},
{
"ID": 4,
"CreatedAt": "2023-09-18T16:32:20.438208349+05:30",
"UpdatedAt": "2023-09-18T16:32:20.438208349+05:30",
"DeletedAt": null,
"Contributor_name": "Smuzzy-waiii",
"Maintainer_name": "Smuzzy-waiii",
"Pullreq_url": "https://github.com/acmpesuecc/bigboard/pull/28",
"Points_allotted": 20
}
]
/leaderboard:
[
{
"ID": 0,
"CreatedAt": "0001-01-01T00:00:00Z",
"UpdatedAt": "0001-01-01T00:00:00Z",
"DeletedAt": null,
"Name": "Smuzzy-waiii",
"Current_bounty": 20
},
{
"ID": 0,
"CreatedAt": "0001-01-01T00:00:00Z",
"UpdatedAt": "0001-01-01T00:00:00Z",
"DeletedAt": null,
"Name": "sid-008",
"Current_bounty": 23
}
]
Currently this the code for interpreting !bounty
assignments
// parse the comment here to give a bounty
comment_text_parts := strings.Split(parsed_hook.Comment.Body, " ")
if comment_text_parts[0] == "!bounty" {
// Convert the points
points, err := strconv.Atoi(comment_text_parts[1])
...
This is obviously prone to problems if the maintainer were to accidentally place a whitespace before !bounty in their comments and other such formatting bugs. Fix all formatting bugs that might happen accounting for common maintainer comments formats (like newline after bounty points number etc)
To refresh this is bounty assign comment format:
!bounty <bounty_points>
Eg:
!bounty 30
This is a comment that needs to be made on a PR (and not a issue) which assigns <bounty_points> to the user who created the PR
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.