Skip to content
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6abc7cc
Initial plan
Copilot Apr 28, 2026
858f8b8
rad init: always create bicepconfig.json, remove app prompt and app.b…
Copilot Apr 28, 2026
4ce898d
Improve warning message to mention required Radius Bicep extensions
Copilot Apr 28, 2026
c3cabd5
Silence helm install logs during rad init bubbletea UI
Copilot Apr 28, 2026
4b9edf2
Add tests for codecov gaps in PR #11772
Copilot Apr 28, 2026
ae10e6e
Assert wrapped cause in InstallRadius error test
Copilot Apr 28, 2026
971a7d0
Apply suggestions from code review
zachcasper Apr 28, 2026
4e226d4
Rename Application{Complete,HeadingIcon} to BicepConfig in radinit di…
Copilot Apr 28, 2026
ab6aee9
Merge origin/main into copilot/fix-rad-init-bicepconfig
zachcasper May 7, 2026
ea948b5
rad init --preview: always create bicepconfig.json, remove app prompt
zachcasper May 7, 2026
532ad67
Remove dead application-scaffolding code from radinit/common
zachcasper May 7, 2026
b77d320
Merge branch 'main' into copilot/fix-rad-init-bicepconfig
zachcasper May 7, 2026
a9b4c80
Merge branch 'main' into copilot/fix-rad-init-bicepconfig
zachcasper May 7, 2026
57bb4ac
Merge branch 'main' into copilot/fix-rad-init-bicepconfig
zachcasper May 7, 2026
4264349
Merge branch 'main' into copilot/fix-rad-init-bicepconfig
zachcasper May 7, 2026
f187de0
Merge branch 'main' into copilot/fix-rad-init-bicepconfig
zachcasper May 8, 2026
10f8e1d
Merge branch 'main' into copilot/fix-rad-init-bicepconfig
zachcasper May 8, 2026
04df42f
Merge branch 'main' into copilot/fix-rad-init-bicepconfig
zachcasper May 11, 2026
ca279b7
Merge branch 'main' into copilot/fix-rad-init-bicepconfig
nicolejms May 18, 2026
783e3a1
test: make reconciler manager startup/shutdown deterministic
Copilot May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 0 additions & 86 deletions pkg/cli/cmd/radinit/application.go

This file was deleted.

115 changes: 0 additions & 115 deletions pkg/cli/cmd/radinit/application_test.go

This file was deleted.

