-
Notifications
You must be signed in to change notification settings - Fork 297
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
Integrated code lifecycle
: Add duration in build queue view
#8608
Integrated code lifecycle
: Add duration in build queue view
#8608
Conversation
- add interval which updates the duration
WalkthroughThe recent updates to the build queue component enhance the user interface by adding conditional styling and formatting for build durations. Additionally, the component now dynamically updates build job durations every second, ensuring real-time accuracy. These changes improve the visibility and tracking of build processes, providing a more responsive and informative user experience. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
src/main/webapp/app/localci/build-queue/build-queue.component.ts
Outdated
Show resolved
Hide resolved
} | ||
} | ||
// This is necessary to update the view when the build job duration is updated | ||
this.runningBuildJobs = JSON.parse(JSON.stringify(this.runningBuildJobs)); |
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.
I think the proper way would be to trigger the change detection.
Or at least only create a new array instead of parsing it: this.runningBuildJobs = [...this.runningBuildJobs];
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.
These unfortunately didn't work when I tried them
- ref.detectChanges() doesn't work due to how ngx-datatable is implemented
this.runningBuildJobs = [...this.runningBuildJobs];
didn't work too (although they say that it should work in their docs)
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 spread operator ('...')
is a shallow copy method, which means it copies the elements of the array but not the nested objects themselves, they remain referenced to the original objects.
The JSON.parse(...)
is a deep copying method and creates entirely new and independent objects.
I did not go into detail on BuildJobs -Class
, but this could explain why only the parsing works correctly for your runningBuildJobs
array
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.
Since we already use eslint could we not just use the deep copy method of that library?
Also I'm not completely sure but could setting it to an empty array first and then re-setting it work?
Integrated code lifecycle
: add buildjob duration in buildqueue viewIntegrated code lifecycle
: Add buildjob duration in buildqueue view
…ldjob-duration-in-buildqueue-view
|
|
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.
Tested locally in a testing session as TS3 is currently in use. Works as expected.
…ldjob-duration-in-buildqueue-view
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.
tested in a testing session locally due to TS3 being currently in use. Works as intended
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.
Code LGTM overall 👍 Two small notes but those do not need to be addressed right now
} | ||
} | ||
// This is necessary to update the view when the build job duration is updated | ||
this.runningBuildJobs = JSON.parse(JSON.stringify(this.runningBuildJobs)); |
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.
Since we already use eslint could we not just use the deep copy method of that library?
Also I'm not completely sure but could setting it to an empty array first and then re-setting it work?
Integrated code lifecycle
: Add buildjob duration in buildqueue viewIntegrated code lifecycle
: Add duration in build queue view
Checklist
General
Client
Motivation and Context
This helps improve the time needed for a quick overview of the running build agents and possible problems.
Admins need a way to view the buildjob duration quickly and to be warned when a job lasts longer than 4 min (default timeout time for jobs in the server)
Steps for Testing
Prerequisites:
Build Duration
. Make sure that its being updated and that the value is correct using theBuild Start Date
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Review Progress
Performance Review
Code Review
Manual Tests
Screenshots
(Changed the time to trigger the highlight to 10s for demo)