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

Task/jenkins 37791 run favorite reordering #502

Merged
merged 41 commits into from Sep 21, 2016

Conversation

cliffmeyers
Copy link
Contributor

@cliffmeyers cliffmeyers commented Sep 15, 2016

Description

  • See JENKINS-37791.
  • Note: the logic that I settled on here is that the "standard sort" (see below) is applied whenever the favorites are loaded, any time a favorite or added or removed, or any time a job finishes (failed, aborted, successful, unstable). If the UI receives an update that a job was queued or is running, the stack does not resort. Navigating away and back will resort the stack.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.
  • Ran Acceptance Test Harness against PR changes.

Reviewer checklist

  • Run the changes and verified the change matches the issue description
    • Note that the "standard order" here is basically red cards first, then blue, gray, then green. Slight oversimplification - refer to the sort helper to see exact logic).
    • Run several favorites and note the list is not sorted - the cards stay in position after being run.
    • Wait for one of the jobs to finish; note that the stack is re-sorted into the standard order.
    • Stopping a running job should also card the cause to sort in standard order.
    • Add or remove some favorites and note that each time the cards are sorted in standard order.
    • Run a pipeline, navigate away, then back: sorted in standard order.
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

@jenkinsci/code-reviewers @reviewbybees

Cliff Meyers and others added 30 commits September 8, 2016 09:49
…s from server; ported over from other branch
…for remote calls; tests for CapabilityStore
…lace; needs more filtering, proper fetch integration, actual tests
…' property (since the data can be quite large)
… to each object; make available in Augmenter as well
…r is consistent (per kzantow) and because performance impact appears minimal
- Also pulls in well known capabilities in to a class as constant
- Fixes typo in PullRequest capability
@ghost
Copy link

ghost commented Sep 15, 2016

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

# Conflicts:
#	blueocean-core-js/package.json
#	blueocean-core-js/src/js/capability/CapabilityAugmenter.js
#	blueocean-core-js/test/js/capability/CapabilityApi-spec.js
#	blueocean-core-js/test/js/capability/CapabilityAugmenter-spec.js
#	blueocean-dashboard/npm-shrinkwrap.json
#	blueocean-dashboard/package.json
#	blueocean-personalization/npm-shrinkwrap.json
#	blueocean-personalization/package.json
#	blueocean-web/npm-shrinkwrap.json
#	blueocean-web/package.json
@michaelneale
Copy link
Member

Seems good to me - worthy of a 🐝. Kudos for tests.

The functionality seems right (I am sure I missed a combination) - I think @i386 could verify but don't let that block things.

Would also, as always, be nice to drag ATH over it when in a good state but this is likely not a cross cutting change.

@i386
Copy link
Contributor

i386 commented Sep 21, 2016

@cliffmeyers I like this solution BTW 👍

@cliffmeyers cliffmeyers merged commit c1b92d5 into master Sep 21, 2016
@cliffmeyers cliffmeyers deleted the task/JENKINS-37791-run-favorite-reordering branch September 21, 2016 17:49
cliffmeyers pushed a commit that referenced this pull request Sep 21, 2016
…eed to be fixed after PR #502 and #504 are merged to master
cliffmeyers added a commit that referenced this pull request Sep 27, 2016
* [JENKINS-36687] build a utility function that converts a Run's HAL URL to the corresponding UI URL, to avoid encoding bugs

* [JENKINS-36687] comments

* [JENKINS-36687] add support for styles and assets in blueocean-core-js; add some assets for testing and in prep of "Run Pipeline" refactor

* [JENKINS-36687] rework the blueocean-web build so it can support multiple "libraries" (e.g. JDL and CoreJS) in the src/main/webapp/assets directory

* [JENKINS-36687] amend .gitignore

* [JENKINS-36687] UrlBuilder: more tests, better errors

* [JENKINS-36687] typos ;)

* [JENKINS-36687] fix blueocean-core-js versions in package.json (after publish)

* [JENKINS-36687] formatting

* [JENKINS-36687] begin migrating SseBus to blueocean-core-js so it can be shared across plugins; support multiple subscriptions; still needs testing

* [JENKINS-36687] clean up new SseBus code; fix some issues that appeard to be caused by two SSE connections being made using the same clientId

* [JENKINS-36687] switch blueocean-personalization to use SseBus from blueocean-core-js

