Skip to content

Simplify cmd/bundle/{summary,validate}.go - #3182

Merged
denik merged 1 commit into
mainfrom
denik/simplify-summary-validate
Jul 4, 2025
Merged

Simplify cmd/bundle/{summary,validate}.go#3182
denik merged 1 commit into
mainfrom
denik/simplify-summary-validate

Conversation

@denik

@denikdenik commented Jul 4, 2025

Copy link
Copy Markdown
Contributor

Why

The common function added in #3123 make it harder to understand what's going on and I removed it in #3175

Sending this as separate PR to make #3175 easier to review.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 4, 2025

Copy link
Copy Markdown
Collaborator

Run: 16074177916

Env✅‌pass❌‌FAIL🔄‌flaky🙈‌skip
❌‌aws linux29626374
❌‌aws windows29411373
✅‌aws-ucws linux412274
✅‌aws-ucws windows413273
✅‌azure linux306373
✅‌azure windows307372
✅‌azure-ucws linux414271
✅‌azure-ucws windows415270
✅‌gcp linux305375
✅‌gcp windows306374
12 failing tests:
Test Nameaws linuxaws windows
TestFetchRepositoryInfoAPI_FromRepo❌‌FAIL❌‌FAIL
TestLock✅‌pass❌‌FAIL
TestReposCreateWithProvider✅‌pass❌‌FAIL
TestReposCreateWithoutProvider🔄‌flaky❌‌FAIL
TestReposDeleteByID🔄‌flaky❌‌FAIL
TestReposDeleteByPath❌‌FAIL✅‌pass
TestReposGet✅‌pass❌‌FAIL
TestReposUpdate🔄‌flaky❌‌FAIL
TestSyncEnsureRemotePathIsUsableIfRepoExists🔄‌flaky❌‌FAIL
TestSyncIncrementalFileOverwritesFolder🔄‌flaky❌‌FAIL
TestSyncNestedFolderSync✅‌pass❌‌FAIL
TestSyncNestedSpacePlusAndHashAreEscapedSync🔄‌flaky❌‌FAIL


return nil
default:
return fmt.Errorf("unknown output type %s", root.OutputType(cmd))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we want to keep this default error?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

output type is validated to be text or json, so that line should never be reachable.

Comment threadcmd/bundle/summary.go
if root.OutputType(cmd) == flags.OutputText {
err = render.RenderDiagnostics(cmd.OutOrStdout(), b, diags, render.RenderOptions{RenderSummaryTable: false})
} else {
err = render.RenderDiagnostics(cmd.OutOrStderr(), b, diags, render.RenderOptions{RenderSummaryTable: false})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The call in if and else conditions are the same, should there be RenderSummaryTable: true somewhere?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

It's not the same: stderr for json, stdout for test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh right, it was difficult to spot

@denik
denik requested a review from andrewnesterJuly 4, 2025 13:38
@denik
denik merged commit fd9c3c7 into mainJul 4, 2025
@denik
denik deleted the denik/simplify-summary-validate branch July 4, 2025 13:42
denik added a commit that referenced this pull request May 20, 2026
## Why
The common function added in #3123
make it harder to understand what's going on and I removed it in
#3175
Sending this as separate PR to make
#3175 easier to review.
Sign up for freeto 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.

3 participants

@denik@eng-dev-ecosystem-bot@andrewnester