ncar / xdev-bot Goto Github PK
View Code? Open in Web Editor NEWGitHub bot for Experimental Development Team
License: Apache License 2.0
GitHub bot for Experimental Development Team
License: Apache License 2.0
This is a TEST!
After looking at the details required to complete #96, I've encountered some complications that might require a different approach to the bot.
I would like to remove the database CSV file stored on S3 because (and probably for no reason related to S3) it gets out of sync with the actual project board. However, the database is required for any Issue/PR events triggering card movement (i.e., to Backlog
or Done
). You need a mapping from Issue/PR ID to Project Card ID, which is currently what the database provides.
I believe the solution to this is for the Bot/App to query GitHub when it is first launched to construct the actual Project Board contents and build the Issue/PR ID --> Card ID mapping. There will be no need to save it to a file.
I encountered a problem trying to log in as the XDev-Bot GitHub user, because the authorized email address for the account is Anderson's. Essentially, I could not verify that I was Anderson. That is a complication that I think should be removed. Everyone on the team should be able to access the XDev-Bot.
I think that the XDev-Bot should not be a "user" but a registered GitHub App. An App has its own identity and doesn't need a user as a proxy for authentication purposes. Also, with a registered App, as far as I know, it provides its own webhook. That means we do not need to complete 2 separate steps every time a new repo is created that we want to watch as a team (i.e., add the XDev-Bot user as a collaborators and create the webhook). We will only need to enable the App on the repo we want to watch (1 step).
This one is less important, I suppose, but it seems to me that the GitHub API documentation is written assuming a general tool that can be used for RESTful GET/PUT commands. I don't like that the Gidgethub documentation is pretty sparse, so I am left guessing how to pass certain headers or how the payload is converted into a Gigdethub event. I would prefer that what we use with the Bot/App should clearly match the GitHub API documentation. So, something like aiohttp
should suffice. I don't think we need Gidgethub.
Need tools that can:
@jukent, @kmpaul
Over the weekend, I added functionality to persist project cards info into a file using an xdev-bot
S3 bucket hosted here. You may need to talk with Kevin to get your AWS credentials in order to access cisl-iowa
account.
Here's what the dataframe constructed from the persisted database looks like:
@jukent, I wanted to let you know that I did some work on When a card is moved
event in #19, #20, #21, and #22. However, there's still work to be done for this event, see project board section below.
Below is my attempt at jotting bot's workflow ideas down that we discussed last week. My objective is to compile ideas in to a list of tasks that can be implemented independently. Feel free to extend and improve this list ( I couldn't remember everything we talked about last Thursday). As always, let me know if you have any questions
When an issue is opened in repo x
xdev
project board's backlog columnWhen an issue is reopened in repo x,
xdev
PB back to backlog column. If the card doesn't exist, create oneupdated_at
column entry in database.csv
When an issue is closed in repo x,
xdev
PBdatabase.csv
df.loc[df["card_id"] == card_id, "column_name"] = column_name
df.loc[df["card_id"] == card_id, "column_url"] = column_url
df.loc[df["card_id"] == card_id, "column_id"] = column_id
df.loc[df["card_id"] == card_id, "updated_at"] = updated_at
df.loc[df["card_id"] == card_id, "assignees"] = card_mover
xdev
PB' in progress columnassignees
column entry in database.csv
Needs Review
labelxdev
PB to Done
columndatabase.csv
df.loc[df["card_id"] == card_id, "column_name"] = column_name
df.loc[df["card_id"] == card_id, "column_url"] = column_url
df.loc[df["card_id"] == card_id, "column_id"] = column_id
df.loc[df["card_id"] == card_id, "updated_at"] = updated_at
df.loc[df["card_id"] == card_id, "assignees"] = card_mover
xdev
PB
database.csv
in xdev-bot S3 bucketDone
Column
database.csv
df.loc[df["card_id"] == card_id, "column_name"] = column_name
df.loc[df["card_id"] == card_id, "column_url"] = column_url
df.loc[df["card_id"] == card_id, "column_id"] = column_id
df.loc[df["card_id"] == card_id, "updated_at"] = updated_at
df.loc[df["card_id"] == card_id, "assignees"] = card_mover
assignees
column entry in database.csv
database.csv
df.loc[df["card_id"] == card_id, "column_name"] = column_name
df.loc[df["card_id"] == card_id, "column_url"] = column_url
df.loc[df["card_id"] == card_id, "column_id"] = column_id
df.loc[df["card_id"] == card_id, "updated_at"] = updated_at
df.loc[df["card_id"] == card_id, "assignees"] = card_mover
Need to make the project board easier to use for sprints:
I have tried assigning the user who submits a pull request for review as the assignee, but have not been successful yet. I am wondering if this is a feature we even want? It already says who submitted the pull request on the card - but is it useful to have it included if we filter by assignee?
I am trying to add labels to pull requests through xdev-bot. I would like the label 'needs review' when a pull request is created, remove that label when the pull request is closed, and add the label 'discarded' when a pull request is closed without merging. Currently only focusing on the 'needs review' label.
I am looking to this site for guidance: https://gidgethub.readthedocs.io/en/latest/
but the method is not identical.
Key lines in the pull_request.py code are:
labels_url = event.data["pull_request"]["base"]["repo"]["labels_url"]
await gh.post(labels_url, data=["test label"])
The error that comes up complains that ['test label'] is not an object.
I manually added a label (had to create it first and then add it) to a pull request to see what it looks like in the webhooks. There are some lines of note:
"labels": [
{
"id": 1251423450,
"node_id": "MDU6TGFiZWwxMjUxNDIzNDUw",
"url": "https://api.github.com/repos/NCAR/xdev-bot-testing/labels/test%20label",
"name": "test label",
"color": "b2721e",
"default": false
}
and
"labels_url": "https://api.github.com/repos/NCAR/xdev-bot-testing/labels{/name}",
I did not preserve their nesting because that is hard to see by visual inspection.
Also it might be important that the url of the label can be found at:
https://github.com/NCAR/xdev-bot-testing/labels
In the code, we will want to have the label action check if the label exists and then apply it, and we need to make sure we do not overwrite labels.
I have a few ideas to try, but I need to step away from this for a second.
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.