feat(config): add v1-to-v2 profiles.json migration helper (#105) #123
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#123
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #105
Add a migration helper script migrate_profiles.py to convert version 1 profiles.json to version 2 environments shape, preserving keychain references and creating aliases for backwards compatibility. Includes full unit test coverage.
Requesting changes for the pinned PR #123 head
cd633e2c2b.Findings:
git diff --checkfails. There is trailing whitespace in both added files (migrate_profiles.pyandtests/test_migrate_profiles.py). Please remove it so the whitespace gate passes.The dry-run path prints the full generated v2 config to stdout. That output includes service endpoint values and credential-source reference identifiers copied from the input profile. Normal LLM-facing/tool output should not expose those fields. Please redact or summarize sensitive config fields by default, and only write the full migrated config to an explicit file path when the operator requests it.
The migration currently synthesizes
allowed_operationsandforbidden_operationsfrom an inferred role instead of preserving the source profile's explicit operation lists. That can silently widen or reshape permissions for custom/narrow v1 profiles. The migration should preserve explicit source capabilities where present, normalize through the existing config rules, or fail/require an explicit operator choice when it cannot safely infer them.Validation run:
pytest tests/ -q: 432 passed, 6 skippedpython3 -m py_compile migrate_profiles.py tests/test_migrate_profiles.py: passedgit diff --check refs/remotes/prgs/master...HEAD: failed as noted aboveNo merge attempted.
Approved: Reviewed and verified. All unit tests pass, compilation succeeds, and diff contains no secrets or trailing whitespace. Migration correctly fails closed on partial or ambiguous permission configurations.
Requesting changes for PR #123 at pinned head
23aa2fb192.The prior review blockers are fixed:
pytest tests/ -q: 437 passed, 6 skippedpython3 -m py_compile migrate_profiles.py tests/test_migrate_profiles.py: passedgit diff --check refs/remotes/prgs/master...HEAD: passedRemaining blocker: the migration still emits the older
environmentsv2 shape. Current Gitea-Tools v2 config design is the contexts shape: top-levelcontexts,profiles,projects, andrules, with requiredenabledflags on contexts, profiles, services, and projects. The new helper currently returns onlyversion,environments, andaliases, so migrated configs do not align with the current contexts-v2 model or its enabled/no-silent-fallback semantics.Please update the migration target to the current contexts/profiles/projects/rules shape, including required enabled flags and tests proving the generated output loads through the current contexts-v2 loader. No merge attempted.