Skip to content

feat(control-panel): add authenticated maintainer settings update - #426

Closed
enjoyandlove wants to merge 14 commits into
JSONbored:mainfrom
enjoyandlove:feat/130-maintainer-control-panel
Closed

feat(control-panel): add authenticated maintainer settings update#426
enjoyandlove wants to merge 14 commits into
JSONbored:mainfrom
enjoyandlove:feat/130-maintainer-control-panel

Conversation

@enjoyandlove

Copy link
Copy Markdown
Contributor

Summary

  • Add POST /v1/app/repos/:owner/:repo/settings — an authenticated maintainer-facing endpoint for updating repository automation settings (public surface mode, label name, check mode, linked issue policy, maintainer-author inclusion, etc.).
  • Enforce role-based authorization: requires maintainer, owner, or operator role; session users are additionally scoped to repos they have evidence for (requireSessionRepoAccess).
  • Record a settings.updated audit event on every successful change (actor, target repo, key fields changed).
  • Response is the plain RepositorySettings type — no private scoring context, wallet, hotkey, or compensation language.

Scope

  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Closes #130.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; global coverage stays at or above 97% for lines, statements, functions, and branches (aim for 98%+ branch coverage locally so CI variance does not fail near the threshold)
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • test:workers, build:mcp, test:mcp-pack, ui:lint, ui:typecheck, ui:build, npm audit — not run locally; no MCP, worker, or UI code was changed.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include screenshots or a short recording.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI and docs checkboxes are not applicable — this is a backend-only change.

