-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add readme #3
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
Open
7h3-3mp7y-m4n
wants to merge
2
commits into
urunc-dev:main
Choose a base branch
from
7h3-3mp7y-m4n:readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+165
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| # urunc CI Dashboard | ||
|
|
||
| A real-time dashboard for monitoring urunc CI test status. | ||
|
|
||
| **Live Dashboard**: https://urunc-dev.github.io/ci-dashboard/ | ||
|
|
||
| ## Features | ||
|
|
||
| ### Dashboard UI | ||
|
|
||
| - **Dual-period stats** — separate stat cards for the last 24 hours and all-time totals (success rate, runs executed, passed, failed) | ||
| - **Workflow table** — sortable by name, last run conclusion, success rate, avg duration, and weather history | ||
| - **7-run weather history** — colored dots showing the last 7 run outcomes at a glance (oldest → newest) | ||
| - **Filter chips** — instantly filter by: All, Failing, Passing, Critical, Recent Failure, Recent Run, No Runs | ||
| - **Expandable drawer** — click any workflow row to reveal: | ||
| - **Runs table** — all recent runs with conclusion, date, duration, attempt number, and direct GitHub link | ||
| - **Structured log viewer** — failure signals grouped by category with keyword highlighting | ||
| - **Per-workflow charts** — avg job duration, pass/fail per run, duration trend | ||
| - **Overview charts panel** — activated via the Charts chip: | ||
| - Overall passed vs failed | ||
| - Avg duration per workflow | ||
| - Execution time last 7 runs per workflow | ||
| - Success rate by workflow | ||
| - **Auto-refresh indicator** — Data updates every cronjob run | ||
| ---------- | ||
|
|
||
| ## Architecture | ||
|
|
||
|  | ||
|
|
||
| ## Repository Layout | ||
|
|
||
| ``` | ||
| . | ||
| ├── .github/ | ||
| │ └── workflows/ | ||
| │ └── update-stats.yml # Cronjob, commits stats.json | ||
| ├── main.go # Data fetching, log analysis, stats generation | ||
| ├── notify.go # GitHub issue/comment notification engine | ||
| ├── config.yaml # All configuration | ||
| ├── index.html # Dashboard markup | ||
| ├── styles.css # Dark/light theme, table, chart, log viewer styles | ||
| ├── script.js # Dashboard logic — filters, charts, drawer, log renderer | ||
| └── stats.json # Auto-generated by cronjob | ||
| ``` | ||
|
|
||
| ---------- | ||
|
|
||
| ## Configuration | ||
|
|
||
| All configuration lives in `config.yaml`. | ||
|
|
||
| ### Settings | ||
|
|
||
| ```yaml | ||
| settings: | ||
| source_repo: "urunc-dev/urunc" # Repo to monitor | ||
| max_runs_per_workflow: 40 # Runs to fetch per workflow | ||
| recent_runs_in_output: 40 # Runs included in stats.json | ||
| ``` | ||
| ### Notifications | ||
|
|
||
| ```yaml | ||
| notify: | ||
| enabled: true | ||
| target_repo: "your-org/your-repo" # Where issues are opened | ||
| label: "ci-failure" # Label applied to opened issues | ||
| ``` | ||
|
|
||
| ### Log analysis | ||
|
|
||
| ```yaml | ||
| log_analysis: | ||
| max_signals_per_job: 40 | ||
|
|
||
| noise_patterns: # Lines matching these are dropped before analysis | ||
| - "sudo process started" | ||
| - "/usr/lib/gcc/" | ||
|
|
||
| categories: # Lower priority number = more important | ||
| - name: "Crash / Timeout" | ||
| priority: 1 | ||
| patterns: ["panic:", "test timed out", "deadlock"] | ||
|
|
||
| - name: "Network Failure" | ||
| priority: 2 | ||
| patterns: ["connection reset by peer", "i/o timeout"] | ||
|
|
||
| - name: "Test Failure" | ||
| priority: 3 | ||
| patterns: ["--- fail:", "expected", "received"] | ||
|
|
||
| - name: "Build Failure" | ||
| priority: 4 | ||
| patterns: ["make: ***", "##[error]", "compilation terminated"] | ||
|
|
||
| - name: "Fatal Runtime Error" | ||
| priority: 5 | ||
| patterns: ["level=fatal", "fatal: "] | ||
| ``` | ||
|
|
||
| The frontend log viewer maps these category names to colored badges automatically (`Crash / Timeout` → red, `Network Failure` → blue, `Test Failure` → orange, `Build Failure` → purple, `Fatal Runtime Error` → red). | ||
|
|
||
| ### Workflows | ||
|
|
||
| ```yaml | ||
| workflows: | ||
| - name: "ci" | ||
| description: "Main CI workflow" | ||
| critical: true # critical=true workflows trigger issue notifications | ||
| # and show a red "critical" badge in the dashboard | ||
| - name: "scorecard" | ||
| description: "Security scorecard" | ||
| critical: false # monitored in dashboard, no issue opened on failure | ||
| ``` | ||
| ---------- | ||
|
|
||
| ## How It Works | ||
|
|
||
| 1. **Github cronjob** fetches `workflows_raw.json` and `runs_raw.json` from the GitHub API using `gh CLI`, then progress with go app. | ||
| 2. For each configured workflow, the Go pipeline: | ||
| - Fetches job-level data for recent runs | ||
| - For failed jobs, downloads and time-windows the raw log, strips noise, categorises signals by priority | ||
| - Falls back to check-run annotations if the log has expired | ||
| - Builds a `WorkflowSummary` with weather history, failure rate, avg duration, and log snippets | ||
| 3. Writes `stats.json` and commits it back to the repo | ||
| 4. For each `critical: true` workflow with a recent failure, the notifier opens or updates a GitHub issue | ||
| 5. GitHub Pages serves `index.html` which fetches `stats.json` and renders the dashboard | ||
| ---------- | ||
|
|
||
|
|
||
| ## Local Development | ||
|
|
||
| ```bash | ||
| # Fetch raw data (requires gh CLI and GITHUB_TOKEN in environment) | ||
| export GITHUB_TOKEN=your_token | ||
|
|
||
| gh api repos/urunc-dev/urunc/actions/workflows \ | ||
| --paginate > workflows_raw.json | ||
|
|
||
| # Fetch runs for a specific workflow ID | ||
| gh api "repos/urunc-dev/urunc/actions/workflows/<id>/runs?per_page=40" \ | ||
| > runs_raw.json | ||
|
|
||
| # Run the pipeline | ||
| go run . | ||
|
|
||
| # Preview the dashboard | ||
| python3 -m http.server 8080 | ||
| open http://localhost:8080 | ||
| ``` | ||
| ---------- | ||
|
|
||
|
|
||
| ## Contributing | ||
|
|
||
| 1. **Add new tests/modify failure/notify**: Edit `config.yaml` and add desirable configurations | ||
| 2. **UI changes**: Modify `index.html`, `style.css`, or `app.js` | ||
| 3. **Cronjob data processing**: Modify `github/workflows/updates.yaml` | ||
|
|
||
| ---------- | ||
|
|
||
| ## License | ||
|
|
||
| Apache 2.0 - See [LICENSE](LICENSE) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would be better to create a directory and place this figure under it (e.g. images)
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.
Yeah, you are right, I was also thinking about that. I also opened a new PR regarding logo and favicon . We could add all those images in a directory like
assets/imageor something similar to that