Skip to content

fix: resolve Mega service startup error in qlean#2031

Merged
benjamin-747 merged 1 commit intoweb3infra-foundation:mainfrom
miliu2cc:main
Mar 20, 2026
Merged

fix: resolve Mega service startup error in qlean#2031
benjamin-747 merged 1 commit intoweb3infra-foundation:mainfrom
miliu2cc:main

Conversation

@miliu2cc
Copy link
Copy Markdown
Contributor

#1987

  • Fixed the error that occurred when qlean attempted to start the Mega service
  • Optimized the overall startup flow for better reliability
  • Added support for admin_user configuration

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +217 to +230
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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines 615 to 617
// Initialize repository to show in UI
tracing::info!("Initializing monorepo for UI display...");
init_monorepo(vm).await?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@benjamin-747 benjamin-747 added this pull request to the merge queue Mar 20, 2026
Merged via the queue into web3infra-foundation:main with commit faf14ab Mar 20, 2026
8 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.

2 participants