startriage 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. startriage-0.1.0/.github/workflows/ci.yaml +34 -0
  2. startriage-0.1.0/.github/workflows/release.yaml +56 -0
  3. startriage-0.1.0/.gitignore +16 -0
  4. startriage-0.1.0/AGENTS.md +63 -0
  5. startriage-0.1.0/LICENSE +674 -0
  6. startriage-0.1.0/PKG-INFO +251 -0
  7. startriage-0.1.0/README.md +222 -0
  8. startriage-0.1.0/SECURITY.md +9 -0
  9. startriage-0.1.0/pyproject.toml +84 -0
  10. startriage-0.1.0/setup.cfg +4 -0
  11. startriage-0.1.0/snapcraft.yaml +61 -0
  12. startriage-0.1.0/startriage/__init__.py +1 -0
  13. startriage-0.1.0/startriage/__main__.py +6 -0
  14. startriage-0.1.0/startriage/ai/__init__.py +66 -0
  15. startriage-0.1.0/startriage/ai/agent.py +112 -0
  16. startriage-0.1.0/startriage/ai/contract.py +108 -0
  17. startriage-0.1.0/startriage/ai/provider.py +230 -0
  18. startriage-0.1.0/startriage/ai/render.py +204 -0
  19. startriage-0.1.0/startriage/ai/run.py +200 -0
  20. startriage-0.1.0/startriage/cli.py +541 -0
  21. startriage-0.1.0/startriage/config.py +368 -0
  22. startriage-0.1.0/startriage/data/agents_prompt.md +213 -0
  23. startriage-0.1.0/startriage/data/defaults.toml +54 -0
  24. startriage-0.1.0/startriage/data/report.html +385 -0
  25. startriage-0.1.0/startriage/dates.py +209 -0
  26. startriage-0.1.0/startriage/htmlreport.py +186 -0
  27. startriage-0.1.0/startriage/log.py +27 -0
  28. startriage-0.1.0/startriage/output.py +166 -0
  29. startriage-0.1.0/startriage/report.py +211 -0
  30. startriage-0.1.0/startriage/savebugs.py +135 -0
  31. startriage-0.1.0/startriage/source.py +35 -0
  32. startriage-0.1.0/startriage/sources/__init__.py +0 -0
  33. startriage-0.1.0/startriage/sources/discourse/__init__.py +4 -0
  34. startriage-0.1.0/startriage/sources/discourse/finder.py +217 -0
  35. startriage-0.1.0/startriage/sources/discourse/models.py +200 -0
  36. startriage-0.1.0/startriage/sources/discourse/triage.py +402 -0
  37. startriage-0.1.0/startriage/sources/github/__init__.py +0 -0
  38. startriage-0.1.0/startriage/sources/github/auth.py +142 -0
  39. startriage-0.1.0/startriage/sources/github/finder.py +345 -0
  40. startriage-0.1.0/startriage/sources/github/models.py +170 -0
  41. startriage-0.1.0/startriage/sources/github/triage.py +341 -0
  42. startriage-0.1.0/startriage/sources/launchpad/__init__.py +0 -0
  43. startriage-0.1.0/startriage/sources/launchpad/finder.py +462 -0
  44. startriage-0.1.0/startriage/sources/launchpad/models.py +506 -0
  45. startriage-0.1.0/startriage/sources/launchpad/triage.py +417 -0
  46. startriage-0.1.0/startriage/sources/proposed/__init__.py +0 -0
  47. startriage-0.1.0/startriage/sources/proposed/finder.py +166 -0
  48. startriage-0.1.0/startriage/sources/proposed/models.py +23 -0
  49. startriage-0.1.0/startriage/sources/proposed/triage.py +249 -0
  50. startriage-0.1.0/startriage/spinner.py +108 -0
  51. startriage-0.1.0/startriage/triage.py +105 -0
  52. startriage-0.1.0/startriage.egg-info/PKG-INFO +251 -0
  53. startriage-0.1.0/startriage.egg-info/SOURCES.txt +74 -0
  54. startriage-0.1.0/startriage.egg-info/dependency_links.txt +1 -0
  55. startriage-0.1.0/startriage.egg-info/entry_points.txt +2 -0
  56. startriage-0.1.0/startriage.egg-info/requires.txt +11 -0
  57. startriage-0.1.0/startriage.egg-info/scm_file_list.json +70 -0
  58. startriage-0.1.0/startriage.egg-info/scm_version.json +8 -0
  59. startriage-0.1.0/startriage.egg-info/top_level.txt +3 -0
  60. startriage-0.1.0/tests/__init__.py +0 -0
  61. startriage-0.1.0/tests/test_ai_agent.py +180 -0
  62. startriage-0.1.0/tests/test_ai_logging.py +73 -0
  63. startriage-0.1.0/tests/test_ai_provider.py +157 -0
  64. startriage-0.1.0/tests/test_ai_render.py +192 -0
  65. startriage-0.1.0/tests/test_ai_run.py +171 -0
  66. startriage-0.1.0/tests/test_api.py +143 -0
  67. startriage-0.1.0/tests/test_config.py +312 -0
  68. startriage-0.1.0/tests/test_dates.py +214 -0
  69. startriage-0.1.0/tests/test_discourse.py +300 -0
  70. startriage-0.1.0/tests/test_github_finder.py +262 -0
  71. startriage-0.1.0/tests/test_htmlreport.py +141 -0
  72. startriage-0.1.0/tests/test_launchpad_models.py +165 -0
  73. startriage-0.1.0/tests/test_launchpad_table.py +61 -0
  74. startriage-0.1.0/tests/test_proposed.py +72 -0
  75. startriage-0.1.0/tests/test_spinner.py +45 -0
  76. startriage-0.1.0/uv.lock +1270 -0
