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
|
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
|
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
|
endpoint), and a line-level diff preview before committing.
|
||||||
operations.
|
|
||||||
|
|
||||||
## Known limitations
|
## Known limitations
|
||||||
|
|
||||||
@@ -202,13 +201,12 @@ operations.
|
|||||||
access tokens remain the supported mobile sign-in.
|
access tokens remain the supported mobile sign-in.
|
||||||
- **Content code search** has no Gitea REST endpoint; the app offers "Find file"
|
- **Content code search** has no Gitea REST endpoint; the app offers "Find file"
|
||||||
(path search over the git tree) instead.
|
(path search over the git tree) instead.
|
||||||
- The in-app editor uses a self-contained WebView editor with line numbers and
|
- The in-app editor is **CodeMirror 6** (bundled at build time) with line
|
||||||
syntax highlighting; in-editor search/replace and CodeMirror 6 specifically
|
numbers, syntax highlighting and a search/replace panel.
|
||||||
are not built.
|
|
||||||
- Inline review comments can be composed at a line position (best-effort diff
|
- Inline review comments can be composed at a line position (best-effort diff
|
||||||
position mapping) — verify placement against your Gitea version.
|
position mapping) — verify placement against your Gitea version.
|
||||||
- Release assets can be uploaded/downloaded; package version-level deletion is
|
- Gitea's issues API exposes no sort parameter, so issue sorting is client-side
|
||||||
supported, but workflow enable/disable and package link/unlink are not.
|
(labels/milestone filtering is server-side).
|
||||||
- Gitea's REST API exposes no total count for some endpoints, so infinite
|
- Gitea's REST API exposes no total count for some endpoints, so infinite
|
||||||
scroll falls back to a page-length heuristic.
|
scroll falls back to a page-length heuristic.
|
||||||
- Features that are unavailable or disabled on a given instance degrade to a
|
- 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] Notifications inbox: read/unread, mark read, mark-all-read, unread badge
|
||||||
- [x] Lifecycle-aware notification polling tied to the refresh-interval setting
|
- [x] Lifecycle-aware notification polling tied to the refresh-interval setting
|
||||||
- [x] Notification subject-URL parsing → issue/PR/commit/repo navigation
|
- [x] Notification subject-URL parsing → issue/PR/commit/repo navigation
|
||||||
- [ ] Inline (line-level) review comments
|
- [x] Inline (line-level) review comments (display, reply + positioned composer)
|
||||||
- [ ] Server-side filter UI (label, milestone, assignee) and sorting
|
- [x] Filters (label, milestone) + sorting on the repository issue list
|
||||||
- [x] Reactions/subscriptions (issue reactions toggle + subscribe/unsubscribe)
|
- [x] Reactions/subscriptions (issue reactions toggle + subscribe/unsubscribe)
|
||||||
|
|
||||||
## Phase 4 — Code editing
|
## 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] Stale-SHA (409) conflict handling with a clear message
|
||||||
- [x] Unsaved-changes detection + discard
|
- [x] Unsaved-changes detection + discard
|
||||||
- [x] Per-instance editor/IDE URL template ("Open in editor"), system-browser/app fallback
|
- [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)
|
- [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
|
- [ ] Line-level diff preview before committing
|
||||||
|
|
||||||
## Phase 5 — Advanced features
|
## 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] Administration screens (users/orgs/repos, admin-gated)
|
||||||
- [x] Find file (recursive git-tree path search)
|
- [x] Find file (recursive git-tree path search)
|
||||||
- [x] Issue reactions and subscriptions; issue attachments
|
- [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)
|
- [ ] 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 |
|
| Reactions | ✅ | `GET/POST/DELETE …/issues/{n}/reactions` | toggle on issue detail |
|
||||||
| Subscriptions | ✅ | `…/issues/{n}/subscriptions` | subscribe/unsubscribe |
|
| Subscriptions | ✅ | `…/issues/{n}/subscriptions` | subscribe/unsubscribe |
|
||||||
| Attachments | ✅ | `GET …/issues/{n}/assets` | list + download |
|
| Attachments | ✅ | `GET …/issues/{n}/assets` | list + download |
|
||||||
| Labels/milestones management | 🟡 | `GET …/labels`, `…/milestones` | read + assign; CRUD not yet |
|
| Labels/milestones management | ✅ | `GET/POST/PATCH/DELETE …/labels`, `…/milestones` | full CRUD (create/edit/delete) |
|
||||||
| Server-side filters/sorting UI | 🟡 | `labels`, `milestones` params | API supports them; UI not wired |
|
| 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 | |
|
| Create/edit comments on PRs | ✅ | shared issue endpoint | |
|
||||||
|
|
||||||
## Pull requests
|
## Pull requests
|
||||||
@@ -110,8 +110,8 @@ available and the version-based capability probe for the rest.
|
|||||||
| Stale-SHA (409) handling | ✅ | clear conflict message |
|
| Stale-SHA (409) handling | ✅ | clear conflict message |
|
||||||
| Create PR after commit | ✅ | |
|
| Create PR after commit | ✅ | |
|
||||||
| Editor / IDE workspace | ✅ | configurable URL template, no token passthrough |
|
| Editor / IDE workspace | ✅ | configurable URL template, no token passthrough |
|
||||||
| In-editor search/replace | ⬜ | planned |
|
| In-editor search/replace | ✅ | CodeMirror search panel (toolbar button) |
|
||||||
| CodeMirror 6 specifically | ⬜ | a self-contained WebView editor is used instead (no bundled editor assets) |
|
| CodeMirror 6 | ✅ | bundled at build time into a generated TS module |
|
||||||
|
|
||||||
## Advanced
|
## Advanced
|
||||||
|
|
||||||
@@ -133,5 +133,5 @@ available and the version-based capability probe for the rest.
|
|||||||
| User profile edit, SSH/GPG keys, tokens | ✅ |
|
| User profile edit, SSH/GPG keys, tokens | ✅ |
|
||||||
| Instance capability probe (version-gated) | ✅ |
|
| Instance capability probe (version-gated) | ✅ |
|
||||||
| Administration (users/orgs/repos, read-only, admin-gated) | ✅ |
|
| Administration (users/orgs/repos, read-only, admin-gated) | ✅ |
|
||||||
| Workflow enable/disable | ⬜ |
|
| Workflow enable/disable | ✅ |
|
||||||
| Package helpers (link/unlink to repo) | ⬜ |
|
| Package helpers (link/unlink to repo) | ✅ |
|
||||||
@@ -9,6 +9,8 @@ import { GiteaClient } from './client';
|
|||||||
import {
|
import {
|
||||||
addRepoKey,
|
addRepoKey,
|
||||||
addIssueReaction,
|
addIssueReaction,
|
||||||
|
createLabel,
|
||||||
|
createMilestone,
|
||||||
createOrg,
|
createOrg,
|
||||||
createRelease,
|
createRelease,
|
||||||
createRepoVariable,
|
createRepoVariable,
|
||||||
@@ -16,11 +18,14 @@ import {
|
|||||||
deletePackageVersion,
|
deletePackageVersion,
|
||||||
fetchRepoTree,
|
fetchRepoTree,
|
||||||
listActionRuns,
|
listActionRuns,
|
||||||
|
linkPackageToRepo,
|
||||||
listReviewComments,
|
listReviewComments,
|
||||||
mergePull,
|
mergePull,
|
||||||
putRepoSecret,
|
putRepoSecret,
|
||||||
replyToReviewComment,
|
replyToReviewComment,
|
||||||
|
setWorkflowEnabled,
|
||||||
transferRepo,
|
transferRepo,
|
||||||
|
unlinkPackageFromRepo,
|
||||||
updateRepo,
|
updateRepo,
|
||||||
updateUserSettings,
|
updateUserSettings,
|
||||||
} from './endpoints';
|
} from './endpoints';
|
||||||
@@ -177,4 +182,39 @@ describe('endpoint request bodies', () => {
|
|||||||
expect(url).toContain('/repos/octo/repo/git/trees/main');
|
expect(url).toContain('/repos/octo/repo/git/trees/main');
|
||||||
expect(url).toContain('recursive=true');
|
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