Skip to content

Added toggle for filtering failed tasks#1325

Open
Tanish-Ranjan wants to merge 2 commits into
eclipse-buildship:masterfrom
Tanish-Ranjan:feat/filter_failed_tests
Open

Added toggle for filtering failed tasks#1325
Tanish-Ranjan wants to merge 2 commits into
eclipse-buildship:masterfrom
Tanish-Ranjan:feat/filter_failed_tests

Conversation

@Tanish-Ranjan
Copy link
Copy Markdown

This commit introduces a toggle action to filter out successful tasks from the execution page and expand all failed tasks.

Fixes #970

Context

Previously, there was only the option to expand and collapse all tasks, making it harder to focus on failures. This change introduces a toggle action that, when enabled, hides successful tasks from the hierarchy in the execution page. When disabled, the full task hierarchy is restored.

This improvement makes it easier for users to debug failures without unnecessary distractions.

This commit introduces a toggle action to filter out successful tasks
from the execution page and expand all failed tasks.

Button_Label_Browse=Browse...

Action_FilterFailedTasks_Tooltip=Filter Failed Tasks
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Action_FilterFailedTasks_Tooltip=Filter Failed Tasks
Action_FilterFailedTasks_Tooltip=Expand Failures


public static String Button_Label_Browse;

public static String Action_FilterFailedTasks_Tooltip;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name should be adjusted.

/**
*
*/
public final class ExpandAllFailedTasksAction extends Action implements SelectionSpecificAction {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public final class ExpandAllFailedTasksAction extends Action implements SelectionSpecificAction {
public final class ExpandFailuresAction extends Action implements SelectionSpecificAction {

❌ the name doesn't correspond to the functionality. We collapse the tree and expand the nodes representing failed progress events.


this.contentProvider.toggleFilterFailedItems();
setChecked(this.contentProvider.isFilterFailedItemsEnabled());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

setChecked(this.contentProvider.isFilterFailedItemsEnabled());

this.treeViewer.collapseAll();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

this.treeViewer.collapseAll();

Object rootObject = this.treeViewer.getInput();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

toolbarManager.appendToGroup(MultiPageView.PAGE_GROUP, new CollapseAllTreeNodesAction(getPageControl().getViewer()));
toolbarManager.appendToGroup(MultiPageView.PAGE_GROUP, new ShowFilterAction(getPageControl()));
ExpandAllFailedTasksAction action = new ExpandAllFailedTasksAction(getPageControl().getViewer());
action.setContentProvider((ExecutionPageContentProvider)getPageControl().getViewer().getContentProvider());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ this can happen in the action's constructor. Then, you can use the same pattern as around, ie

toolbarManager.appendToGroup(MultiPageView.PAGE_GROUP, new ExpandAllFailedTasksAction(...));

Copy link
Copy Markdown
Author

@Tanish-Ranjan Tanish-Ranjan Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add ExecutionPageContentProvider as a constructor parameter, since UiContributionManager also takes an instance of the action and I don't have access to the content provider there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the looks of it, UiContributionManager contributes actions to the tasks view. In other words it's independent from the (execution) view this PR aims to improve. You probably don't need to modify it whatsoever.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

}

public void toggleFilterFailedItems() {
this.filterFailedItems = !this.filterFailedItems;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Please don't do this. Use explicit getters and setters.

*/
public class ExecutionPageContentProvider implements ITreeContentProvider {

private boolean filterFailedItems = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ This is wrong as the state will get lost when the IDE restarts. Instead, store the state in WorkspaceConfiguration. Then you can initialize the action from the worksace configuration and update it upon a toggle action.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch that, the proper place to store the state is ExecutionViewState.

Copy link
Copy Markdown
Contributor

@donat donat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ And the test coverage is missing. We should have something like ExecutionViewExpandAndCollapseAllTest.

@donat
Copy link
Copy Markdown
Contributor

donat commented Mar 7, 2025

@Tanish-Ranjan a gentle ping re:my review. If you are still planning to fix the review items, let me know.

@Tanish-Ranjan
Copy link
Copy Markdown
Author

@donat I have fixed all the review items. I am trying to test it thoroughly before submitting it for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gradle executions: filter failed tests

2 participants