jenkins
jenkins copied to clipboard
Rewrite the build history widget
This PR implements the changes discussed https://community.jenkins.io/t/revamped-build-history-widget/10944. In essence it's a rewrite/redesign of the build history widget. The goal is to be cleaner and simpler, whilst still retaining existing functionality and density.
Before
After
What's changed
- The JS has been rewritten and does away with a lot of the complicated layout logic in favour of CSS flex/grid.
- A new card component has been added (with the intention of replacing the existing widget component) that supports inline actions
- Builds now group by date, keeping the UI simpler/easier to read
- RSS feed has been moved to a dropdown, rather than a fixed button row
- Build overflow menus are now always present on the right of the link
What doesn't work
- ✅ ~Pagination controls are always visible at the moment~
- ✅ ~The list doesn't auto refresh at the moment~
- ✅ ~Items with long names/lots of actions don't scale very well~
Testing done
- See https://github.com/jenkinsci/jenkins/pull/9148#issuecomment-2053640530 for a view of the scenarios tested
- Normal scenarios work as expected (e.g. short build names, one or two badges)
- Queued items look as expected
- Items with plain text/HTML descriptions work as expected
- Items with long names/lots of badges wrap as expected
Proposed changelog entries
- Update the design of the build history widget
Proposed upgrade guidelines
N/A
### Submitter checklist
- [x] The Jira issue, if it exists, is well-described.
- [x] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see [examples](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during upgrade.
- [x] There is automated testing or an explanation as to why this change has no tests.
- [x] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadocs, as appropriate.
- [x] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")`, if applicable.
- [x] New or substantially changed JavaScript is not defined inline and does not call `eval` to ease future introduction of Content Security Policy (CSP) directives (see [documentation](https://www.jenkins.io/doc/developer/security/csp/)).
- [x] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [x] For new APIs and extension points, there is a link to at least one consumer.
Desired reviewers
@jenkinsci/sig-ux
Before the changes are marked as ready-for-merge
:
### Maintainer checklist
- [ ] There are at least two (2) approvals for the pull request and no outstanding requests for change.
- [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [ ] Changelog entries in the pull request title and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically.
- [ ] If the change needs additional upgrade steps from users, the `upgrade-guide-needed` label is set and there is a **Proposed upgrade guidelines** section in the pull request title (see [example](https://github.com/jenkinsci/jenkins/pull/4387)).
- [ ] If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labeled as `lts-candidate` to be considered (see [query](https://issues.jenkins.io/issues/?filter=12146)).
can you add before screenshots too please
How does this look when a build has a display name?
How does it look when a build has many badges?
Just an example how this looks currently:
How does this look when a build has a display name? How does it look when a build has many badges? Just an example how this looks currently:
It's okay but could be better - I think moving the badges onto a new row when its incredibly long would improve it.
What made the previous implementation so big was the logic to find a suitable way to arrange all the things. See #9122 for my PR that changed they calculation to be more efficient.
Please take a moment and address the merge conflicts of your pull request. Thanks!
Getting ReferenceError: "fetch" is not defined. (http://localhost:42617/jenkins/static/8bd93229/jsbundles/pages/project/builds-card.js#52)
in tests - have you experienced this before @timja?
Getting
ReferenceError: "fetch" is not defined. (http://localhost:42617/jenkins/static/8bd93229/jsbundles/pages/project/builds-card.js#52)
in tests - have you experienced this before @timja?
I see the issue, PR incoming
https://github.com/jenkinsci/jenkins-test-harness/pull/753
How does this look when a build has a display name? How does it look when a build has many badges? Just an example how this looks currently:
It's _okay_ but could be better - I think moving the badges onto a new row when its incredibly long would improve it.
Updated it to handle a ton of badges/long text - there's a lot of combinations so I might have missed something.
No blockers from a security perspective.
However, I've noticed that the search filter doesn't seem to work properly. It takes quite long or never finishes.
Please take a moment and address the merge conflicts of your pull request. Thanks!
StaticRoutingDecisionProviderTest#test_objectCustom_withStandardWhitelist
is passing locally but not on CI - wondering if this is actually an issue of this PR?
The collapse arrow is no longer there. tbh I have never used it so I'm not missing it but don't know what others are thinking about it.
StaticRoutingDecisionProviderTest#test_objectCustom_withStandardWhitelist
is passing locally but not on CI - wondering if this is actually an issue of this PR?
I can reproduce it locally by running the entire test class, not just the one test. This is a result of concurrent test execution within the same class. I was unaware we were doing this, is this new?
StaticRoutingDecisionProviderTest#test_objectCustom_withStandardWhitelist
is passing locally but not on CI - wondering if this is actually an issue of this PR?I can reproduce it locally by running the entire test class, not just the one test. This is a result of concurrent test execution within the same class. I was unaware we were doing this, is this new?
I can't see it enabled =/
https://github.com/jenkinsci/jenkins/blob/065c2ba00e729fc947ef131ab143615b5dcb95ef/test/pom.xml#L359-L369
OK then I'll dig further, my System.err based diagnostic probably wasn't good enough :)
Running the entire class, I get this after modifying the test to not rely on @Before
and changing the URL to be guaranteed not routable:
@timja Thoughts? Am I missing something obvious?
I've not looked into it in detail but this chases it away =/:
diff --git a/test/src/test/java/jenkins/security/stapler/StaticRoutingDecisionProviderTest.java b/test/src/test/java/jenkins/security/stapler/StaticRoutingDecisionProviderTest.java
index 9e849a2278..b76124047d 100644
--- a/test/src/test/java/jenkins/security/stapler/StaticRoutingDecisionProviderTest.java
+++ b/test/src/test/java/jenkins/security/stapler/StaticRoutingDecisionProviderTest.java
@@ -95,7 +95,7 @@ public class StaticRoutingDecisionProviderTest extends StaplerAbstractTest {
}
@Test
- public void test_job_index() throws Exception {
+ public void zzTest_job_index() throws Exception {
j.createFreeStyleProject("testProject");
assertReachableWithoutOk("contentProvider/job/");
assertTrue(ContentProvider.called);
Its being loaded by build history ajax somehow.
From a breakpoint on all the called variables:
This also chases it away, I haven't run other sub-classes to see if any impact:
diff --git a/test/src/test/java/jenkins/security/stapler/StaplerAbstractTest.java b/test/src/test/java/jenkins/security/stapler/StaplerAbstractTest.java
index 4c3f5d28b6..d66902a724 100644
--- a/test/src/test/java/jenkins/security/stapler/StaplerAbstractTest.java
+++ b/test/src/test/java/jenkins/security/stapler/StaplerAbstractTest.java
@@ -43,7 +43,7 @@ import org.htmlunit.HttpMethod;
import org.htmlunit.Page;
import org.htmlunit.WebRequest;
import org.junit.Before;
-import org.junit.ClassRule;
+import org.junit.Rule;
import org.jvnet.hudson.test.JenkinsRule;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerResponse;
@@ -51,8 +51,8 @@ import org.kohsuke.stapler.WebApp;
import org.kohsuke.stapler.WebMethod;
public abstract class StaplerAbstractTest {
- @ClassRule
- public static JenkinsRule rule = new JenkinsRule();
+ @Rule
+ public JenkinsRule rule = new JenkinsRule();
protected JenkinsRule j;
protected JenkinsRule.WebClient wc;
Nice find. Web client reuse seems sus and unnecessary, I'm looking into cleaning that up, hoping this goes away with that.
Making JenkinsRule
a @ClassRule
probably speeds tests up considerably, would need to look into whether that decision was documented.
Making
JenkinsRule
a@ClassRule
probably speeds tests up considerably, would need to look into whether that decision was documented.
Yeah, 3 sec ClassRule
, 11 sec Rule
nice build passes now, cheers Daniel
Big thanks both 🎉
lint is failing
Please take a moment and address the merge conflicts of your pull request. Thanks!
ATH passing - https://github.com/jenkinsci/acceptance-test-harness/pull/1557
Looks good now
Some minor thought:
- the navigation buttons are at the bottom. so when I want to look at later builds I need to scroll down first
Here a screenshot with some badges:
Badges can overflow the box:
May not be realistic but is it fixable without too much effort?
the navigation buttons are at the bottom. so when I want to look at later builds I need to scroll down first
Its normal for pagination to be at the bottom, I think this should be fine
I'm not able to reproduce the badge overflowing, but having many badges with icons from Badge plugin leads to the icons getting very small. Probably also an issue with the badge plugin itself. But ideally the badges would start flowing in the next row.
Seems with the refactoring of the badge plugin things do indeed overflow.