-
Notifications
You must be signed in to change notification settings - Fork 305
feat: add per-phase timing breakdown, deploy name sanitization, and lock order docs #8050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
030e3f7
fix(deploy): sanitize service names in deploy progress output
jongio a064b7c
docs(env): document lock acquisition order for saveMu and flock
jongio 74709d6
feat(up): add per-phase timing breakdown to azd up SUCCESS message
jongio 8e19923
Merge fix/7983-timing-breakdown: per-phase timing in SUCCESS message
jongio 7d22cb4
Merge fix/7972-sanitize-names: sanitize service names in deploy progress
jongio d1e2970
Merge fix/7969-lock-order-docs: document lock acquisition order
jongio be0a5cc
fix: resolve preflight lint and gofmt findings
jongio dd83b7e
Add per-phase duration telemetry to azd up
jongio bceff4f
Address Copilot review: clarify subprocess locking docs, broaden ANSI…
jongio 8af9e92
Add test cases for CSI tilde and OSC ST regex coverage
jongio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package cmd | ||
|
|
||
| import ( | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/azure/azure-dev/cli/azd/pkg/exegraph" | ||
| ) | ||
|
|
||
| func TestPhaseTimingBreakdown(t *testing.T) { | ||
| t.Parallel() | ||
| base := time.Now() | ||
|
|
||
| tests := []struct { | ||
| name string | ||
| steps []exegraph.StepTiming | ||
| want string | ||
| }{ | ||
| { | ||
| name: "empty steps", | ||
| steps: nil, | ||
| want: "", | ||
| }, | ||
| { | ||
| name: "provision only", | ||
| steps: []exegraph.StepTiming{ | ||
| {Name: "provision-infra", Status: exegraph.StepDone, Start: base, End: base.Add(5 * time.Minute)}, | ||
| }, | ||
| want: " Provisioning: 5 minutes", | ||
| }, | ||
| { | ||
| name: "deploy only", | ||
| steps: []exegraph.StepTiming{ | ||
| { | ||
| Name: "package-web", Status: exegraph.StepDone, | ||
| Start: base, End: base.Add(30 * time.Second), | ||
| }, | ||
| { | ||
| Name: "deploy-web", Status: exegraph.StepDone, | ||
| Start: base.Add(30 * time.Second), End: base.Add(90 * time.Second), | ||
| }, | ||
| }, | ||
| want: " Deploying: 1 minute", | ||
| }, | ||
| { | ||
| name: "both phases", | ||
| steps: []exegraph.StepTiming{ | ||
| { | ||
| Name: "provision-infra", Status: exegraph.StepDone, | ||
| Start: base, End: base.Add(9 * time.Minute), | ||
| }, | ||
| { | ||
| Name: "package-web", Status: exegraph.StepDone, | ||
| Start: base.Add(9 * time.Minute), End: base.Add(10 * time.Minute), | ||
| }, | ||
| { | ||
| Name: "deploy-web", Status: exegraph.StepDone, | ||
| Start: base.Add(10 * time.Minute), End: base.Add(11 * time.Minute), | ||
| }, | ||
| }, | ||
| want: " Provisioning: 9 minutes\n Deploying: 1 minute", | ||
| }, | ||
| { | ||
| name: "skipped steps excluded", | ||
| steps: []exegraph.StepTiming{ | ||
| {Name: "provision-infra", Status: exegraph.StepSkipped, Start: time.Time{}, End: time.Time{}}, | ||
| {Name: "deploy-web", Status: exegraph.StepDone, Start: base, End: base.Add(45 * time.Second)}, | ||
| }, | ||
| want: " Deploying: 45 seconds", | ||
| }, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| t.Parallel() | ||
| got := phaseTimingBreakdown(tt.steps) | ||
| if got != tt.want { | ||
| t.Errorf("phaseTimingBreakdown() =\n%q\nwant:\n%q", got, tt.want) | ||
| } | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.