-
Notifications
You must be signed in to change notification settings - Fork 0
Add critical path to BEP #25
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
base: master
Are you sure you want to change the base?
Conversation
@meisterT PTAL |
ping? |
@Yannic I am sorry that I didn't get to this one earlier. What other metrics do you plan to include here in the future? If it is just the total time, adding it here might be better? https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto;l=955;drc=58eeea17db80cc85d685d9319655f2dc398f063d |
@meisterT I'd like to include the actions on the critical path and metrics about them (executed locally vs remotely vs in a worker, how long input upload or output download took, ...) |
Is that uploaded to BES like the Bazel profile? |
Yes, it is. That's also how we use it internally. |
Warning Rate limit exceeded@visz11 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 47 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (10)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Oh, great! Let me see if that works for what I had in mind |
I assume we need to modify cc: @coeuvre |
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.
Hello @arvi18, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request introduces the critical path to the Build Event Protocol (BEP). It adds a new protobuf definition for CriticalPath
, includes it in the BuildEvent
message, and publishes a CriticalPathEvent
to the event bus. This allows clients to receive information about the total time of the critical path of a build via the BEP.
Highlights
- Critical Path Proto Definition: A new proto file
critical_path.proto
is added, defining theCriticalPath
message, which includes the total time of the critical path. - BEP Integration: The
CriticalPath
message is integrated into theBuildEvent
proto, allowing it to be included in the Build Event Stream. - Event Publishing: The
AggregatedCriticalPath
class now posts aCriticalPathEvent
to the event bus, which contains the total time of the critical path. This event is then included in the BEP. - Build Tool Changes: The
BuildTool
class is modified to include theCriticalPathEvent
in the list of events posted at the end of a build.
Changelog
Click here to see the changelog
- src/main/java/com/google/devtools/build/lib/buildeventstream/proto/BUILD
- Added dependency on
//src/main/protobuf:critical_path_proto
.
- Added dependency on
- src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto
- Imported
src/main/protobuf/critical_path.proto
. - Added
critical_path
to theBuildEventId
oneof. - Added
critical_path
field to theBuildEvent
message.
- Imported
- src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java
- Imported
com.google.devtools.build.lib.metrics.criticalpath.CriticalPathEvent
. - Added
CriticalPathEvent.BEP_ID
to the list of events posted instopRequest()
.
- Imported
- src/main/java/com/google/devtools/build/lib/metrics/criticalpath/AggregatedCriticalPath.java
- Added
postEvent()
method to post theCriticalPathEvent
to the event bus.
- Added
- src/main/java/com/google/devtools/build/lib/metrics/criticalpath/BUILD
- Added dependencies for BEP integration and protobuf.
- src/main/java/com/google/devtools/build/lib/metrics/criticalpath/CriticalPathEvent.java
- Created new class
CriticalPathEvent
to represent the BEP event for the critical path.
- Created new class
- src/main/java/com/google/devtools/build/lib/runtime/BuildSummaryStatsModule.java
- Called
criticalPath.postEvent(eventBus)
to publish the event.
- Called
- src/main/protobuf/BUILD
- Added
critical_path_proto
,critical_path_java_proto
, andcritical_path_java_proto_srcs
targets. - Added
:critical_path_java_proto_srcs
to thefilegroup
.
- Added
- src/main/protobuf/critical_path.proto
- Created new proto file
critical_path.proto
to define theCriticalPath
message.
- Created new proto file
- src/test/java/com/google/devtools/build/lib/buildtool/util/BuildIntegrationTestCase.java
- Added
BuildSummaryStatsModule
to the runtime builder.
- Added
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
A path so critical,
Its time we must chronicle,
In BEP it shall reside,
With duration as its guide,
A build's tale, now typical.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 Review
The pull request introduces the critical path to the Build Event Protocol (BEP). This is a valuable addition for understanding build performance. The changes involve adding a new protobuf definition for critical path data, integrating it into the build process, and exposing it through the BEP. Overall, the changes seem well-structured, but some areas could benefit from further clarification and potential improvements.
Summary of Findings
- Missing Documentation: The pull request description is minimal. More information about the purpose of the changes, how to use the new feature, and any potential impact on existing functionality would be beneficial.
- Clarity of 'Next id' Comments: The comments indicating 'Next id' in the protobuf definitions could be more descriptive. It's not immediately clear what these IDs refer to or why they are important.
- Error Handling: While the code adds functionality for critical path analysis, it's not clear how errors during critical path computation or BEP event posting are handled. Robust error handling is crucial for production systems.
Merge Readiness
The pull request introduces important functionality, but it's not quite ready for merging. The missing documentation and lack of clarity in certain comments should be addressed. Additionally, the error handling aspects need to be carefully reviewed. I am unable to directly approve this pull request, and recommend that it not be merged until these issues are addressed, and that others review and approve this code before merging.
/**Posts the {@code BEP} event for the critical path on the provided {@link EventBus}. */ | ||
public void postEvent(EventBus eventBus) { | ||
Preconditions.checkNotNull(eventBus); | ||
|
||
eventBus.post(new CriticalPathEvent(Duration.ofMillis(totalTimeInMs))); | ||
} |
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.
Consider adding a try-catch block around the eventBus.post
call to handle potential exceptions during event posting. This could prevent the entire build from failing if there's an issue with the event bus.
/**Posts the {@code BEP} event for the critical path on the provided {@link EventBus}. */
public void postEvent(EventBus eventBus) {
Preconditions.checkNotNull(eventBus);
try {
eventBus.post(new CriticalPathEvent(Duration.ofMillis(totalTimeInMs)));
} catch (Exception e) {
// Log the exception or handle it appropriately.
System.err.println("Error posting CriticalPathEvent: " + e.getMessage());
}
}
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Additional info will be added in follow-ups.