GithubHelp home page GithubHelp logo

smuzzy-waiii / bunsamosa-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anirudhrowjee/bunsamosa-bot

1.0 0.0 1.0 41 KB

BunSamosa Bot is the official bot for ACM PESUECC's Hacknight 2023

Shell 1.99% Go 98.01%

bunsamosa-bot's People

Contributors

anirudhrowjee avatar navinshrinivas avatar smuzzy-waiii avatar

Stargazers

 avatar

Forkers

anuragrao04

bunsamosa-bot's Issues

Easier Add/Del of maintainer list without having to restart bot

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.

/records (user specific) is not in order

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

Add Observability

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

/leaderboard gives wrong op: last bounty instead of sum

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
    }
]

whitespace and other formatting bugs in !bounty

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

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.