Skip to content

Hosted demo: show every option, unlock read-only review with the visitor's GitHub token - #3

Merged
mimo1999 merged 2 commits into
mainfrom
hosted-pr-review
Dec 1, 2026
Merged

mimo1999 merged 2 commits into
mainfrom
hosted-pr-review

Conversation

@mimo1999

@mimo1999 mimo1999 commented Dec 1, 2026

Copy link
Copy Markdown
Owner

The hosted demo used to show only Read the codebase. Now it shows every option and explains what each needs. A visitor who adds their own GitHub token can switch branches, review pull requests and compare commits, read-only.

What a visitor sees

  • No token:
    • Read the codebase works as before.
    • Pull requests, Compare commits and the branch dropdown are greyed out with the reason.
    • Local changes points to the one-command local setup.
    • A GitHub token field in the repository card links to GitHub's page for creating a read-only token.
  • With a token:
    • The branch dropdown lists every branch.
    • Pull requests lists open PRs; Review opens the full analysis read-only.
    • Compare commits reviews any two commits.
    • A refused token is reported in the card, with Remove.
  • Still local-only, with the reason shown: test runs (they execute the repository's code), Claude notes, author notes and Local changes.

How the token is handled (backend/app/hosted.py)

  • The UI keeps it in the tab's sessionStorage and sends it as X-Flowify-GitHub-Token. The server holds it in a ContextVar for that one request.
  • Git receives it only as an HTTP header set through GIT_CONFIG_* environment variables, never in a URL, a command line or .git/config. A test checks .git/config.
  • Each clone belongs to one session and one repository, so a private repository fetched with one visitor's token is never served to another.
  • Clones are shallow (200 commits, deepened once by 800 when a branch point is further back). A review's checkout is removed as soon as the review is done. The graph stays, because the review screen reads function source from it, and the janitor removes clones together with expired graphs.
  • /review/hosted and /branch/open share the per-IP ingest rate limit.
  • Adding a git link clones anonymously first and retries with the token only for a private repository, so a stale token never blocks a public one.

Also in this PR

  • index.html is served with Cache-Control: no-cache and the hashed bundles with a one-year cache, so a deploy is visible on the next load. Before, a deploy stayed hidden behind the browser's cache.
  • The welcome dialog describes the four options and shows once more for returning visitors.
  • Commit 143473a also contains the main.py half of the hosted change, so it doesn't build without ced3306. Review the two together.

Testing

  • pytest tests/ --ignore=tests/test_integration.py: 248 passed. The frontend build passes.
  • End-to-end test: a local bare repository stands in for GitHub behind a real github.com URL (insteadOf). It runs the actual clone, fetch, PR review, commit compare, branch switch, the no-token 401, the token-not-in-config check and the cleanup.
  • Hosted mode in a browser (FLOWIFY_MODE=server, UI served by the backend): the no-token sidebar, and a fake token that GitHub really rejected.
  • Not checked: the success path against real GitHub with a real token. After deploying, add a read-only token on the live site and open a PR.

Deploying

  • No config change. Clones go under $FLOWIFY_WORKDIR/flowify-hosted/, which is ephemeral on Render.
  • Render does not auto-deploy this service, so after merging, start a Manual Deploy.

🤖 Generated with Claude Code

mimo1999 and others added 2 commits December 1, 2026 21:50
…t visit

index.html is served with Cache-Control: no-cache and the hashed bundles as
immutable, so a deploy is visible on the next load. The welcome dialog lists
the four options and re-appears once for returning visitors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…token

Every option is shown on a hosted instance. With X-Flowify-GitHub-Token the
branch dropdown, pull requests and commit compare work read-only from a
per-session shallow clone; the token reaches git only as an env-configured
HTTP header and is never logged or stored. Test runs, Claude notes, author
notes and local changes stay local-only. A git link is cloned anonymously
first, so a stale token never blocks a public repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Flowify impact

46 changes ranked by risk · reaches 18 API endpoints · touches 4 other services

# Risk Change Reaches Test in chain
1 62 Critical _run (backend/app/hosted.py:56) 18 dependents · 4 endpoints · 1 other service no
2 62 Critical env (backend/app/hosted.py:47) 22 dependents · 6 endpoints · 1 other service no
3 62 Critical run (frontend/src/components/Sidebar.jsx:381) 117 dependents · 18 endpoints · 3 other services yes
4 56 High _hosted_errors (backend/app/main.py:1106) 5 dependents · 5 endpoints no
5 56 High _is_hosted_link (backend/app/main.py:1088) 6 dependents · 5 endpoints no
6 56 High fetch (backend/app/hosted.py:101) 14 dependents · 3 endpoints · 1 other service no
7 53 High _do_ingest.ingest_with (backend/app/main.py:359) 3 dependents · 2 endpoints no
8 52 High _hosted_repo (backend/app/main.py:1095) 4 dependents · 4 endpoints no
9 51 High _rmtree (backend/app/hosted.py:30) 6 dependents · 3 endpoints no
10 50 High clone (backend/app/hosted.py:82) 3 dependents · 3 endpoints no
11 50 High root (backend/app/hosted.py:69) 6 dependents · 3 endpoints no
12 49 High _github (backend/app/review_queue.py:123) 7 dependents · 3 endpoints yes
13 46 High _do_ingest (backend/app/main.py:326) 2 dependents · 2 endpoints no
14 44 High _hosted_ingest (backend/app/main.py:1120) 2 dependents · 2 endpoints no
15 43 High repo_details (backend/app/main.py:1067) no dependents no

…and 31 more.

Why these scores
  1. _run: reach +17 (18 functions depend on it), exposure +20 (reached from 4 API endpoints), coverage +15 (no test in its caller chain), kind +3 (new code, nothing depended on it before), size +2 (11 lines changed), centrality +3 (in the top 11% most central in the repo), crossings +2 (used from 1 other service)
  2. env: reach +18 (22 functions depend on it), exposure +20 (reached from 6 API endpoints), coverage +15 (no test in its caller chain), kind +3 (new code, nothing depended on it before), size +1 (7 lines changed), centrality +3 (in the top 18% most central in the repo), crossings +2 (used from 1 other service)
  3. run: reach +27 (117 functions depend on it), exposure +20 (reached from 18 API endpoints), kind +3 (new code, nothing depended on it before), centrality +6 (in the top 0% most central in the repo), crossings +6 (used from 3 other services) — 1 unconfirmed caller
  4. _hosted_errors: reach +10 (5 functions depend on it), exposure +20 (reached from 5 API endpoints), coverage +15 (no test in its caller chain), kind +3 (new code, nothing depended on it before), size +2 (11 lines changed), centrality +6 (in the top 4% most central in the repo)
  5. _is_hosted_link: reach +11 (6 functions depend on it), exposure +20 (reached from 5 API endpoints), coverage +15 (no test in its caller chain), kind +3 (new code, nothing depended on it before), size +1 (5 lines changed), centrality +6 (in the top 4% most central in the repo)

Coverage: 46 scanned · 0 flagged by a static check · 3 need a human · 5 skipped

Needs a human: Flowify could not tell

  • frontend/src/components/Sidebar.jsx:371: lines 371-373, 428-431, 434, 436: changed outside any function or named value the parser recognised (a decorator, an import, a module-level call or, outside Python, code in an unrecognised construct): not scored
  • frontend/src/components/WelcomeModal.jsx:1: lines 1-2, 7: changed outside any function or named value the parser recognised (a decorator, an import, a module-level call or, outside Python, code in an unrecognised construct): not scored
  • frontend/src/store.js:34: lines 34-36, 297-317, 320, 342, 936, 966: changed outside any function or named value the parser recognised (a decorator, an import, a module-level call or, outside Python, code in an unrecognised construct): not scored
Skipped (5)
  • README.md: documentation
  • backend/app/storage.py:666: lines 666-667: comments, blank lines or docstrings only
  • frontend/src/components/Sidebar.jsx:410: lines 410: comments, blank lines or docstrings only
  • frontend/src/store.js:43: lines 43: comments, blank lines or docstrings only
  • tests/test_queue.py:186: lines 186-187: comments, blank lines or docstrings only

Risk is a 0-100 triage score; every point is a named factor. ⚠ = low confidence: the static call graph resolves roughly half of real calls (see docs/accuracy.md), so incomplete evidence raises a floor and a short list is a place to start, never proof of safety.

@mimo1999
mimo1999 merged commit 767ee7a into main Dec 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant