Commit Graph

22 Commits

Author SHA1 Message Date
Benjamin Schanzel 00d55851f9
Web UI: substring search for builds, buildsets
Allow to search for builds and buildsets using substrings of job_name,
project, branch, and pipeline.

This is the user-facing part of 908420.

Change-Id: If3c8b870a4f9feb8c50a19cda8115aef048f75b9
2024-03-19 09:41:35 +01:00
James E. Blair 4099919167 Use server-side filtering and pagination in config error page
This switches the config error page to use the new server-side
filtering and pagination support.  Note that we still fetch the
full set of config errors in order to display the bell icon.  That
will be updated in a future change.

Change-Id: I08a554c2a8151e24e5423608ef016f3273b3d663
2023-11-28 09:47:04 -08:00
Dong Zhang f848f251e4 Zuul-Web: Filter input validation for "Change"
User sometimes tends to copy the value from the "Change" column as a input
for filtering, which would cause a 500 error in API.

To fix this we do a input validation to indicate that the change must be
a integer for example a PR bumber. So that make it clear any other fomat
like a ref or a string with "," is not supported.

Change-Id: Ia25a60429acc48c5773c808be6a900ba9bdf608e
2023-03-15 09:08:35 +01:00
James E. Blair f9b0cca24d Fix skipped builds filter in web ui
The change to automatically filter out skipped builds inadvertently
affected the buildsets tab as well since they share the query builder.
This caused the buildsets tab to automatically append a filter which
is invalid for buildsets and therefore return a 404.

This change adds an argument to the query builder to indicate whether
it should include the automatic filter.

Additionally, the query builder had an error which caused it to
append the query in all cases (which affects the otherwise working
builds tab).  This change corrects that as well.

Change-Id: Id03eee51b3551c4b32ae3c6b784b0993c4a3779c
2022-11-01 14:43:36 -07:00
James E. Blair 370d36c025 Add MERGE_FAILURE buildset result
We now report a distinct buildset result to the database if the upstream code
review system is unable to merge a change.  Previously it was reported as
MERGE_CONFLICT which makes it difficult to distinguish from merge conflicts.

Essentially, the two states we're interested in are when Zuul's merger is
unable to prepare a git checkout of the change (99% of the time, this is
a merge conflict).  This is the MERGE_CONFLICT result.

The second state is when Zuul asks Gerrit/Github/etc to submit/merge a change
and the remote system is unable (or refuses) to do so.  This is MERGE_FAILURE.

Change-Id: I47af242aeb19ae4b4aedde353fcc76ff82d90fbe
2022-02-24 18:32:20 -08:00
James E. Blair e03d8c887c Rename MERGER_FAILURE to MERGE_CONFLICT
This is a prelude to a change which will report a distinct buildset result
to the database if the upstream code review system is unable to merge a change.
Currently it is reported as MERGER_FAILURE which makes it difficult to
distinguish from merge conflicts.

Essentially, the two states we're interested in are when Zuul's merger is
unable to prepare a git checkout of the change (99% of the time, this is
a merge conflict).  This will be known as MERGE_CONFLICT now.

The second state is when Zuul asks Gerrit/Github/etc to submit/merge a change
and the remote system is unable (or refuses) to do so.  In a future change,
that will be reported as MERGE_FAILURE.

To avoid confusion and use names which better reflect the situation, this change
performs the rename to MERGE_CONFLICT.

Because there are pipeline configuration options tied to the MERGER_FAILURE
status (which start with 'merge-failure') they are also renamed to 'merge-conflict'.
The old names are supported for backwards compatibility.

A SQL migration takes care of updating values in the database.

The upgrade procedure is noted as being special because of the db value updates.
If an operator doesn't follow the recommended procedure, however, the consequences
are minimal (builds which won't be easily queried in the web ui; that can be
manually corrected if desired).

A model API change is not needed since the only place where we receive this value
from ZK can be updated to accept both values.

Change-Id: I3050409ed68805c748efe7a176b9755fa281536f
2022-02-24 17:06:03 -08:00
Matthieu Huin 31b2c94412 [web] Pagination in builds, buildsets search
Paginate results when searching for builds or buildsets. Since we do not know how
many results a query may return, display "results X-Y of many" by
default. If the total amount of results can be computed, display it.

Change-Id: If2985d6bcb194e3b074a860dab8cd5958b2577ec
2021-12-01 21:42:12 +01:00
Matthieu Huin 7eff6490a4 Web UI: add checkbox, selects to filter toolbar
Support three new filter types: checkbox, select and ternary select.

