-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitHub Issue Summarizer using Modus & GitHub Actions #64
base: main
Are you sure you want to change the base?
Changes from 17 commits
b2e6710
899fcaa
9b92031
a3a98b1
a44d77f
6090bbf
e9f712b
850a6e5
4b3bea8
3eb9ac4
fda8b3c
625838f
abe1f24
a774ac1
0c6ca86
9e8f289
1d95762
4cebe90
b30d433
ffc4f4e
5046500
629b957
74d84da
fb77146
6dd9e12
b421e19
f236d64
b0e075a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Ignore macOS system files | ||
.DS_Store | ||
|
||
# Ignore environment variable files | ||
.env | ||
.env.* | ||
|
||
# Ignore build output directories | ||
build/ | ||
|
||
# Ignore Go debuger and generated files | ||
__debug_bin* | ||
*_generated.go | ||
*.generated.go | ||
|
||
.modusdb/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# GitHub Issue Knowledge Base Generator (Modus + Hypermode) 🚀 | ||
|
||
This project automatically generates a Knowledge Base (KB) article when a GitHub issue is closed. It | ||
utilizes Hypermode and Modus (a serverless Go framework) to process issue data and generate a | ||
structured KB article using an LLM. The knowledge base article is then posted as a GitHub | ||
Discussion. | ||
|
||
## 🛠 Features | ||
|
||
- Fetches GitHub issue details and comments upon issue closure. | ||
- Uses LLM (Meta's LLaMa model hosted on Hypermode) to generate a detailed KB article. | ||
- Posts the generated KB article as a GitHub Discussion. | ||
- Can be triggered manually or via GitHub Actions. | ||
|
||
-- | ||
|
||
## 🖥️ Running Locally | ||
|
||
### 1️⃣ Install Modus | ||
|
||
First, install Modus CLI: | ||
|
||
```bash | ||
npm install -g @hypermodeinc/modus | ||
``` | ||
|
||
### 2️⃣ Clone the Repository | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may want to mention that this is a repository in which you want to run the summarizer. |
||
|
||
```bash | ||
git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git | ||
cd YOUR_REPO | ||
``` | ||
|
||
### 3️⃣ Start the Modus Dev Server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this stage the viewer is in their cloned repo right, how to they get the required files (main.go, modus.json, etc) into this folder? Maybe I'm missing something. |
||
|
||
```bash | ||
modus dev | ||
``` | ||
|
||
### 4️⃣ Test the API Locally | ||
|
||
Go to: `http://localhost:54321/graphql` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I |
||
|
||
You'll see an exported function `issueClosedHandler`. Test the KB Article Generation. Enter the | ||
repository name and issue number and run the query. The API will return a formatted KB article. You | ||
can also post the KB Article as a Discussion. To do so, pass a GitHub API token as well. | ||
|
||
-- | ||
|
||
## 🚀 Deploying to Hypermode | ||
|
||
To deploy the function to Hypermode: | ||
|
||
```bash | ||
modus deploy | ||
``` | ||
|
||
Once deployed, copy your Hypermode endpoint, which will be used in the GitHub Action. | ||
|
||
-- | ||
|
||
## 🔧 Setting Up the GitHub Action | ||
|
||
This action allows the KB article to be generated automatically when an issue is closed. | ||
|
||
### 1️⃣ Clone the Project & Deploy to Hypermode | ||
|
||
If you haven't already: | ||
|
||
```bash | ||
git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git | ||
cd YOUR_REPO | ||
modus deploy | ||
``` | ||
|
||
Copy your Hypermode endpoint as specified in the Hypermode console. | ||
|
||
### 2️⃣ Add the GitHub Action | ||
|
||
Copy the issue-summarizer.yml file into in your repository: | ||
|
||
### 3️⃣ Add Your Hypermode API Key to GitHub Secrets | ||
|
||
1. Go to your GitHub repository. | ||
2. Navigate to Settings → Secrets and variables → Actions. | ||
3. Click New repository secret. | ||
4. Name it: `HYPERMODE_API_KEY` | ||
5. Paste your Hypermode API key. | ||
6. Save. | ||
|
||
### 4️⃣ Done! 🎉 | ||
|
||
Now, every time a GitHub issue is closed, a KB article will be generated and posted as a GitHub | ||
Discussion. | ||
|
||
-- | ||
|
||
## 🛠 Troubleshooting | ||
|
||
GitHub Discussion Not Created? | ||
|
||
Ensure: | ||
|
||
- You have enabled Discussions under Repository Settings → Features. | ||
- Your GitHub token has the discussions: write permission. | ||
|
||
No Response from the API? | ||
|
||
- Check if your Modus function is deployed (modus deploy). | ||
- Verify that your Hypermode API key is correct in GitHub Secrets. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module modus-gh-issue-summarizer | ||
|
||
go 1.23.6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is 1.23.6 really required? For instance, I'm running 1.23.3 and was able to get it to build (once I fixed the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "required" is an interesting word. There are security vulnerabilities in 1.23.5 that were fixed in 1.23.6. Also, we have Trunk in this repo, which uses OSV-Scanner, and will hit on some vulnerabilities depending on Go version. I've put some manually into the ignore list, but they're only false positives if you're actually running 1.23.6. Otherwise they could indeed be hit. (well, not the ppc one, but perhaps the others depending on the code.) In general, we recommend apps target the latest version of Go to avoid worrying about such things. Since this is a "recipes" repo then yes - our recommendations should be applied. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally get it from a production software sense--but my point was that this would stop a significant number of people from completing the recipe if it meant they had to upgrade Go on their system. |
||
|
||
require github.com/hypermodeinc/modus/sdk/go v0.17.1 | ||
|
||
require ( | ||
github.com/tidwall/gjson v1.18.0 // indirect | ||
github.com/tidwall/match v1.1.1 // indirect | ||
github.com/tidwall/pretty v1.2.1 // indirect | ||
github.com/tidwall/sjson v1.2.5 // indirect | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
github.com/hypermodeinc/modus/sdk/go v0.17.0 h1:vyS82iw31xuxqQKxiVtwrSNuF6hkMEJoynlcxthAeYM= | ||
github.com/hypermodeinc/modus/sdk/go v0.17.0/go.mod h1:UzVpTQDjloJuErOiNP3Tma3N8crE5qwYfKQyX1ecKlA= | ||
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= | ||
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= | ||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= | ||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= | ||
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= | ||
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to mention that for this example you'll need Go and TinyGo installed also.