fix: resolve Mega service startup error in qlean#2031
fix: resolve Mega service startup error in qlean#2031benjamin-747 merged 1 commit intoweb3infra-foundation:mainfrom
Conversation
Signed-off-by: miliu2cc <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ea9465427
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if let Ok(admin_user) = std::env::var("ADMIN_USER") { | ||
| if admin_user.trim().is_empty() { | ||
| tracing::info!("ADMIN_USER is empty, MEGA_MONOREPO__ADMIN will remain empty"); | ||
| } else { | ||
| tracing::info!( | ||
| "Setting MEGA_MONOREPO__ADMIN from ADMIN_USER: {}", | ||
| admin_user | ||
| ); | ||
| // Use sed to replace the MEGA_MONOREPO__ADMIN line in .env | ||
| // Using | as delimiter to avoid conflicts with / in values | ||
| exec_check( | ||
| vm, | ||
| &format!( | ||
| "sed -i 's|^MEGA_MONOREPO__ADMIN=.*|MEGA_MONOREPO__ADMIN={}|' /tmp/.env", |
There was a problem hiding this comment.
Seed
.mega_cedar.json when wiring ADMIN_USER
This override only rewrites MEGA_MONOREPO__ADMIN in /tmp/.env, but admin checks do not read that config anymore: MonoApiService::check_is_admin() resolves admins exclusively from /.mega_cedar.json (ceres/src/api_service/admin_ops.rs:29-57), and init_monorepo() never commits that file (mono/tests/qlean_integration.rs:527-555). In a keep-alive run, setting ADMIN_USER will therefore print a configured admin in the banner without actually granting any admin privileges.
Useful? React with 👍 / 👎.
| // Initialize repository to show in UI | ||
| tracing::info!("Initializing monorepo for UI display..."); | ||
| init_monorepo(vm).await?; |
There was a problem hiding this comment.
Restore a Buck2 seed repo for the interactive qlean demo
After this change the keep-alive path only runs init_monorepo(), which creates a repo containing just root.txt (mono/tests/qlean_integration.rs:542-555). The removed create_buck2_project() call was the only step that added .buckconfig, BUCK, and hello/main.rs, so the Mega+Orion environment now comes up without any buildable Buck2 target. Users can browse the UI, but the Orion build flow has nothing valid to build.
Useful? React with 👍 / 👎.
faf14ab
#1987