Commit graph

63 commits

Author SHA1 Message Date
Stefan Hausotte
992c628abd refactor: fix linting issues 2026-05-17 21:40:51 +02:00
Stefan Hausotte
6faf3ad986 chore: update ForgejoKit to 0.6.1 2026-05-17 21:40:36 +02:00
pdurlej
a93130ee09 refactor: use ForgejoKit error categories (#31)
Problem
- SessionRestoreError now duplicates HTTP status-code classification that ForgejoKit exposes in 0.6.0.

Change
- Uses ForgejoKit's httpErrorCategory/httpStatusCode for auth and service restore failures.
- Keeps the same user-facing SessionRestoreError outcomes.
- Leaves network and certificate handling unchanged.

Tests
- DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -quiet -project Forji/Forji.xcodeproj -scheme Forji -destination "platform=iOS Simulator,name=iPhone 17 Pro,OS=26.4.1" build-for-testing -only-testing:ForjiTests/SessionRestoreErrorTests
- DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -quiet -project Forji/Forji.xcodeproj -scheme Forji -destination "platform=iOS Simulator,name=iPhone 17 Pro,OS=26.4.1" test-without-building -only-testing:ForjiTests/SessionRestoreErrorTests

Co-authored-by: Piotr Durlej <pdurlej@users.noreply.github.com>
Reviewed-on: https://codeberg.org/secana/Forji/pulls/31
2026-05-17 21:29:12 +02:00
Stefan Hausotte
075669d87e test: fix warning in test 2026-05-12 18:20:09 +02:00
Stefan Hausotte
fd85a211f6 chore: update ForgejoKit to 0.6.0 2026-05-12 18:19:58 +02:00
pdurlej
5e22431d11 fix: preserve token restore error context (#30)
Problem
- Token-only session restore currently reports every token validation failure as an expired/revoked token, including permission, server, network, and invalid-response failures.

Change
- Preserves token validation error context for token-only instances.
- Maps auth/service/network failures to more specific user-facing restore errors.
- Leaves password fallback behavior unchanged for password-based instances.

Tests
- DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -quiet -project Forji/Forji.xcodeproj -scheme Forji -destination "platform=iOS Simulator,name=iPhone 17 Pro,OS=26.4.1" build-for-testing -only-testing:ForjiTests/SessionRestoreErrorTests
- DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -quiet -project Forji/Forji.xcodeproj -scheme Forji -destination "platform=iOS Simulator,name=iPhone 17 Pro,OS=26.4.1" test-without-building -only-testing:ForjiTests/SessionRestoreErrorTests

Co-authored-by: Piotr Durlej <pdurlej@users.noreply.github.com>
Reviewed-on: https://codeberg.org/secana/Forji/pulls/30
Reviewed-by: secana <secana@noreply.codeberg.org>
2026-05-12 17:45:02 +02:00
Stefan Hausotte
db4e54db6b chore: add "just sim-update" command
Updates the iOS simulators to the latest version in XCode
2026-05-10 11:01:40 +02:00
pdurlej
0b815335a9 fix: key multi-instance fallback by account (#29)
## Summary

This changes the multi-instance fallback map to key bootstrapped connections by account instead of server URL only.

Previously, `connect(instances:)` built a dictionary keyed only by `instance.serverURL`. If two accounts used the same Forgejo instance, `Dictionary(uniqueKeysWithValues:)` could trap on duplicate keys, and fallback lookup could also reuse the wrong account for a failed restore.

## Changes

- Add an account key based on normalized server URL + username.
- Use that key for bootstrapped connection fallback in `MultiInstanceManager`.
- Add a regression test covering two token-auth accounts on the same server URL.

## Verification

- `git diff --check` passes.
- I could not run `xcodebuild` locally because the available Xcode install has not accepted the license on this machine (`xcodebuild` exits before build/test execution).

Co-authored-by: Piotr Durlej <pdurlej@users.noreply.github.com>
Reviewed-on: https://codeberg.org/secana/Forji/pulls/29
Reviewed-by: secana <secana@noreply.codeberg.org>
2026-05-10 10:39:02 +02:00
Stefan Hausotte
f7eba701e2 chore: update Forji version 2026-05-07 19:28:42 +02:00
Stefan Hausotte
57bde0934f refactor: small name changes 2026-05-07 19:17:49 +02:00
Stefan Hausotte
2e07f6da4d test: make tests more stable 2026-05-07 19:07:40 +02:00
Stefan Hausotte
ea9c9825e0 test: fix race condition in tests 2026-05-07 18:21:09 +02:00
Voislav Vasiljevski
3d3de81f2b [Draft] feat: Actions tab — depends on ForgejoKit#1 (#28)
Closes #3.

Adds an "Actions" tab to the repository view, surfacing Forgejo Actions runs and (experimentally) their jobs, steps, and logs.

## What's in this branch

1. ~~**`chore: point ForgejoKit at local checkout for Actions PR`** — temporary `XCLocalSwiftPackageReference` so the feature commit compiles against the unreleased ForgejoKit changes. Drop this commit before merge and replace with `chore: bump ForgejoKit to <new version>` once the ForgejoKit PR ships in a release.~~

   **`chore: update ForgejoKit to released version 0.4.0`** + **`chore: add ForgejoKit 0.4.0 to Package.resolved`** — switches from local path override to a remote pin at `secana/ForgejoKit` `0.4.0`.

2. **`feat: add Actions tab to repository view`** — the actual feature.

## UI scope

- New `Actions` tab, shown only when `repository.hasActions == true`.
- Runs list with All / Running / Success / Failed filter, pagination, pull-to-refresh, empty state.
- Run detail with header, metadata (workflow file, event, trigger user, started/duration — zero-Date suppressed), and an experimental Jobs section.
- Job view with collapsible step rows; logs lazy-load on expand via `logCursors`.
- "Open in browser" toolbar item using each run's `html_url`.

## Experimental jobs/steps view

Forgejo's `/api/v1` doesn't expose jobs, steps, or step logs for a run. This PR opts into ForgejoKit's experimental `fetchRunView` (backed by Forgejo's web-UI route) so we can render a GitHub-Actions-style view today. The Jobs section and Steps screen are explicitly labelled "Experimental" in the UI, and a footer notes the output may change between Forgejo versions. Happy to drop this section if you'd rather ship public-API only first.

## Defensive handling

- Forgejo serialises an unset `time.Time` as `0001-01-01T00:00:00Z` (showed up as "Started 56 yrs, 4 mths" / "Duration 493 906h" on a cancelled run). Sanitised display helpers suppress any pre-2000 date.
- The experimental `fetchRunView` resolves Forgejo's `RedirectToLatestAttempt` server-side before POSTing, so attempts with non-zero attempt numbers work. (Without this, Forgejo returns 500 "task with job_id N and attempt 0: resource does not exist".)

## Tests

- Unit: `WorkflowRunFilterTests`, `WorkflowStatusIconTests` (filter mapping, status enum compatibility against Forgejo's documented values, status icon mapping, run helpers, zero-date guard).
- UI: `ActionsUITests` (read-only smoke test).

Co-authored-by: Voislav Vasiljevski <voislav@voioo.cz>
Reviewed-on: https://codeberg.org/secana/Forji/pulls/28
2026-05-07 18:06:17 +02:00
Stefan Hausotte
d7a883efda test: update forgejo to version 15 2026-04-20 16:52:59 +02:00
Stefan Hausotte
d879440577 fix: "dismiss" not available on notifactions in "All Instance" view 2026-04-14 18:46:34 +02:00
Stefan Hausotte
666b8e57c3 chore: update version 2026-04-01 13:49:54 +02:00
Stefan Hausotte
bf65e6d13d fix: multi-instance persistent cache 2026-03-31 23:09:18 +02:00
Stefan Hausotte
2c2b61e249 feat: filter for repos #16 2026-03-31 20:11:22 +02:00
secana
095adfb22a Merge pull request 'feat/persistent-cache' (#25) from feat/persistent-cache into main
Reviewed-on: https://codeberg.org/secana/Forji/pulls/25
2026-03-28 19:32:18 +01:00
Stefan Hausotte
25de1be2d9 feat: disable PR view for mirrored repos 2026-03-28 19:31:07 +01:00
Stefan Hausotte
5aa65525cf feat: persistent cache #17 2026-03-28 19:31:07 +01:00
Stefan Hausotte
c42ed9552e test: improve test runtime
Reviewed-on: https://codeberg.org/secana/Forji/pulls/24
Co-authored-by: Stefan Hausotte <stefan.hausotte@gmx.de>
Co-committed-by: Stefan Hausotte <stefan.hausotte@gmx.de>
2026-03-23 19:07:55 +01:00
Stefan Hausotte
253f3e88d1 feat: implement iOS notifications #6
Naive implementation for iOS notifications.

Problem: Forgejo does not support push notifications. We need to pull every  X minutes for new notifications. The even bigger problem: iOS does not support background polling. So this is more a "as good as possible" but not good approach.

Reviewed-on: https://codeberg.org/secana/Forji/pulls/23
Co-authored-by: Stefan Hausotte <stefan.hausotte@gmx.de>
Co-committed-by: Stefan Hausotte <stefan.hausotte@gmx.de>
2026-03-22 17:43:21 +01:00
Stefan Hausotte
92a928b2f4 fix: missing merge button
Co-authored-by: Stefan Hausotte <stefan.hausotte@gmx.de>
Co-committed-by: Stefan Hausotte <stefan.hausotte@gmx.de>
2026-03-22 11:54:24 +01:00
secana
07727b6f90 Merge pull request 'refactor: reduce code complexity' (#21) from refactor/reduce-complexity into main 2026-03-22 11:42:40 +01:00
Stefan Hausotte
556c614011 refactor: reduce code complexity (#19)
Co-authored-by: Stefan Hausotte <stefan.hausotte@gmx.de>
Co-committed-by: Stefan Hausotte <stefan.hausotte@gmx.de>
2026-03-21 15:57:34 +01:00
Stefan Hausotte
d61851b9e9 refactor: reduce code complexity 2026-03-21 15:52:53 +01:00
Stefan Hausotte
0bcca64d3a refactor: small changes 2026-03-21 15:23:44 +01:00
Stefan Hausotte
10bbed5596 feat: combined instance view (#18)
Co-authored-by: Stefan Hausotte <stefan.hausotte@gmx.de>
Co-committed-by: Stefan Hausotte <stefan.hausotte@gmx.de>
2026-03-21 15:03:28 +01:00
Stefan Hausotte
70a1cf010a chore: bump version to 1.2 2026-03-15 21:19:16 +01:00
Stefan Hausotte
43900cfb11 fix: linting errors 2026-03-15 21:07:22 +01:00
Stefan Hausotte
3adda37fb1 refactor: clean up justfile 2026-03-12 19:37:33 +01:00
Stefan Hausotte
6596f6116d test: switch from bash to swift for integration test setup 2026-03-11 22:44:19 +01:00
Stefan Hausotte
0505a03bc8 fix: code review issues 2026-03-11 20:51:43 +01:00
Stefan Hausotte
a7fa09f6ea feat: cache views instead of reloading all items #12 2026-03-11 20:27:38 +01:00
Stefan Hausotte
eede8a3467 test: fix tests 2026-03-11 19:42:25 +01:00
Stefan Hausotte
781826004b feat: show only user related content #11 2026-03-10 21:39:52 +01:00
Stefan Hausotte
57fd862149 fix: missing gap on top of list itmes #10 2026-03-10 20:47:42 +01:00
Stefan Hausotte
ddefefdd7f fix: surpress "canelled" error on view switches #9 2026-03-10 20:21:47 +01:00
Stefan Hausotte
3ba19d328b docs: add licence grant 2026-03-09 20:46:31 +01:00
Stefan Hausotte
26bba7d7ee feat: add "mirror" badge for mirrored repos #8 2026-03-09 20:41:34 +01:00
Stefan Hausotte
79742e761d feat: HTML rendering in markdown files #7 2026-03-09 20:27:08 +01:00
Stefan Hausotte
d51ac33c71 feat: add "archived" markter to repos #2 2026-03-09 18:46:10 +01:00
Stefan Hausotte
252a72150a docs: add App Store link to readme 2026-03-09 18:02:07 +01:00
Stefan Hausotte
f5849f4b69 docs: change the way the version is set 2026-03-08 20:02:12 +01:00
Stefan Hausotte
18d61c4b18 fix: missing comma on preview 2026-03-08 19:55:08 +01:00
Stefan Hausotte
33c6938b6c docs: improve distribution docs 2026-03-08 19:51:42 +01:00
Stefan Hausotte
003fbb9703 chore: format code 2026-03-08 19:48:37 +01:00
Stefan Hausotte
5bfb5babe0 chore: bump version for new release 2026-03-08 19:45:50 +01:00
Stefan Hausotte
0e4aba2c62 docs: add instructions to release a new version 2026-03-08 19:45:38 +01:00