Repository navigation
Conversation
fc48dc2 to
7464fc0
Compare
squashd
left a comment
There was a problem hiding this comment.
this looks awesome — tokyo night for the people!
mostly nits/suggestions, and one smol regression. i'm assuming the images will get removed 🙏
| fmt.Fprintln(&str, lipgloss.NewStyle().Bold(true).Render(context.LessonTitle)) | ||
| if context.BaseURL != "" { | ||
| fmt.Fprintf(&str, "%s %s\n", secondaryStyle.Render("Target:"), context.BaseURL) | ||
| } |
There was a problem hiding this comment.
Do you think we could add part of the override warning here? I like the simplification, just worried we'll have students who forgot they'd added an override
fmt.Printf("Using overridden base_url: %v\n", overrideBaseURL)
fmt.Printf("You can reset to the default with `bootdev config base_url --reset`\n\n")There was a problem hiding this comment.
Good call. Keeping it the same as before
| heading := "Checks" | ||
| if isSubmit { | ||
| heading = "Checks not evaluated" | ||
| } |
There was a problem hiding this comment.
yes omit actual if no actual exists
| func printHTTPRequestResult(result api.HTTPRequestResult) string { | ||
| if result.Err != "" { | ||
| return fmt.Sprintf(" Err: %v\n\n", result.Err) | ||
| return fmt.Sprintf("%s\n%s\n", warningStyle.Render("Request error"), indentOutput(result.Err, 2)) |
There was a problem hiding this comment.
Is "Request" meant as the name of the step type? I wonder if this could make someone think they didn't get the request (but it waws their response that was malformed)
There was a problem hiding this comment.
Good call, request makes no sense. Now the errors say where the error occured: request, http connection, or response
| if showAllDetails || (failed && m.finalized) { | ||
| dividerWidth := m.terminalWidth | ||
| if dividerWidth <= 0 { | ||
| dividerWidth = 80 | ||
| } |
There was a problem hiding this comment.
keeping the failed step expanded but no second summary
| default: | ||
| return "" | ||
| } | ||
| expectedJSON, err := json.Marshal(expected) |
There was a problem hiding this comment.
clanker pointed out this would now be html-escaped
There was a problem hiding this comment.
Fixed with SetEscapeHTML(false) when formatting the selected JSON expected/actual values, so HTML characters remain readable.
| if title == "Variables Missing" { | ||
| headingText = warningStyle.Render(title + ":") | ||
| } |
There was a problem hiding this comment.
nit: matching on the string feels iffy
| check := renderCheck(step, index, status) | ||
| check = renderStatus(status) + strings.TrimPrefix(check, status) | ||
| check = strings.ReplaceAll(check, "\n Expected:", "\n "+secondaryStyle.Render("Expected:")) | ||
| check = strings.ReplaceAll(check, "\n Actual:", "\n "+secondaryStyle.Render("Actual:")) | ||
| fmt.Fprintf(&str, "\n%s\n", indentOutput(check, 2)) |
There was a problem hiding this comment.
splitting on a string and reconstructing it for rendering feels a bit brittle. could it be set where it's built?
9d7ed5c to
d5dac21
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Relative lesson paths lose chapter/lesson numbers and can produce a dot as the title when no README heading exists, making headers depend on how the path is supplied.
1 open issue
What changed in this PR
This PR improves lesson execution reports in the CLI, making runs easier to inspect and submissions easier to scan.
Changes:
- Adds persistent lesson headers, numbered steps, grouped diagnostics, and expected/actual values for supported checks.
- Introduces semantic color settings with coordinated defaults and updated configuration documentation.
- Adds
local-test --runfor ungraded previews and expands output regression coverage.
| File | Description |
|---|---|
version.txt |
Bumps the version to v1.33.0. |
render/view.go |
Integrates numbered steps, detailed output, and failure summaries. |
render/view_test.go |
Covers numbering, failure summaries, and ungraded output. |
render/variables.go |
Adds styled headings to variable sections. |
render/variables_test.go |
Updates tests for styled variable sections. |
render/step.go |
Adds grouped step details and check-value rendering. |
render/step_test.go |
Tests diagnostic grouping and run/submit differences. |
render/render.go |
Initializes semantic styles and accepts lesson context. |
render/palette.go |
Defines coordinated default colors. |
render/models.go |
Stores detail labels, lesson context, and terminal width. |
render/json.go |
Formats expected and actual JSON check values. |
render/json_test.go |
Covers JSON diagnostics, fallbacks, and truncation. |
render/http.go |
Groups HTTP diagnostics and preserves JSON formatting. |
render/header.go |
Renders persistent lesson and base-URL headers. |
render/header_test.go |
Tests header persistence and optional context. |
README.md |
Documents semantic color configuration. |
main_test.go |
Extends redirected-output tests to ungraded previews. |
cmd/submit.go |
Passes lesson context to the renderer. |
cmd/localtest.go |
Adds preview mode, local headers, and duplicate-error suppression. |
cmd/localtest_test.go |
Tests local lesson title and numbering discovery. |
cmd/configure.go |
Registers semantic color defaults. |
client/lessons.go |
Adds non-serialized HTTP error categories. |
checks/local.go |
Uses the exported JSON-path lookup helper. |
checks/jq.go |
Exports JSON-path lookup for rendering diagnostics. |
checks/jq_test.go |
Updates coverage for the exported helper. |
checks/http.go |
Categorizes request, exchange, and response errors. |
checks/http_test.go |
Tests HTTP error categorization. |
Review effort: Balanced
| } | ||
|
|
||
| func localRunContext(path string) render.RunContext { | ||
| manifestPath := filepath.Clean(path) |
c96861e to
a51fcf7
Compare
Clarify numbered checks and simplify failure output Preserve skipped step details and show submission errors Preserve grading diagnostics beneath failed checks Preserve unmatched grading errors and bound diagnostics changes test changes
a51fcf7 to
eda2349
Compare



resolves bootdotdev/go-api-gate#8533.
Improve CLI output readability with numbered step headings, clearer grouping, and configurable colors.
--verbose.local-test --runfor previewing execution without grading.Color configuration
Colors can be configured through
bootdev config colorsor the config file.gray,red,green,magenta, andyellowtosecondary,fail,pass,accent, andwarning.header,subheader, andinformation.Existing color-name settings must be renamed to preserve custom colors.
Local CLI screenshots
These examples use local command fixtures. Runs show what happened; submissions also show how the checks were graded.
Run — zero exit code
The command completes successfully and its output is shown.
Run — nonzero exit code
The exit code is visible without a grading label.
Passing submission — default
Successful steps are summarized.
Passing submission — expanded steps
With
--verbose, numbered checks appear before each step’s output.Show expanded steps
Failing submission — default
The failed step shows the expected and actual exit codes. Later steps are hidden.
Failing submission — expanded steps
With
--verbose, later steps show their output, and unevaluated checks have no grading label.Show expanded steps