-
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
Conversation
cli/run_util.go
Outdated
params := log.StepStartedParams{ | ||
ExecutionId: stepExcutionId, | ||
Position: idx, | ||
IdVersion: idVersion, |
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.
IMO we don't need both idVersion and title.
We should have one filed, which stores the Step Title to present. The value should follow this precedence:
- override Step title (defined in the bitrise.yml)
- original Step title (defined in the step.yml)
- stepIDVersionComposite
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.
That is a great idea. I will update the code.
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.
The header title is much better now.
This was before:
+------------------------------------------------------------------------------+
| (0) script |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| (1) git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone... |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| (2) certificate-and-profile-installer@1 |
+------------------------------------------------------------------------------+
And this is after the change:
+------------------------------------------------------------------------------+
| (0) Clear step outputs |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| (1) git::https://github.com/bitrise-steplib/bitrise-step-simple-git-clone... |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| (2) Certificate and profile installer |
+------------------------------------------------------------------------------+
@@ -0,0 +1,58 @@ | |||
package log |
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.
so few codes compared to the previous implementation 😍
log/models.go
Outdated
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 comment
The 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 comment
The 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.
cli/run_util.go
Outdated
} | ||
|
||
// The composite step id is not useful for the user. So let's replace it with the original step title defined in the step.yml file. | ||
if strings.HasPrefix(title, stepInfo.ID) && step.Title != nil && *step.Title != "" { |
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.
Changes
print.go
file and moved to the new log package