The ternary select tool is meant to support fields that can be set to
True, False, or ignored.

Use this feature to allow filtering builds by held status (i.e. show
builds that triggered a autohold only) or by voting status (i.e. show only
voting jobs).

Selects let a user choose among predefined values. Use a select to help
a user choose a result value when searching builds and buildsets.

Build page: add a thumbtack icon next to a build's status badge if that
build triggered an autohold.

Change-Id: I40b06c83ed069e0756c7f8b00430d36a36230bfa
2021-09-09 19:13:55 +02:00
Felix Edel 58916e6cfe UI: Remove stretchable link from build and buildset table
Making the whole row table row clickable in these pages makes makes it
impossible to mark & copy any text from those rows.  Users have
expressed this is an annoyance worth fixing.

This change removes the stretchable link from the whole table row and
instead allows clicking on the job name or status icon to go to
details about the job.

We have added an optional link prop to title-with-icon; note this is
used in other contexts where it does not make sense to be a link thus
the optional implementation steps.  It is intentional that these links
retain their underline for discoverability.

For the mobile version (which renders the table as a nice card list), we
fall back to the "action column" solution which will be rendered nicely
as a button in the top right corner of each card. For larger screens we
hide this action column.

Note this change is a squash of several other changes to make a
consolidated review; for original details see:

 I788ea37b2ca1899d90160cc52761db0a77f78508
 Ifc54edf9ca348ada8e3bfd07fd135d22f9f08489
 Ifc54edf9ca348ada8e3bfd07fd135d22f9f08489
 Ib4c3a2159e7bad58fcc27eb3ba4b62926ce73099

Co-Authored-By: Ian Wienand <iwienand@redhat.com>
Change-Id: I276ff316b17aee932f2724f86e8f0eb1abe73c60
2021-02-04 14:30:16 +11:00
Felix Edel 28ecbf42be
PF4: Update builds and buildsets tables + use newest patternfly release
This updates the tables shown on the builds and buildsets pages with new
PF4 components. While the data is loading, a fetching animation is shown
and in case no results could be found the page shows an empty state.

Each table row is clickable and points to the build/buildset result page.
The table uses the same hover effect as the build list on the buildset
result page.

This change also updates the used @patternfly/react-core version to
match the current version of @patternfly/react-table [1]. Otherwise,
some of the styles in the different @patternfly/react-core versions
conflict with each other leading to wrong font-weights and wrong text
colors in labels.

[1] patternfly.org/v4/documentation/react/overview/release-notes#202010-release-notes-2020-08-17

Change-Id: I0f5e0815c53d18e8ae3570dc94594c77fecb90ce
2020-09-23 13:07:07 +02:00
Felix Edel fe877d6052
PF4: Update filter toolbar on builds and buildsets page
This updates the toolbar on the builds and buildsets pages with new PF4
components. The toolbar itself doesn't handle the state of the filters,
but it provides some methods to simplify the state handling in the
parent component. This is necessary, since the filters are also used in
other parts of the page and thus must be handled in the page component
itself.

Change-Id: Iec93c1be01ec1ac096e8d3dcfa501f3488f8a3bf
2020-09-23 13:05:05 +02:00
Felix Edel 65653bcd01
Introduce Patternfly 4
Since Patternfly 4 (PF4) is a complete rewrite of the framework that
doesn't require bootstrap and comes with a new npm package, it's
possible to include both side-by-side in a project.

This change includes the necessary PF4 packages and updates the header,
navbar, drawer (shows the config errors) and global page layout with PF4
components. Once this is done, we should be able to update the other
components step by step to PF4.

Points to keep in mind for the migration phase:
  1. Some Patternfly 3 CSS rules are overridden by Patternfly 4
     wildcards, mostly (re)setting the padding and margin of various
     elements to 0.

     To fix this unwanted behaviour, there is a pf4-migration.css file
     included were we can keep track on those rules and ensure that the
     old padding and margin values are re-applied after Patternfly 4 is
     imported.

Change-Id: I77b81fa0f97fe718207ba5a506cee300371c693b
2020-07-07 11:16:48 +02:00
Andy Ladjadj 86eba8b05d Add new timezone selector in web interface
- the default value keep UTC
 - the timezone is saved in cookie in zuul_timezone_string
 - the render format is YYYY-MM-DD HH:mm:ss

