run: read Forgejo 16 logs through job API #239
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-actions-rest-logs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
fj run view --logthrough Forgejo 16 run jobs and job log APIsFJ_TOKENprecedence so env-token-only environments do not touch an unreadable token storemain, so PR lists/views decode Forgejo synthetic reviewers such asforgejo-actionswith id-2/versioninstead of a task-shape parse errorcoverage_nightlyexplicitly and covering workflow-log helper pathsVerification
cargo testcargo test api::workflow_logs::tests -- --nocapturecargo test explicit_host_uses_env_token_without_reading_token_store -- --nocapturecargo test run_logs_resolves_run_number_beyond_first_page -- --nocapturecargo test deserializes_negative_system_actor_id -- --nocapturemake coverage-strict COV_MIN=73cargo run --quiet -- pr list -R rasterstate/fj --json --no-pagerdecoded PR #239, includingrequested_reviewers[0].id = -2forforgejo-actions.curl https://commons.fjord.host/api/v1/versionreturned15.0.6+gitea-1.22.0.target/debug/fj run view 101 --log --job 0 -R rasterstate/lane-image --host rasterhub.comprinted real log text, includingRunner 31f8e0d0-ce1d-4ffc-b87f-2f8b93db63ee ... received task 33277 of job shellcheckandJob succeeded.env -u FJ_TOKEN target/debug/fj run list -R fjord/actions --limit 3 --host commons.fjord.hostlisted public runs.env -u FJ_TOKEN target/debug/fj run view 2 --log -R fjord/actions --host commons.fjord.hostfailed with the versioneddoes not expose the token-authenticated Actions job log APImessage.Notes
fj api /version --host commons.fjord.hostsends an invalid ambient Rasterhub token to commons and gets401; direct curl without an auth header gets200.fj run watchstill uses the existing web route and on rasterhub PAT auth returns the existing actionable web-log auth error; rerun/cancel are state-changing and were not executed against production.Forseti review
2 blocking finding(s) from the lead reviewer (advisory: not gating merges yet).
Findings
P1
src/client/resolve.rs:40—Option::orevaluates its argument eagerly, soauth::load_token(&name)?is called even whenauth::env_token()returns a token. That regresses the previous behavior where an environment token was sufficient on its own; in environments without a working keyring/token store, commands using FJ_TOKEN can now fail before the env token is used.P1
src/api/workflow_logs.rs:409—fj run view --lognow resolves the displayed run number by callinglist_runs(..., 50)and searching only that single page. Any valid run number outside the latest 50 entries will be reported as not found before the jobs/log APIs are tried, even though the user supplied an explicit run number and the previous task-based path did not have this pagination limit. This breaks log viewing for older runs in repositories with more than 50 workflow runs.PR:
rasterstate/fj#239Head SHA:
dc36da0274d5Review job:
sha256:4d9443c97c5671a5208dbea6202c5c0ec9beb772152bb8542fcc11e867169058Provider pair:
openai:gpt-5.5+anthropic:claude-haiku-4-5-20251001Blocking findings:
2Inline findings:
2Model tokens:
83091 in / 10712 out(33586from cache) ≈$0.3687Token source:
GITHUB_TOKENRunner:
c7e168fb8174Run: https://rasterhub.com/rasterstate/fj/actions/runs/421
Forseti review
2 blocking finding(s) from the lead reviewer (advisory: not gating merges yet).
Findings
P1
src/client/resolve.rs:40—Option::orevaluates its argument eagerly, soauth::load_token(&name)?is called even whenauth::env_token()returns a token. That regresses the previous behavior where an environment token was sufficient on its own; in environments without a working keyring/token store, commands using FJ_TOKEN can now fail before the env token is used.P1
src/api/workflow_logs.rs:409—fj run view --lognow resolves the displayed run number by callinglist_runs(..., 50)and searching only that single page. Any valid run number outside the latest 50 entries will be reported as not found before the jobs/log APIs are tried, even though the user supplied an explicit run number and the previous task-based path did not have this pagination limit. This breaks log viewing for older runs in repositories with more than 50 workflow runs.PR:
rasterstate/fj#239Head SHA:
dc36da0274d5Review job:
sha256:4d9443c97c5671a5208dbea6202c5c0ec9beb772152bb8542fcc11e867169058Provider pair:
openai:gpt-5.5+anthropic:claude-haiku-4-5-20251001Blocking findings:
2Inline findings:
2Model tokens:
83091 in / 10712 out(33586from cache) ≈$0.3687Token source:
GITHUB_TOKENRunner:
c7e168fb8174Run: https://rasterhub.com/rasterstate/fj/actions/runs/421
Forseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#239f9a70c680278sha256:b762ae470499a8534383156380405fe1312108944570426a3cdf2f90a6909d3aopenai:gpt-5.5+anthropic:claude-haiku-4-5-202510010091065 in / 13540 out(38450from cache) ≈$0.5074GITHUB_TOKEN4740cc42430bForseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#239f9a70c680278sha256:b762ae470499a8534383156380405fe1312108944570426a3cdf2f90a6909d3aopenai:gpt-5.5+anthropic:claude-haiku-4-5-202510010091065 in / 13540 out(38450from cache) ≈$0.5074GITHUB_TOKEN4740cc42430bForseti review
No blocking findings from the lead reviewer.
Findings
P2
src/client/resolve.rs:207— This test mutates process-globalXDG_CONFIG_HOMEandFJ_TOKENwhile Rust tests in the same binary may run concurrently. Any other test resolving config or auth during this window can observe the invalid config path or env token and fail nondeterministically; the manual restore also would not run if the test panics before those lines.PR:
rasterstate/fj#239Head SHA:
02f148e68de2Review job:
sha256:a1df3928668f4f940d57f90252e53333a8166efdcf7196f44dc980fb60df556cProvider pair:
openai:gpt-5.5+anthropic:claude-haiku-4-5-20251001Blocking findings:
0Inline findings:
1Model tokens:
104691 in / 14412 out(42546from cache) ≈$0.5178Token source:
GITHUB_TOKENRunner:
d65ba87981a3Run: https://rasterhub.com/rasterstate/fj/actions/runs/425
Forseti review
No blocking findings from the lead reviewer.
Findings
P2
src/client/resolve.rs:207— This test mutates process-globalXDG_CONFIG_HOMEandFJ_TOKENwhile Rust tests in the same binary may run concurrently. Any other test resolving config or auth during this window can observe the invalid config path or env token and fail nondeterministically; the manual restore also would not run if the test panics before those lines.PR:
rasterstate/fj#239Head SHA:
02f148e68de2Review job:
sha256:a1df3928668f4f940d57f90252e53333a8166efdcf7196f44dc980fb60df556cProvider pair:
openai:gpt-5.5+anthropic:claude-haiku-4-5-20251001Blocking findings:
0Inline findings:
1Model tokens:
104691 in / 14412 out(42546from cache) ≈$0.5178Token source:
GITHUB_TOKENRunner:
d65ba87981a3Run: https://rasterhub.com/rasterstate/fj/actions/runs/425
02f148e68df7304e31a3Forseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#239f7304e31a371sha256:e673215dc4480c51fbf8528dc13a7edae815637da31ec62b261bb048e1b78a3copenai:gpt-5.5+anthropic:claude-haiku-4-5-2025100100120228 in / 13087 out(46642from cache) ≈$0.5371GITHUB_TOKENef85bdcad803Forseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#239f7304e31a371sha256:e673215dc4480c51fbf8528dc13a7edae815637da31ec62b261bb048e1b78a3copenai:gpt-5.5+anthropic:claude-haiku-4-5-2025100100120228 in / 13087 out(46642from cache) ≈$0.5371GITHUB_TOKENef85bdcad803f7304e31a331a8e4e8aaForseti review
No blocking findings from the lead reviewer.
Findings
P2
src/client/resolve.rs:204— This test changesXDG_CONFIG_HOMEandFJ_TOKEN, which are process-global. Rust tests run in parallel by default, so any concurrently running test that resolves config or tokens can observe these temporary values and fail nondeterministically.PR:
rasterstate/fj#239Head SHA:
31a8e4e8aa56Review job:
sha256:dbe7f50ba15cd4f3e60c80529b965af8cab3a34d0d04d233e6f8a948b5dbed02Provider pair:
openai:gpt-5.5+anthropic:claude-haiku-4-5-20251001Blocking findings:
0Inline findings:
1Model tokens:
121272 in / 15299 out(46642from cache) ≈$0.6100Token source:
GITHUB_TOKENRunner:
f941f7e38ad5Run: https://rasterhub.com/rasterstate/fj/actions/runs/429
Forseti review
No blocking findings from the lead reviewer.
Findings
P2
src/client/resolve.rs:204— This test changesXDG_CONFIG_HOMEandFJ_TOKEN, which are process-global. Rust tests run in parallel by default, so any concurrently running test that resolves config or tokens can observe these temporary values and fail nondeterministically.PR:
rasterstate/fj#239Head SHA:
31a8e4e8aa56Review job:
sha256:dbe7f50ba15cd4f3e60c80529b965af8cab3a34d0d04d233e6f8a948b5dbed02Provider pair:
openai:gpt-5.5+anthropic:claude-haiku-4-5-20251001Blocking findings:
0Inline findings:
1Model tokens:
121272 in / 15299 out(46642from cache) ≈$0.6100Token source:
GITHUB_TOKENRunner:
f941f7e38ad5Run: https://rasterhub.com/rasterstate/fj/actions/runs/429
31a8e4e8aa15ea3148b9Forseti review
No blocking findings from the lead reviewer.
Findings
P2
src/api/workflow_logs.rs:349—list_run_taskserrors are now collapsed to an empty task list. That lets the Forgejo job-log path proceed, but if the native log fetch later returnsUnavailable, the Loki fallback requires task metadata and reports onlyLoki fallback needs workflow task metadata for job index ...instead of the original task API/auth/parse failure. This regresses the existing fallback path by hiding the reason the metadata needed for Loki could not be obtained.PR:
rasterstate/fj#239Head SHA:
15ea3148b97cReview job:
sha256:e56a9a55c693e481188f46b82a7840d1d65237c37dc2298f16656a46cf15ec7dProvider pair:
openai:gpt-5.5+anthropic:claude-haiku-4-5-20251001Blocking findings:
0Inline findings:
1Model tokens:
122754 in / 11489 out(43826from cache) ≈$0.5117Token source:
GITHUB_TOKENRunner:
d5c99db5accdRun: https://rasterhub.com/rasterstate/fj/actions/runs/431
Forseti review
No blocking findings from the lead reviewer.
Findings
P2
src/api/workflow_logs.rs:349—list_run_taskserrors are now collapsed to an empty task list. That lets the Forgejo job-log path proceed, but if the native log fetch later returnsUnavailable, the Loki fallback requires task metadata and reports onlyLoki fallback needs workflow task metadata for job index ...instead of the original task API/auth/parse failure. This regresses the existing fallback path by hiding the reason the metadata needed for Loki could not be obtained.PR:
rasterstate/fj#239Head SHA:
15ea3148b97cReview job:
sha256:e56a9a55c693e481188f46b82a7840d1d65237c37dc2298f16656a46cf15ec7dProvider pair:
openai:gpt-5.5+anthropic:claude-haiku-4-5-20251001Blocking findings:
0Inline findings:
1Model tokens:
122754 in / 11489 out(43826from cache) ≈$0.5117Token source:
GITHUB_TOKENRunner:
d5c99db5accdRun: https://rasterhub.com/rasterstate/fj/actions/runs/431