23 changes: 8 additions & 15 deletions pkg/cli/cmd/radinit/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ const (
summaryEnvironmentCreateAzureCloudProviderFmt = summaryIndent + "Azure: subscription %s and resource group %s\n"
summaryEnvironmentCreateRecipePackyFmt = summaryIndent + "Recipe pack: %s\n"
summaryEnvironmentExistingHeadingFmt = "Use existing environment %s\n"
summaryApplicationHeadingIcon = "🚧 "
summaryApplicationScaffoldHeadingFmt = "Scaffold application %s\n"
summaryApplicationScaffoldFile = summaryIndent + "Create %s\n"
summaryBicepConfigHeadingIcon = "🚧 "
summaryBicepConfigHeadingFmt = "Create %s\n"
summaryConfigurationHeadingIcon = "📋 "
summaryConfigurationUpdateHeading = "Update local configuration\n"
progressHeading = "Initializing Radius. This may take a minute or two...\n\n"
Expand Down Expand Up @@ -116,7 +115,7 @@ func (r *Runner) showProgress(ctx context.Context, options *initOptions, progres
type progressMsg struct {
InstallComplete bool
EnvironmentComplete bool
ApplicationComplete bool
BicepConfigComplete bool
ConfigComplete bool
}

Expand Down Expand Up @@ -250,12 +249,8 @@ func (m *summaryModel) View() string {
message.WriteString(fmt.Sprintf(summaryEnvironmentExistingHeadingFmt, highlight(options.Environment.Name)))
}

if options.Application.Scaffold {
message.WriteString(summaryApplicationHeadingIcon)
message.WriteString(fmt.Sprintf(summaryApplicationScaffoldHeadingFmt, highlight(options.Application.Name)))
message.WriteString(fmt.Sprintf(summaryApplicationScaffoldFile, highlight("app.bicep")))
message.WriteString(fmt.Sprintf(summaryApplicationScaffoldFile, highlight("bicepconfig.json")))
}
message.WriteString(summaryBicepConfigHeadingIcon)
message.WriteString(fmt.Sprintf(summaryBicepConfigHeadingFmt, highlight("bicepconfig.json")))

message.WriteString(summaryConfigurationHeadingIcon)
message.WriteString(summaryConfigurationUpdateHeading)
Expand Down Expand Up @@ -392,10 +387,8 @@ func (m *progressModel) View() string {
message.WriteString(fmt.Sprintf(summaryEnvironmentExistingHeadingFmt, highlight(options.Environment.Name)))
}

if options.Application.Scaffold {
m.writeProgressIcon(message, m.progress.ApplicationComplete, &waiting)
message.WriteString(fmt.Sprintf(summaryApplicationScaffoldHeadingFmt, highlight(options.Application.Name)))
}
m.writeProgressIcon(message, m.progress.BicepConfigComplete, &waiting)
message.WriteString(fmt.Sprintf(summaryBicepConfigHeadingFmt, highlight("bicepconfig.json")))

m.writeProgressIcon(message, m.progress.ConfigComplete, &waiting)
message.WriteString(summaryConfigurationUpdateHeading)
Expand All @@ -409,7 +402,7 @@ func (m *progressModel) View() string {
}

func (m *progressModel) isComplete() bool {
return m.progress.InstallComplete && m.progress.EnvironmentComplete && m.progress.ApplicationComplete && m.progress.ConfigComplete
return m.progress.InstallComplete && m.progress.EnvironmentComplete && m.progress.BicepConfigComplete && m.progress.ConfigComplete
}

// writeProgressIcon writes the correct icon for the progress step depending on the current step.
Expand Down
3 changes: 2 additions & 1 deletion pkg/cli/cmd/radinit/display_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func Test_summaryModel(t *testing.T) {
"\n" +
"🔧 Use existing Radius test-version install on test-context\n" +
"🌏 Use existing environment test-environment\n" +
"🚧 Create bicepconfig.json\n" +
"📋 Update local configuration\n" +
"\n" +
"(press enter to confirm or esc to restart)\n\r"
Expand All @@ -144,7 +145,6 @@ func Test_summaryModel(t *testing.T) {
},
CloudProviders: cloudProviderOptions{},
Recipes: recipePackOptions{},
Application: applicationOptions{},
}

expected := "\rYou've selected the following:\n" +
Expand All @@ -153,6 +153,7 @@ func Test_summaryModel(t *testing.T) {
" - Kubernetes cluster: test-context\n" +
" - Kubernetes namespace: \n" +
"🌏 Use existing environment test-environment\n" +
"🚧 Create bicepconfig.json\n" +
"📋 Update local configuration\n" +
"\n" +
"(press enter to confirm or esc to restart)\n\r"
Expand Down
54 changes: 24 additions & 30 deletions pkg/cli/cmd/radinit/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"os"
"path/filepath"

v1 "github.com/radius-project/radius/pkg/armrpc/api/v1"
"github.com/radius-project/radius/pkg/cli"
Expand All @@ -37,7 +38,6 @@ import (
"github.com/radius-project/radius/pkg/cli/prompt"
"github.com/radius-project/radius/pkg/cli/setup"
"github.com/radius-project/radius/pkg/cli/workspaces"
corerp "github.com/radius-project/radius/pkg/corerp/api/v20231001preview"
"github.com/radius-project/radius/pkg/to"
ucp "github.com/radius-project/radius/pkg/ucp/api/v20231001preview"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -252,6 +252,11 @@ func (r *Runner) Run(ctx context.Context) error {

clusterOptions := helm.PopulateDefaultClusterOptions(cliOptions)

// Silence helm install log messages while the bubbletea progress UI
// owns stdout. Concurrent writes from output.LogInfo would corrupt
// the in-place rendering of the progress display.
clusterOptions.Logger = func(format string, v ...any) {}

err := r.HelmInterface.InstallRadius(ctx, clusterOptions, r.Options.Cluster.Context)
if err != nil {
return clierrors.MessageWithCause(err, "Failed to install Radius.")
Expand All @@ -269,39 +274,21 @@ func (r *Runner) Run(ctx context.Context) error {
progress.EnvironmentComplete = true
progressChan <- progress

if r.Options.Application.Scaffold {
client, err := r.ConnectionFactory.CreateApplicationsManagementClient(ctx, *r.Workspace)
if err != nil {
return err
}

// Initialize the application resource if it's not found. This supports the scenario where the application
// resource is not defined in bicep.
err = client.CreateApplicationIfNotFound(ctx, r.Options.Application.Name, &corerp.ApplicationResource{
Location: to.Ptr(v1.LocationGlobal),
Properties: &corerp.ApplicationProperties{
Environment: &r.Workspace.Environment,
},
})
if err != nil {
return err
}

// Scaffold application files in the current directory
wd, err := os.Getwd()
if err != nil {
return err
}
// Always scaffold a bicepconfig.json in the current directory so that users have the
// required Bicep configuration to author Radius applications.
wd, err := os.Getwd()
if err != nil {
return err
}

err = setup.ScaffoldApplication(wd)
if err != nil {
return err
}
bicepConfigExisted, err := setup.ScaffoldBicepConfig(wd)
if err != nil {
return err
}
progress.ApplicationComplete = true
progress.BicepConfigComplete = true
progressChan <- progress

err := r.ConfigFileInterface.EditWorkspaces(ctx, config, r.Workspace)
err = r.ConfigFileInterface.EditWorkspaces(ctx, config, r.Workspace)
if err != nil {
return err
}
Expand All @@ -314,6 +301,13 @@ func (r *Runner) Run(ctx context.Context) error {
return err
}

// Warn the user (after the progress UI has finished) if a bicepconfig.json was already
// present so that they know it was preserved and not overwritten.
if bicepConfigExisted {
bicepConfigPath := filepath.Join(wd, "bicepconfig.json")
r.Output.LogInfo("Warning: An existing bicepconfig.json was found at %s. It was preserved and not modified. Ensure it contains the Radius Bicep extensions (radius, radiusCompute, radiusData, radiusSecurity, aws); otherwise Bicep authoring may fail.", bicepConfigPath)
}

return nil
}

Expand Down
Loading
Loading