Notes

  • The endpoint lives under /v1/app/ so browser sessions can reach it (the general auth middleware only allows sessions on /v1/app/* paths).
  • Static API token callers (operator) bypass the repo-scope check, matching the existing pattern for all other /v1/app/* operator routes.
  • 8 integration tests cover: operator success + audit trail, maintainer session (PR-association evidence), non-maintainer → insufficient_role, out-of-scope repo → forbidden_repo, unauthenticated → 401, invalid body → 400, private-language boundary, owner-installation session.

Signed-off-by: Chan <101856681+enjoyandlove@users.noreply.github.com>
@ghost

ghost commented Jun 5, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #426 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 5, 2026
enjoyandlove and others added 2 commits June 5, 2026 16:05
Signed-off-by: Chan <101856681+enjoyandlove@users.noreply.github.com>
enjoyandlove and others added 2 commits June 5, 2026 16:44
@github-actions github-actions Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jun 6, 2026
Signed-off-by: Chan <101856681+enjoyandlove@users.noreply.github.com>
@superagent-security superagent-security Bot added pr:flagged PR flagged for review by security analysis. and removed pr:flagged PR flagged for review by security analysis. labels Jun 6, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. CI is green, but the new settings update route only forwards part of the parsed settings schema, which would reset existing gate/policy settings to defaults. No merge action taken.

Comment thread src/api/routes.ts

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One additional line-level issue from the updated hardening pass. The existing requested-changes review still applies; no merge action taken.

Comment thread src/api/routes.ts Outdated

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enjoyandlove the main route behavior is improved now.

A few notes:

  • The settings update now forwards the parsed policy/gate fields and rejects malformed JSON instead of writing defaults.
  • The remaining blockers are branch hygiene and issue integrity.
  • apps/gittensory-ui/public/downloads/gittensory-extension.zip is unrelated to this backend API endpoint and should not be committed here.
  • #130 is the broader maintainer control-panel issue; this endpoint is one slice of it, not a full close.

Required changes:

  • Remove the committed extension zip from the branch.
  • Retitle the PR to feat(control-panel): add maintainer settings update endpoint.
  • Change the closing reference so this does not claim to fully close #130 unless the actual control-panel surface is complete.

Validation expected:

  • Rerun the maintainer settings integration tests, OpenAPI check, and the standard backend validation.

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enjoyandlove the authenticated settings endpoint is the right product direction, but this branch still mixes in unrelated artifacts.

A few notes:

  • The route/auth/audit/OpenAPI work is close to the issue surface.
  • The committed apps/gittensory-ui/public/downloads/gittensory-extension.zip does not belong in a maintainer settings endpoint PR.
  • The extension queue-level tests are also unrelated to the settings update endpoint and make the branch harder to review safely.

Required changes:

- Remove apps/gittensory-ui/public/downloads/gittensory-extension.zip from the PR.
- Remove unrelated extension queue-level test changes unless they are split into their own issue-specific PR.
- Keep this branch scoped to the settings update endpoint, auth/repo access, audit behavior, OpenAPI, and matching tests.
- Rebase after the current API/OpenAPI queue is settled and refresh generated artifacts.

Validation expected:

- focused maintainer settings route/integration tests
- ui:openapi:check
- full validate

@JSONbored JSONbored changed the title feat(control-panel): add authenticated maintainer settings update end… feat(control-panel): add authenticated maintainer settings update Jun 8, 2026
The mcp-release-watch workflow failed with 410 when trying to open a
tracking issue in a repo that has Issues turned off. Now the script
checks has_issues via the repo API before attempting to create or update
any issue, and emits a warning instead of exiting non-zero.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 2 security concern(s).

@superagent-security

Copy link
Copy Markdown
Contributor

P2: Unreviewable binary zip added to public downloads in a claimed backend-only PR

Binary zip added that reviewers cannot inspect in diffs.

Verify binary contents reproducibly or remove from backend-only PR.

AI prompt
Check if this security scanner issue is valid. If so, understand the root cause and fix it. If appropriate, update or add tests. Keep the change focused and preserve intended behavior.

<file name="apps/gittensory-ui/public/downloads/gittensory-extension.zip">
<violation number="1" location="apps/gittensory-ui/public/downloads/gittensory-extension.zip">
<priority>P2</priority>
<title>Unreviewable binary zip added to public downloads in a claimed backend-only PR</title>
<evidence>The PR description claims this is a backend-only change, yet adds a binary blob apps/gittensory-ui/public/downloads/gittensory-extension.zip that reviewers cannot inspect in GitHub diffs.</evidence>
<recommendation>Verify the binary contents before merge, ensure it is built reproducibly from known source, and document why it is included in this backend-focused PR. If unintended, remove it.</recommendation>
</violation>
</file>

@superagent-security superagent-security Bot added the pr:flagged PR flagged for review by security analysis. label Jun 9, 2026
JSONbored and others added 2 commits June 9, 2026 13:28
The recordAuditEvent call in the settings update route was silently
swallowed via .catch(() => undefined), allowing the mutation to succeed
with no audit trail if the DB write failed. Removed the suppression to
match every other audit call site. Added a test that confirms a failing
audit write surfaces as a 500 rather than a silent success.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JSONbored
JSONbored self-requested a review June 10, 2026 17:16
@JSONbored

Copy link
Copy Markdown
Owner

@enjoyandlove the authenticated settings endpoint is the right product direction, but this branch should be restarted from a clean endpoint-only branch.

A few notes:

  • The route/auth/audit/OpenAPI portion is close to a useful feat(control-panel): add maintainer control panel #130 slice.
  • apps/gittensory-ui/public/downloads/gittensory-extension.zip still does not belong in a maintainer settings endpoint PR, and Superagent is still action-required on that binary.
  • The MCP release script change and extension queue-level tests are also outside the settings update endpoint scope.
  • The PR still claims the broader feat(control-panel): add maintainer control panel #130 control-panel issue even though it only implements one backend slice.

A replacement PR should:

  • Include only the settings update endpoint, OpenAPI/generated artifact updates, and focused route/auth/audit tests.
  • Remove the extension zip and unrelated MCP/extension test changes.
  • Link or describe the specific feat(control-panel): add maintainer control panel #130 slice being completed instead of claiming the full parent issue.
  • Pass validate and Superagent without action-required findings.

@JSONbored JSONbored closed this Jun 10, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. pr:flagged PR flagged for review by security analysis.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

feat(control-panel): add maintainer control panel

2 participants