-
Notifications
You must be signed in to change notification settings - Fork 131
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
[CI-217] Step started event #825
Changes from 1 commit
098e265
c462bc6
d69e2e6
d0a446d
76f8070
c6cb842
9dded33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,10 +21,9 @@ func TestStepHeaderPrinting(t *testing.T) { | |
params: StepStartedParams{ | ||
ExecutionId: "ExecutionId is not needed", | ||
Position: 0, | ||
IdVersion: "[email protected]", | ||
Title: "[email protected]", | ||
Id: "xcode-test", | ||
Version: "4.1.2", | ||
Title: "Title is not needed", | ||
Collection: "Steplib", | ||
Toolkit: "Go", | ||
StartTime: "2022-10-19T10:28:33Z ", | ||
|
@@ -47,17 +46,16 @@ func TestStepHeaderPrinting(t *testing.T) { | |
params: StepStartedParams{ | ||
ExecutionId: "random-uuid", | ||
Position: 1, | ||
IdVersion: "this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step@1", | ||
Title: "Very long step name - Very long step name - Very long step name - Very long step name - Very long step name", | ||
Id: "this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step", | ||
Version: "1.1.2", | ||
Title: "Very long step name - Very long step name - Very long step name - Very long step name - Very long step name", | ||
Collection: "Steplib", | ||
Toolkit: "Go", | ||
StartTime: "Now", | ||
}, | ||
expectedOutput: []string{ | ||
"+------------------------------------------------------------------------------+", | ||
"| (1) this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-t... |", | ||
"| (1) Very long step name - Very long step name - Very long step name - Ver... |", | ||
"+------------------------------------------------------------------------------+", | ||
"| id: this-is-the-step-this-is-the-step-this-is-the-step-this-is-the-step-t... |", | ||
"| version: 1.1.2 |", | ||
|
@@ -73,10 +71,9 @@ func TestStepHeaderPrinting(t *testing.T) { | |
params: StepStartedParams{ | ||
ExecutionId: "another-random-uuid", | ||
Position: 2, | ||
IdVersion: "git::https://github.com/org/repo", | ||
Title: "git::https://github.com/org/repo", | ||
Id: "https://github.com/org/repo", | ||
Version: "", | ||
Title: "", | ||
Collection: "Git", | ||
Toolkit: "", | ||
StartTime: "42", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,9 @@ package log | |
type StepStartedParams struct { | ||
ExecutionId string `json:"uuid"` | ||
Position int `json:"idx"` | ||
IdVersion string `json:"id_version"` | ||
Title string `json:"title"` | ||
Id string `json:"id"` | ||
Version string `json:"version"` | ||
Title string `json:"title"` | ||
Collection string `json:"collection"` | ||
Toolkit string `json:"toolkit"` | ||
StartTime string `json:"-"` // This value is only needed for the console logging. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't we still need this for the log conversion (json->console)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No we do not because every json log will have a timestamp by default. We can use that time and print it as the step start time because the step execution starts after the step header is printed. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it working if the step ID composite has the collection part too?
git::<repo_utrl>
https://github.com/bitrise-io/bitrise-steplib.git::script@1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Pushed a new commit with the updated logic.