Skip to content
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

Bug 1913851: sort cluster task in pipeline builder #7754

Merged
merged 1 commit into from Jan 12, 2021

Conversation

vikram-raj
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-5304

Analysis / Root cause:
Task selection dropdown in the pipeline builder contains an unsorted list of items.

Solution Description:
Sort the cluster tasks in the pipeline builder

Screen shots / Gifs for design review:
image

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. label Jan 7, 2021
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: This pull request references Bugzilla bug 1913851, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1913851: sort cluster task in pipeline builder

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jan 7, 2021
@vikram-raj
Copy link
Member Author

/cc @karthikjeeyar

Comment on lines +47 to +52
const options = _.sortBy(
[
...namespaceTaskList.map((task) => taskToOption(task, onNewTask)),
...clusterTaskList.map((task) => taskToOption(task, onNewTask)),
],
(o) => o.label,
Copy link
Contributor

Choose a reason for hiding this comment

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

You could simply use sort function instead of lodash :)

Suggested change
const options = _.sortBy(
[
...namespaceTaskList.map((task) => taskToOption(task, onNewTask)),
...clusterTaskList.map((task) => taskToOption(task, onNewTask)),
],
(o) => o.label,
const options = [
...namespaceTaskList.map((task) => taskToOption(task, onNewTask)),
...clusterTaskList.map((task) => taskToOption(task, onNewTask)),
].sort((a, b) => a.label.localeCompare(b.label))

Copy link
Contributor

Choose a reason for hiding this comment

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

Either or. Neither is wrong.
If we want to impose such restrictions, then we should write lint rules for them. Add it to the nit pile.

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely my preferred way, but it's effectively the same. If we were not so swamped, I'd have gone for this change.

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 11, 2021
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, vikram-raj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 11, 2021
@openshift-merge-robot openshift-merge-robot merged commit 7337ae7 into openshift:master Jan 12, 2021
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: All pull requests linked via external trackers have merged:

Bugzilla bug 1913851 has been moved to the MODIFIED state.

In response to this:

Bug 1913851: sort cluster task in pipeline builder

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.7 milestone Jan 12, 2021
@vikram-raj vikram-raj deleted the odc-5304 branch January 13, 2021 03:46
@vikram-raj
Copy link
Member Author

/cherry-pick release-4.6

@openshift-cherrypick-robot

@vikram-raj: #7754 failed to apply on top of branch "release-4.7":

Applying: sort cluster task in pipeline builder
Using index info to reconstruct a base tree...
M	frontend/packages/pipelines-plugin/src/components/pipelines/pipeline-topology/TaskListNode.tsx
Falling back to patching base and 3-way merge...
Auto-merging frontend/packages/pipelines-plugin/src/components/pipelines/pipeline-topology/TaskListNode.tsx
CONFLICT (content): Merge conflict in frontend/packages/pipelines-plugin/src/components/pipelines/pipeline-topology/TaskListNode.tsx
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 sort cluster task in pipeline builder
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-cherrypick-robot

@vikram-raj: #7754 failed to apply on top of branch "release-4.6":

Applying: sort cluster task in pipeline builder
Using index info to reconstruct a base tree...
A	frontend/packages/pipelines-plugin/src/components/pipelines/pipeline-topology/TaskListNode.tsx
Falling back to patching base and 3-way merge...
Auto-merging frontend/packages/dev-console/src/components/pipelines/pipeline-topology/TaskListNode.tsx
CONFLICT (content): Merge conflict in frontend/packages/dev-console/src/components/pipelines/pipeline-topology/TaskListNode.tsx
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 sort cluster task in pipeline builder
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants