Skip to content

Commit 9a40e9a

Browse files
Copilotpelikhan
andauthored
Share model refresh default
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 41da7b3 commit 9a40e9a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

pkg/cli/compile_model_validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func PrepareCompileModelValidation(ctx context.Context, config *CompileConfig) {
127127
report := buildModelsReport(ctx, modelsReportOptions{
128128
logsDir: defaultLogsOutputDir,
129129
refreshObserved: true,
130-
refreshCount: 20,
130+
refreshCount: defaultModelsRefreshCount,
131131
})
132132
config.activeModels = buildActiveModelInventory(report)
133133
}

pkg/cli/models_command.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
"github.com/spf13/cobra"
2020
)
2121

22+
const defaultModelsRefreshCount = 20
23+
2224
// NewModelsCommand creates the models command.
2325
func NewModelsCommand() *cobra.Command {
2426
cmd := &cobra.Command{
@@ -46,7 +48,7 @@ so recent awf-reflect data can be discovered before reporting.`,
4648
addJSONFlag(cmd)
4749
cmd.Flags().String("logs-dir", defaultLogsOutputDir, "Directory containing downloaded logs/artifacts")
4850
cmd.Flags().Bool("refresh-observed", true, "Attempt to refresh local observed-model artifacts before reporting")
49-
cmd.Flags().Int("refresh-count", 20, "Maximum number of recent runs to inspect when refreshing observed models")
51+
cmd.Flags().Int("refresh-count", defaultModelsRefreshCount, "Maximum number of recent runs to inspect when refreshing observed models")
5052
addRepoFlag(cmd)
5153
return cmd
5254
}
@@ -155,7 +157,7 @@ func buildModelsReport(ctx context.Context, opts modelsReportOptions) modelsRepo
155157

156158
func refreshObservedArtifacts(ctx context.Context, logsDir string, refreshCount int, repoOverride string) error {
157159
if refreshCount <= 0 {
158-
refreshCount = 20
160+
refreshCount = defaultModelsRefreshCount
159161
}
160162
return DownloadWorkflowLogs(ctx, LogsDownloadOptions{
161163
Count: refreshCount,

0 commit comments

Comments
 (0)