-
Notifications
You must be signed in to change notification settings - Fork 305
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
New Sync View #6813
New Sync View #6813
Conversation
7732e35
to
2072ae8
Compare
Rebased master |
1717140
to
74f63c4
Compare
why is this better than the existing way? is the plan to make it the default? |
@mai93 The Idea was to show error messages received by BEP rather than parsing the command line output to increase the quality and relevance of reported errors. In my option, the sync and build view provided by the platform was better suited for displaying these longer messages. Furthermore, I hope that using the platform sync view can save us some maintenance work in the long run, since it is maintained by the platform team. With regard to making this view the default, this depends, of course, on the feedback we receive. If it is well perceived, I see no reason for not doing so. But maybe it makes sense to make it opt-in in the beginning. |
Thanks for the explanation! I'd propose guarding it with an experiment instead and enabling it incrementally because we have a lot of features added for specific users behind a key and we never got a sense if they are ready for general rollout. |
Btw please hold on, does it work with query sync? |
@tpasternak I am not sure how the sync UI for query sync works but the new sync view is just a scope that can be added to the |
Ok, you can just add |
import com.intellij.openapi.progress.TaskInfo | ||
import com.intellij.openapi.wm.ex.ProgressIndicatorEx | ||
|
||
object ProgressIndicatorStub : ProgressIndicatorEx { |
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.
can we use EmptyProgressIndicator
instead of this one?
|
||
object BuildViewMigration { | ||
@JvmStatic | ||
val enabled get(): Boolean = Registry.`is`("bazel.new.sync.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.
val enabled
get(): Boolean = Registry.`is`("bazel.new.sync.view")
.submitTask( | ||
indicator -> | ||
Scope.root( | ||
context -> { | ||
if (Registry.is("bazel.new.sync.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.
let's use com.google.idea.blaze.base.buildview.BuildViewMigration#getEnabled
here
import com.intellij.openapi.diagnostic.Logger | ||
import com.intellij.openapi.extensions.ExtensionPointName | ||
|
||
internal val LOG = Logger.getInstance(BuildEventParser::class.java) |
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.
internal val LOG = logger<BuildEventParser>()
val exitCode = execute(ctx, cmdBuilder.build()) | ||
val result = BuildResult.fromExitCode(exitCode) | ||
|
||
parseJob.cancelAndJoin() |
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.
this would cancel all the parsing because it can trigger a CancellationException
from parseEvent
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.
As far as I understand this can only trigger a CancellationException
in parseEvent
if parseEvent
is waiting for more data. And in this case we actually want to cancel parseEvent
because there is not going to be more data after the bazel process finished. The actual parsing cannot be cancelled as far as I can tell.
name: String = "BazelContext", | ||
block: suspend CoroutineScope.() -> T, | ||
): T { | ||
val deferred = scope.async(Dispatchers.IO + CoroutineName(name)) { block() } |
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.
There's no need in IO
use right here
var newScope = new ToolWindowScope.Builder(project, task) | ||
.setProgressIndicator(indicator) | ||
.setPopupBehavior(BlazeUserSettings.FocusBehavior.ON_ERROR) | ||
.setIssueParsers(targetDetectionQueryParsers(project, WorkspaceRoot.fromProject(project))) |
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.
could you please double check this line should be removed?
51586a2
to
eec4260
Compare
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.
looks good, let's add got it promotion as a separate PR
# Conflicts: # base/src/com/google/idea/blaze/base/wizard2/ui/BlazeEditProjectViewControl.java
# Conflicts: # base/src/com/google/idea/blaze/base/sync/SyncProjectTargetsHelper.java
# Conflicts: # base/src/com/google/idea/blaze/base/sync/aspects/BlazeIdeInterfaceAspectsImpl.java
eec4260
to
dff0223
Compare
LeFrosch, could you please explain how to use the now final BuildResultHelper class with the remote builds? Yes, the BuildInvoker.createBuildResultHelper() method can be overridden, but it only can return an instance of final BuildResultHelper class that is cannot be customized. |
@SergejSalnikov If I remember correctly I just inlined the only implementation of the |
Adds the option to use the platform sync view instead of the bazel custom one. Errors are also collected using BEP in the new view to improve the quality of reported issues.
Registry key:
bazel.new.sync.view
Uses the platform sync view to display progress. However, progress no longer follows a tree structure.
The platform sync view offers sufficient space for BEP's detailed error messages.