test/docs: endpoint tests for label/milestone/workflow/package-link; refresh docs
- endpoint tests for createLabel/createMilestone/setWorkflowEnabled/link+unlink (129 total) - FEATURE_PARITY, ROADMAP and README updated: CodeMirror 6, search/replace, labels/milestones CRUD, filters/sorting, workflow enable/disable, package link/unlink are done
This commit is contained in:
1 parent
883440b8be
commit
fbefa0d345
4 files changed
+57
-19
No files matched your search
@@ -192,8 +192,7 @@ state/data-flow, API client and account-registry design.
|
||||
|
||||
See [`ROADMAP.md`](ROADMAP.md). Phases 0–5 are implemented. The only explicit
|
||||
gaps are OAuth sign-in (PAT is the supported path), content code search (no REST
|
||||
endpoint), in-editor search/replace, and a handful of rare Actions/package
|
||||
operations.
|
||||
endpoint), and a line-level diff preview before committing.
|
||||
|
||||
## Known limitations
|
||||
|
||||
@@ -202,13 +201,12 @@ operations.
|
||||
access tokens remain the supported mobile sign-in.
|
||||
- **Content code search** has no Gitea REST endpoint; the app offers "Find file"
|
||||
(path search over the git tree) instead.
|
||||
- The in-app editor uses a self-contained WebView editor with line numbers and
|
||||
syntax highlighting; in-editor search/replace and CodeMirror 6 specifically
|
||||
are not built.
|
||||
- The in-app editor is **CodeMirror 6** (bundled at build time) with line
|
||||
numbers, syntax highlighting and a search/replace panel.
|
||||
- Inline review comments can be composed at a line position (best-effort diff
|
||||
position mapping) — verify placement against your Gitea version.
|
||||
- Release assets can be uploaded/downloaded; package version-level deletion is
|
||||
supported, but workflow enable/disable and package link/unlink are not.
|
||||
- Gitea's issues API exposes no sort parameter, so issue sorting is client-side
|
||||
(labels/milestone filtering is server-side).
|
||||
- Gitea's REST API exposes no total count for some endpoints, so infinite
|
||||
scroll falls back to a page-length heuristic.
|
||||
- Features that are unavailable or disabled on a given instance degrade to a
|
||||
|
||||
+6
-6
@@ -99,8 +99,8 @@ Architectural decisions are recorded in `docs/ARCHITECTURE.md`.
|
||||
- [x] Notifications inbox: read/unread, mark read, mark-all-read, unread badge
|
||||
- [x] Lifecycle-aware notification polling tied to the refresh-interval setting
|
||||
- [x] Notification subject-URL parsing → issue/PR/commit/repo navigation
|
||||
- [ ] Inline (line-level) review comments
|
||||
- [ ] Server-side filter UI (label, milestone, assignee) and sorting
|
||||
- [x] Inline (line-level) review comments (display, reply + positioned composer)
|
||||
- [x] Filters (label, milestone) + sorting on the repository issue list
|
||||
- [x] Reactions/subscriptions (issue reactions toggle + subscribe/unsubscribe)
|
||||
|
||||
## Phase 4 — Code editing
|
||||
@@ -113,9 +113,9 @@ Architectural decisions are recorded in `docs/ARCHITECTURE.md`.
|
||||
- [x] Stale-SHA (409) conflict handling with a clear message
|
||||
- [x] Unsaved-changes detection + discard
|
||||
- [x] Per-instance editor/IDE URL template ("Open in editor"), system-browser/app fallback
|
||||
- [x] In-app code editor in a WebView (line numbers + syntax highlighting)
|
||||
- [x] In-app code editor in a WebView (CodeMirror 6, line numbers, highlighting)
|
||||
- [x] In-editor search/replace (CodeMirror search panel)
|
||||
- [x] IDE auth stays separate from Gitea API auth (no token in the URL)
|
||||
- [ ] In-editor search/replace (CodeMirror 6)
|
||||
- [ ] Line-level diff preview before committing
|
||||
|
||||
## Phase 5 — Advanced features
|
||||
@@ -141,9 +141,9 @@ Architectural decisions are recorded in `docs/ARCHITECTURE.md`.
|
||||
- [x] Administration screens (users/orgs/repos, admin-gated)
|
||||
- [x] Find file (recursive git-tree path search)
|
||||
- [x] Issue reactions and subscriptions; issue attachments
|
||||
- [x] Package version-level delete
|
||||
- [x] Package version-level delete; link/unlink a package to a repository
|
||||
- [x] Workflow enable/disable
|
||||
- [ ] Content code search (no Gitea REST endpoint)
|
||||
- [ ] In-editor search/replace (CodeMirror 6)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ available and the version-based capability probe for the rest.
|
||||
| Reactions | ✅ | `GET/POST/DELETE …/issues/{n}/reactions` | toggle on issue detail |
|
||||
| Subscriptions | ✅ | `…/issues/{n}/subscriptions` | subscribe/unsubscribe |
|
||||
| Attachments | ✅ | `GET …/issues/{n}/assets` | list + download |
|
||||
| Labels/milestones management | 🟡 | `GET …/labels`, `…/milestones` | read + assign; CRUD not yet |
|
||||
| Server-side filters/sorting UI | 🟡 | `labels`, `milestones` params | API supports them; UI not wired |
|
||||
| Labels/milestones management | ✅ | `GET/POST/PATCH/DELETE …/labels`, `…/milestones` | full CRUD (create/edit/delete) |
|
||||
| Server-side filters/sorting UI | ✅ | `labels`, `milestones` params | server-side label/milestone filters; sorting is client-side (Gitea exposes no issues sort param) |
|
||||
| Create/edit comments on PRs | ✅ | shared issue endpoint | |
|
||||
|
||||
## Pull requests
|
||||
@@ -110,8 +110,8 @@ available and the version-based capability probe for the rest.
|
||||
| Stale-SHA (409) handling | ✅ | clear conflict message |
|
||||
| Create PR after commit | ✅ | |
|
||||
| Editor / IDE workspace | ✅ | configurable URL template, no token passthrough |
|
||||
| In-editor search/replace | ⬜ | planned |
|
||||
| CodeMirror 6 specifically | ⬜ | a self-contained WebView editor is used instead (no bundled editor assets) |
|
||||
| In-editor search/replace | ✅ | CodeMirror search panel (toolbar button) |
|
||||
| CodeMirror 6 | ✅ | bundled at build time into a generated TS module |
|
||||
|
||||
## Advanced
|
||||
|
||||
@@ -133,5 +133,5 @@ available and the version-based capability probe for the rest.
|
||||
| User profile edit, SSH/GPG keys, tokens | ✅ |
|
||||
| Instance capability probe (version-gated) | ✅ |
|
||||
| Administration (users/orgs/repos, read-only, admin-gated) | ✅ |
|
||||
| Workflow enable/disable | ⬜ |
|
||||
| Package helpers (link/unlink to repo) | ⬜ |
|
||||
| Workflow enable/disable | ✅ |
|
||||
| Package helpers (link/unlink to repo) | ✅ |
|
||||
@@ -9,6 +9,8 @@ import { GiteaClient } from './client';
|
||||
import {
|
||||
addRepoKey,
|
||||
addIssueReaction,
|
||||
createLabel,
|
||||
createMilestone,
|
||||
createOrg,
|
||||
createRelease,
|
||||
createRepoVariable,
|
||||
@@ -16,11 +18,14 @@ import {
|
||||
deletePackageVersion,
|
||||
fetchRepoTree,
|
||||
listActionRuns,
|
||||
linkPackageToRepo,
|
||||
listReviewComments,
|
||||
mergePull,
|
||||
putRepoSecret,
|
||||
replyToReviewComment,
|
||||
setWorkflowEnabled,
|
||||
transferRepo,
|
||||
unlinkPackageFromRepo,
|
||||
updateRepo,
|
||||
updateUserSettings,
|
||||
} from './endpoints';
|
||||
@@ -177,4 +182,39 @@ describe('endpoint request bodies', () => {
|
||||
expect(url).toContain('/repos/octo/repo/git/trees/main');
|
||||
expect(url).toContain('recursive=true');
|
||||
});
|
||||
|
||||
it('creates a label and a milestone', async () => {
|
||||
const { fetchImpl, client } = capture();
|
||||
await createLabel(client, 'octo', 'repo', { name: 'bug', color: 'd73a4a' });
|
||||
expect(fetchImpl.mock.calls[0][0]).toBe('https://codeberg.org/api/v1/repos/octo/repo/labels');
|
||||
expect(postedBody(fetchImpl)).toMatchObject({ name: 'bug', color: 'd73a4a' });
|
||||
|
||||
fetchImpl.mockClear();
|
||||
await createMilestone(client, 'octo', 'repo', { title: 'v1' });
|
||||
expect(fetchImpl.mock.calls[0][0]).toBe('https://codeberg.org/api/v1/repos/octo/repo/milestones');
|
||||
expect(postedBody(fetchImpl)).toMatchObject({ title: 'v1' });
|
||||
});
|
||||
|
||||
it('enables and disables a workflow', async () => {
|
||||
const { fetchImpl, client } = capture();
|
||||
await setWorkflowEnabled(client, 'octo', 'repo', 'ci.yml', false);
|
||||
expect(fetchImpl.mock.calls[0][0]).toBe(
|
||||
'https://codeberg.org/api/v1/repos/octo/repo/actions/workflows/ci.yml/disable',
|
||||
);
|
||||
expect(fetchImpl.mock.calls[0][1].method).toBe('PUT');
|
||||
});
|
||||
|
||||
it('links and unlinks a package to a repository', async () => {
|
||||
const { fetchImpl, client } = capture();
|
||||
await linkPackageToRepo(client, 'octo', 'npm', 'pkg', 'my-repo');
|
||||
expect(fetchImpl.mock.calls[0][0]).toBe(
|
||||
'https://codeberg.org/api/v1/packages/octo/npm/pkg/-/link/my-repo',
|
||||
);
|
||||
|
||||
fetchImpl.mockClear();
|
||||
await unlinkPackageFromRepo(client, 'octo', 'npm', 'pkg');
|
||||
expect(fetchImpl.mock.calls[0][0]).toBe(
|
||||
'https://codeberg.org/api/v1/packages/octo/npm/pkg/-/unlink',
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user