Change-Id: Ib4ac2af4194ac2722c5574577661f4ddda8cc398
2020-05-20 16:54:54 -05:00
Antoine Musso 448596cfe0 web: humanize time durations
At a lot of place, the duration for an item shows the raw value. It
lacks an indication of the unit (ms, s or minutes??) and is not very
human friendly. `480` is better understood as `8 minutes`.

The `moment-duration-format` package enhance moment duration objects to
ease formatting. It has better options than moment.duration.humanize(),
notably it does not truncate value and trim extra tokens when they are
not needed.
The package does not have any extra dependencies.

https://www.npmjs.com/package/moment-duration-format

Format duration on the pages build, buildset and on the build summary.

The Change panel had custom logic to workaround moment.duration.humanize
over rounding (so that 100 minutes became '1 hour'). The new package
does not have such behavior and offers tuning for all the features we
had:

* `largest: 2`, to only keep the two most significants token. 100
minutes and 30 seconds would thus render as '1 hour 40 minutes',
stripping the extra '30 seconds'.
* `minValue: 1`, based on the least significant token which is minute,
it means any value less than one minute is rendered as:
 < 1 minute
* `usePLural: false`, to disable pluralization since that was not
handled previously.

That reverts https://review.opendev.org/#/c/704191/

Make class="time" to not wrap, they would wrap on the Status page since
the box containing is not large enough.

In the Console, show the duration for each tasks, rounding to 1 second
resolution.  Would ease finding potential slowdown in a play execution.
The tasks do not have a duration property, use moment to compute it
based on start and end times.

Since hostname length might vary, the duration spans might be
misaligned. Use a flex to have them vertically aligned, credits to
mcoker@github:
https://github.com/patternfly/patternfly-react/issues/1393#issuecomment-515202640

Thanks to Tristan Cacqueray for the React guidances!

Change-Id: I955583713778911a8e50f08dc6d077594da4ae44
2020-02-04 13:23:38 +01:00
Stephen Finucane 87bd7b005b Fix typos
Copypasta, I imagine.

Change-Id: Id4aea2ea3111e2ee150334dfdeef6b7772b8e22d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-03-28 10:32:27 +00:00
Tristan Cacqueray 365ba836b8 web: fix ref column value for newrev
The substring call skipped the first character of newrevs. This
changes fixes the split using a correct substr.

Change-Id: I43c8ec2683fdf3da476531f54c30b2bd7742ec46
2018-11-28 13:48:14 +00:00
James E. Blair 6259418add Fix periodic job display in builds page
A recent change to the builds page handled pre- and post-merge
jobs but generates an error on periodic jobs, which have no
change and no newrev.  Handle that case as well by using the
branch as the change link.

Change-Id: Idc5da35612aacbb4eaab6f417b7cf4467812e6d4
2018-10-17 08:10:15 -07:00
James E. Blair 3dded2796a Simplify Builds page
Rather than showing the word "link" over and over in some columns,
hyperlink appropriate values instead.

Change -> change
Result -> build

Change-Id: I9fadb72a8b375631b24ea0cfcc17f6d54183a308
2018-10-16 13:48:59 -07:00
Tristan Cacqueray 99c38c9375 web: add build page
This change adds a /build/{build_uuid} web interface.

Depends-On: https://review.openstack.org/592225
Change-Id: I4c4b3dc028b7be9f11e959bfca37867eafa9ca3f
2018-10-11 02:57:52 +00:00
Tristan Cacqueray 68d1189871
Revert "Revert "web: rewrite interface in react""
This reverts commit 3dba813c64.

Change-Id: I233797a9b4e3485491c49675da2c2efbdba59449
2018-10-06 10:42:31 -05:00
James E. Blair 3dba813c64 Revert "web: rewrite interface in react"
Revert "Fix publish-openstack-javascript-content"

This reverts commit ca199eb9db.
This reverts commit 1082faae95.

This appears to remove the tarball publishing system that we rely on.

Change-Id: Id746fb826dfc01b157c5b772adc1d2991ddcd93a
2018-09-29 11:51:43 -07:00
Tristan Cacqueray 1082faae95 web: rewrite interface in react
This change rewrites the web interface using React:
http://lists.zuul-ci.org/pipermail/zuul-discuss/2018-August/000528.html

Depends-On: https://review.openstack.org/591964
Change-Id: Ic6c33102ac3da69ebd0b8e9c6c8b431d51f3cfd4
Co-Authored-By: Monty Taylor <mordred@inaugust.com>
Co-Authored-By: James E. Blair <jeblair@redhat.com>
2018-09-27 02:14:46 +00:00