-
Notifications
You must be signed in to change notification settings - Fork 20
add last 30 terminal outputs for tracking for errors on command #1529
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
Draft
nullfunc
wants to merge
21
commits into
main
Choose a base branch
from
eric/deployment_fail_track_more_info
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
80386f6
add last 10 terminal outputs for tracking for errors on command. also…
nullfunc cc28f37
clean up
nullfunc 5e67c57
review update. make circular buffer it's own package and tests. Make …
nullfunc d799e2e
update max chunk size comment
nullfunc db7ff38
Update src/pkg/datastructs/circularbuffer.go
nullfunc 196a8cc
review up - make logs per message rather than chunking
nullfunc 6d779ad
defang: -> v0.5.32
goreleaserbot 426f9f6
defang: -> v0.5.32
goreleaserbot eab8a5c
defang: -> v1.1.9
goreleaserbot 5ddc078
fix(cd): hide node warnings (#1343)
lionello b6ac6e6
use only tail logs when capturing deploy errors
nullfunc 86b8c90
clean up
nullfunc bb83df3
Merge branch 'main' into eric/deployment_fail_track_more_info
nullfunc ece98f1
remove new error type
nullfunc 41dadd4
remove unecessary compose tailoption flag
nullfunc ecfcba1
Apply suggestions from code review
nullfunc 10a1135
review updates
nullfunc df56af0
Update src/pkg/track/track.go
nullfunc 3c07fda
review update
nullfunc c4a2413
Merge branch 'main' into eric/deployment_fail_track_more_info
nullfunc 4ee30a5
Merge branch 'main' into eric/deployment_fail_track_more_info
nullfunc 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package circularbuffer | ||
|
|
||
| // BufferInterface abstracts the buffer operations | ||
| type BufferInterface[T any] interface { | ||
| Add(item T) | ||
| Get() []T | ||
| } | ||
|
|
||
| type CircularBuffer[T any] struct { | ||
| size int | ||
| entries int | ||
| index int | ||
| data []T | ||
| } | ||
|
|
||
| func (c *CircularBuffer[T]) Add(item T) { | ||
| c.entries++ | ||
| c.data[c.index] = item | ||
| c.index = (c.index + 1) % c.size | ||
| } | ||
|
|
||
| func (c *CircularBuffer[T]) Get() []T { | ||
| maxItems := min(c.entries, c.size) | ||
| items := make([]T, maxItems) | ||
| startIdx := c.index | ||
|
|
||
| // the c.index points to the next write position (ie. oldest entry) if the buffer is full, | ||
| // otherwise if the buffer is not full then c.index does not point to the older entry so we | ||
| // need to start from index 0 | ||
| if c.entries < c.size { | ||
| startIdx = 0 | ||
| } | ||
|
|
||
| // Collect items in chronological order | ||
| for i := range maxItems { | ||
| idx := (startIdx + i) % c.size | ||
| items[i] = c.data[idx] | ||
| } | ||
| return items | ||
| } | ||
|
|
||
| func NewCircularBuffer[T any](bufferSize int) *CircularBuffer[T] { | ||
| if bufferSize <= 0 { | ||
| panic("failed to created a circular buffer: cannot have zero elements") | ||
| } | ||
| return &CircularBuffer[T]{ | ||
| size: bufferSize, | ||
| entries: 0, | ||
| index: 0, | ||
| data: make([]T, bufferSize), | ||
| } | ||
| } |
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,23 @@ | ||
| package circularbuffer | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestCircularBuffer(t *testing.T) { | ||
| buffer := NewCircularBuffer[int](3) | ||
|
|
||
| assert.Equal(t, []int{}, buffer.Get()) | ||
| buffer.Add(1) | ||
| assert.Equal(t, []int{1}, buffer.Get()) | ||
| buffer.Add(2) | ||
| assert.Equal(t, []int{1, 2}, buffer.Get()) | ||
| buffer.Add(3) | ||
| assert.Equal(t, []int{1, 2, 3}, buffer.Get()) | ||
| buffer.Add(4) | ||
| assert.Equal(t, []int{2, 3, 4}, buffer.Get()) | ||
| buffer.Add(5) | ||
| assert.Equal(t, []int{3, 4, 5}, buffer.Get()) | ||
| } |
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
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.