* [JENKINS-36687] new "RunButton" work in progress

* [JENKINS-36687] style button as a tag rather than button to avoid JDL style collisions with button tag

* [JENKINS-36687] stop button state; refinement of styling and positioning

* [JENKINS-36687] create API utility to encapsulate fetch logic

* [JENKINS-36687] wire up start / stop API to the RunButton; refine toast messaging

* [JENKINS-36687] fix some broken logic in SSE bus that was adding a duplicate listener for each subscription added

* [JENKINS-36687] simplify listener logic; wire up logic for "started" and "stopped" toasts

* [JENKINS-36687] brute force fix for "duplicate toasts" bug that just prevents them from being added; in place until we find a more elegant fix in upstream code

* [JENKINS-36687] strip out "awaiting job event" code in favor of fix within ToastService (for now)

* [JENKINS-36687] implement "stopping" state for RunButton

* [JENKINS-36687] customize label of Run button

* [JENKINS-36687] minor refinements to labels

* [JENKINS-35796] add the "Stop" button to the Run Details screen

* [JENKINS-36687] fix regression in ToastService spec

* tick version after publishing 0.0.3-beta4; update deps

* [JENKINS-36974] add the "stop" button for running builds to the Activity tab

* [JENKINS-36974] enhance RunButton to support multiple "buttonTypes" so it can toggle or show only run or stop; update Activity tab to use new RunButton at top for non multi-branch

* [JENKINS-36974] stop button hover state

* [JENKINS-36974] remove old assets

* [JENKINS-36974] delint

* [JENKINS-36974] kill debugger

* [JENKINS-36687] use new RunButton implementation on Branches tab

* [JENKINS-36974] use new RunButton implementation on PR tab; fix dead "OPEN" link in Toast when launching from Branches

* [JENKINS-36974] remove obsolete components / tests

* [JENKINS-35794] add new API method for replaying a build; add temp utilities for parsing response

* [JENKINS-35794] add new ReplayButton component for replaying failed builds; still a WIP

* [JENKINS-35794] add Replay button to Activity tab; still needs to handle navigation in Toast

* [JENKINS-35794] refactor some parsing logic into shared funcs

* [JENKINS-35794] convert a queue item / REST URL to a valid Run Details interface URL

* tick version after publishing 0.0.3-beta9

* [JENKINS-35794] wire up Toast's "OPEN" link for Replay button on Activity

* [JENKINS-35794] fix bug in logic when checking result / state

* [JENKINS-35974] prevent a dup Toast issue

* tick version after publishing 0.0.3-beta11

* [JENKINS-35789] add Re-run button to Run Details

* [JENKINS-36687] update RunsApi to use new JWT-enabled Fetch library

* [JENKINS-36687] update SseBus to use new JWT-enabled Fetch

* [JENKINS-36687] eliminate the old "UrlConfig" in favor of the new urlconfig

* [JENKINS-36687] migrate "cleanSlashes" into generic utils

* [JENKINS-36687] delint

* [JENKINS-36687] delint tests

* [JENKINS-36687] delinting done

* [JENKINS-36687] ensure lint and tests run before publish; tick up version numbers

* [JENKINS-35789] hide the Re-run button if the job is not simple or multi-branch pipeline

* [JENKINS-35789] test more scenarios for buildRunDetailsUrlFromQueue

* [JENKINS-37425] use a git-flow style branch name in test

* [JENKINS-37425] start of a new utility for fetching capabilities metadata

* [JENKINS-37425] fix a really weird bug that was causing an extra "/jenkins/blue" to be prepended to the beginnng of the browser URL after navigating

* [JENKINS-37425] simplify the RunButton to immediately fire off a "Started" Toast by using data from the REST API response rather than waiting for the SSE event; also eliminate the "Stopped" Toast that required SSE integration as well

* [JENKINS-37425] work in progress; clicking Re-run on the Run Details page does not update the page correctly due to some Router jankiness

* [JENKINS-35789] fix a bug where clicking the Re-run button on Run Details would not appopriately trigger a refetch of the Run

* [JENKINS-36687] better method name / comments

* [JENKNS-37425] continue refining Toast behavior; make reusable function for creating "Run Started" toast

* [JENKNS-37425] fix a bug where clicking "Open" on Toast initiated from Activity page would result in bad url / 404

* [JENKINS-37519] CapabilitiesStore that can load and cache capabilities from server; ported over from other branch