@@ -0,0 +1,34 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ # tags run CI through release.yaml
6
+ branches: ["**"]
7
+ pull_request:
8
+ workflow_call:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-26.04
16
+ # https://canonical-self-hosted-github-runner-docs.readthedocs-hosted.com/en/latest/usage/available_runners/#available-runners
17
+ #runs-on: [self-hosted, linux, X64, noble, small]
18
+ timeout-minutes: 10
19
+ steps:
20
+ - uses: actions/checkout@v6
21
+ with:
22
+ persist-credentials: false
23
+ - name: install uv
24
+ uses: astral-sh/setup-uv@v7
25
+ with:
26
+ enable-cache: true
27
+
28
+ - name: run tests
29
+ run: |
30
+ uv sync
31
+ uv run ruff check .
32
+ uv run ruff format --check .
33
+ uv run ty check .
34
+ uv run pytest .
@@ -0,0 +1,56 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ ci:
12
+ uses: ./.github/workflows/ci.yaml
13
+
14
+ build:
15
+ needs: ci
16
+ runs-on: ubuntu-26.04
17
+ timeout-minutes: 10
18
+ steps:
19
+ - uses: actions/checkout@v6
20
+ with:
21
+ # setuptools-scm derives the version from the tag
22
+ fetch-depth: 0
23
+ persist-credentials: false
24
+ - name: install uv
25
+ uses: astral-sh/setup-uv@v7
26
+ with:
27
+ # no cache poisoning of published artifacts
28
+ enable-cache: false
29
+
30
+ - name: build
31
+ run: |
32
+ uv build
33
+ version="${GITHUB_REF_NAME#v}"
34
+ test -f "dist/startriage-$version.tar.gz" || { ls dist; echo "no dist for version $version"; exit 1; }
35
+
36
+ - uses: actions/upload-artifact@v7
37
+ with:
38
+ name: dist
39
+ path: dist/
40
+
41
+ publish:
42
+ needs: build
43
+ runs-on: ubuntu-26.04
44
+ timeout-minutes: 10
45
+ environment:
46
+ name: pypi
47
+ url: https://pypi.org/project/startriage/
48
+ permissions:
49
+ # trusted publishing
50
+ id-token: write
51
+ steps:
52
+ - uses: actions/download-artifact@v8
53
+ with:
54
+ name: dist
55
+ path: dist/
56
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,16 @@
1
+ *.egg-info/
2
+ *.log
3
+ *.pyc
4
+ *.snap
5
+ *.so
6
+ *.orig
7
+ *.eggs
8
+ *.spec
9
+ *.tar.bz2
10
+ .*_cache/
11
+ .venv*/
12
+ .webassets-cache
13
+ __pycache__/
14
+ build/
15
+ dist/
16
+ snap/.snapcraft
@@ -0,0 +1,63 @@
1
+ # Agent Notes for startriage
2
+
3
+ ## Project Overview
4
+ `startriage` is a unified triage and planning tool for Ubuntu bugs, GitHub pull requests/issues, Discourse forum posts, and proposed migration tracking.
5
+ It is written in Python 3.12+ and uses asyncio for concurrent fetching.
6
+ It is designed to be used by all Ubuntu development teams, adjustable to their needs by customization.
7
+
8
+ ## Development Environment
9
+ - **Python**: >=3.12
10
+ - **Package Manager**: `uv`
11
+ - **Dependencies**: managed in `pyproject.toml`
12
+
13
+ ### Running the Tool
14
+ For development, run through `uv run`:
15
+
16
+ ```bash
17
+ uv run startriage ...
18
+ ```
19
+
20
+ ### Running Tests
21
+ - Libraries: `pytest`, `pytest-cov`, `pytest-asyncio`
22
+
23
+ ```bash
24
+ uv run pytest
25
+ ```
26
+
27
+ ### Releasing
28
+ - Push a `vX.Y.Z` tag: `.github/workflows/release.yaml` runs CI, builds and publishes to PyPI via trusted publishing (GitHub environment `pypi`)
29
+ - The version comes from the tag (setuptools-scm), never edit it by hand
30
+
31
+ ## Code Style
32
+ - Lint with `ty`, `ruff`, `ruff format` (line-length 110, target Python 3.12)
33
+ - Import sorting enabled (`I001`)
34
+
35
+ ## Libraries and Design
36
+ - use asyncio, aiohttp, ...
37
+ - keep it simple
38
+ - design for future extensibility and adjustment
39
+ - no overengineering or weird object orientation
40
+
41
+ ## Key Architecture
42
+ - `startriage/config.py` — Pydantic-based TOML config loading
43
+ - `startriage/cli.py` — argparse CLI with subcommands (`triage`, `todo`, `config`)
44
+ - `startriage/triage.py` — library API: `build_filter()`, `fetch()`; no rendering
45
+ - `startriage/report.py` — renders `triage`/`todo` reports (terminal, markdown, json) on top of `fetch()`
46
+ - `startriage/htmlreport.py` — `--html` page from `TriageResult.report_items()` (source-independent `output.ReportItem` rows); page shell in `data/report.html`
47
+ - `startriage/sources/` — per-source packages: `github/`, `launchpad/`, `discourse/`, `proposed/`
48
+ - Each source has a `finder.py` (fetch data) and `triage.py` (render output)
49
+ - The common data structure for triage results is `startriage/output.py/TriageResult`
50
+ - Library entry: `triage.build_filter()` + `triage.fetch()` return `{source: TriageResult}` without rendering; `await result.to_dict()` gives structured data (also `--format json`)
51
+ - Only `startriage login {launchpad,github}` prompts; sources never do and fail without credentials
52
+
53
+ ## Design
54
+ - `triage` mode
55
+ - the idea is to find work and asses it to move it into `todo` mode
56
+ - usually run every day to see changes on the previous day(s)
57
+ - filters tasks by watched projects and recent activity
58
+ - does not consider "todo" tags
59
+ - `todo` mode
60
+ - the idea is to keep track of actionable tasks found in `triage` mode - and to assign/work on them
61
+ - usually run once a week for housekeeping
62
+ - filters tasks tags found during triage by the team's "todo" tags that were set if actionable
63
+ - supports saving and comparing against previous runs to spot new and closed tasks