* [JENKINS-37519] let the CapabilityStore delegate to an CapabilityApi for remote calls; tests for CapabilityStore

* [JENKINS-37519] start of CapabilityAugmenter: basic tree walking in place; needs more filtering, proper fetch integration, actual tests

* [JENKINS-37519] better names for things in augmenter; tests

* [JENKINS-37519] finish impl of augmentCapabilities; write a basic test for it

* [JENKINS-37519] delint

* [JENKINS-37519] add another more elaborate test case for 'augmentCapabilities'

* [JENKINS-37519] handle the scenario where the capabilities weren't loaded more gracefully (and warn)

* [JENKINS-37519] add an "enum" of a few available capabilities

* [JENKINS-37519] export an instance of CapabilityAugmenter for use by clients

* [JENKINS-37519] fix a bug in the augmenter where a cycle caused an infinite loop

* [JENKINS-37519] add some perf logging so we can benchmark

* [JENKINS-37519] jsdoc

* [JENKINS-37519] add the ability to conditionally include the 'actions' property (since the data can be quite large)

* [JENKINS-37519] add "Capable" utility so we can attach a "can" method to each object; make available in Augmenter as well

* [JENKINS-37519] clean up warnings

* [JENKINS-37519] add logic to CapabilityApi to strip out duplicates

* [JENKINS-37519] enable the parsing of 'actions' by default so behavior is consistent (per kzantow) and because performance impact appears minimal

* [JENKINS-37519] don't log warnings by default; turn off perf metrics in the test suite

* JENKINS-38136# capability map API changed to POST

- Also pulls in well known capabilities in to a class as constant
- Fixes typo in PullRequest capability

* Doc update

* [JENKINS-37519] use POST for capabilities fetch, since a very long class list could break for a GET

* [JENKINS-37519] delint

* [JENKINS-37831] tick up versions for blueocean-core-js

* [JENKINS-37831] add capabilities fetching into some of the key fetches in dashboard and personalization

* [JENKINS-37831] disable favoriting of matrix jobs

* [JENKINS-37831] delint

* [JENKINS-37425] remove old version of capability apis; refactor logic to create "run started" toast into ToastUtils (per tfennelly); remove logic that compensating for JENKINS-37746

* [JENKINS-37425] tick version for core-js after publish of 0.0.17-beta3; update deps to use

* [JENKINS-37425] remove logic in DashboardCards listener that was creating "started" and "stopped" toasts; prevents extra toasts firing when run button on other screens is used

* [JENKINS-37425] fix a bug where simple pipeline's "OPEN" link was bad because of faulty multibranch logic; fix a bug where branch names were not decoded in Toast

* [JENKINS-37425] update a test that was not actually using a nested job URL

* [JENKINS-37425] update favorite card to use Run/ReplayButton; tests need to be fixed after PR #502 and #504 are merged to master

* [JENKINS-37425] update RunButton to use an embedded SVG instead of 4 distinct SVG assets for its different states; apply :hover coloring for the "dark" themes of Run/ReplayButton

* [JENKINS-37425] make "capable" a bit more flexible in terms of params it will accept

* [JENKINS-37425] fix a regression in this branch where clicking "Re-run" from Run Details would not automatically navigate the user to the Run Details screen for the new run; bake permissions logic into ReplayButton to hide itself if not a pipeline

* [JENKINS-37425] another test for URL builder

* [JENKINS-37425] delint

* [JENKINS-37425] make UrlBuilder available so that PipelineCard can use it to build the run details URL

* [JENKINS-37425] remove IfCapability check around ReplayButton since it will hide itself for non-pipelines

* [JENKINS-37425] remove obselete file that was refactored into ToastUtils

* [JENKINS-37425] delint; fix broken tests

* [JENKINS-37425] remove redundant code from personalization that is now handled directly by RunButton / ReplayButton; delint

* [JENKINS-37425] simplify logic in render method to "isRunFailed" method; fix a bug on Run Details where replaying multiple times would not work because the button was not having its state reset when bound to a new Run

* tick up versions after publish blueocean-core-js 0.0.17-beta5

* [JENKINS-37425] refactor display logic for favorite cards from DashboardCards down into PipelineCard - where it's more sensible to be; update all shrinkwraps

* [JENKINS-37425] delint

* tick up versions after publish blueocean-core-js 0.0.18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants