Commit Graph

24 Commits

Author SHA1 Message Date
James E. Blair 4a7e86f7f6 Update web ui for dependency refactor
This updates the web ui to handle multiple changes per item.  It
is compatible with the current data output as well as the upcoming
API.

Change-Id: I536967e51b22b60c8ff7baa46b902a36d1ea44dd
2024-02-05 15:38:59 -08:00
Jeremy Stanley 29abf0ff0c Use moment-timezone for moment's tz method
After updating to the latest version of moment, many pages in the
Zuul web dashboard are observed to raise a TypeError about
"ne.utc(...).tz is not a function" which seems to correspond to the
recent moment library update in change
Id9d0cdec6d6a39542e8248c8690d8a94018296b5. Apparently, use of tz
needs explicit importing of moment from the separate moment-timezone
library, so the prior working state of these scripts likely had
something to do with global state and import order.

The moment-timezone library does not provide a duration method, so
use the plain moment library for that.

Change-Id: Ib75eb65cc29261f010df8c9ab8c15d6491205079
Co-Authored-By: James E. Blair <jim@acmegating.com>
2023-11-27 07:17:23 -08:00
James E. Blair beb4f97c13 Conditionally add index.html to the "view log" link
If the site has configured zuul manifest generation with
"index_links" set to true, they have indicated that the zuul web
ui needs to append "index.html" to all of the directory entries
listed in the zuul manifest when generating the "Logs" tab.

The same is almost certainly true for the raw link to the log
location (appearing as "View log" in the summary area), so once
we retrieve the manifest, if index_links is set there, then
set the "View log" link to also include an index.html.

If the manifest is missing, then we will fall back to returning
just the raw URL (and seeing the actual URL returned to Zuul may
be preferable when debugging log failures anyway). For most users,
most of the time, this should produce a reasonable "View log" link.

Change-Id: Ia63943742a7a20bbf271a4de692dd41f2fe0016d
2023-10-24 13:32:37 -07:00
Ian Wienand 50b6bf0570
web: build/autohold: fix props input
I am currently getting the below error in my console about the type
passed to AutoholdModal.  Convert the change to a string.

Warning: Failed prop type: Invalid prop `change` of type `number` \
  supplied to `AutoholdModal`, expected `string`.
    in AutoholdModal (created by ConnectFunction)
    in ConnectFunction (at Build.jsx:273)
    in Build (created by ConnectFunction)
    in ConnectFunction (at Build.jsx:254)
    in section (created by PageSection)
    < .. and so on ..>

Change-Id: I9c9a5edfa18f0344ac4a50c62c798a5d4e404c18
2022-09-13 11:24:58 +10:00
Matthieu Huin 41d6008a3d Web UI: Add "Create Autohold Request" form, improve API error messages
Add a "create autohold request" button on the autoholds page for admin
users.
Refactor autohold form modal so that it can be reused in autoholds and
build pages.
Improve error messages when using admin actions: if the API call returns
an error description, display it in the toast. Otherwise return the HTTP
error code.

Change-Id: I9d1cc8a1d751e7b4ce32e7abecc2ad9f3e96f676
2021-11-23 11:36:57 +00:00
Matthieu Huin 491cf439fa Web UI: add Autoholds, Autohold page
A user can list active autoholds for a given tenant. If the user is a
tenant admin, she can also discard a autohold request from the autoholds
page.
Add a autohold page holding information about a single autohold request,
in particular links to held builds if any.

Change-Id: I4f5f2cfdf8e46ce8fb7ac69e330d6e51bd8b19fe
2021-11-18 16:41:23 +00:00
Matthieu Huin 84ae08fb39 Web UI: allow a privileged user to request autohold
Add a "autohold" command on a build page, displayed only if the currently
logged in user is an admin on the tenant. By clicking the command, the
user can display a form and set custom parameters for an autohold
request.

Change-Id: I0f9f069d4ad36d4961eb6925146f67fe4910cb2e
2021-11-18 16:41:06 +00: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 f61da0a5e4
UI: Remove refresh button from build and buildset page
Both the build and buildset doesn't change once stored in the SQL
database. Thus, clicking on the refresh button just reloads the same
information again which doesn't make much sense IMHO.

Since there is no other information on the build that would change over
time, simply remove the refresh button.

Change-Id: I3fccea38824cc4ffbda9d8619f548878b0a60542
2020-11-04 09:19:07 +01:00
Clark Boylan f15c357f6e Render links for ref_url if build.change isnt' set
The web ui would only properly render ref_url links if build.change was
set. Set up conditions to check if build.change is set and fallback to
the build.newrev value if not. This way we render a clickable link using
the commit sha1.

Change-Id: I5eb9cb1c7cc0f64d6d7504347c01a6450ffb1507
2020-09-26 15:52:36 -07:00
Felix Edel 23e2d6a13a
Revert "Revert PF4 build page"
The original change was reverted to fix a scrolling bug that was introduced by a different change. Using this commit in combination with [1] should restore the old behaviour.

Applying [2] on top of them should finally get rid of the scrolling issues.

[1]: https://review.opendev.org/#/c/750361/
[2]: https://review.opendev.org/#/c/750322/

This reverts commit b4b5b9fd58.

Change-Id: Icd498314762a8edca751413b7ee07b9b72317c5b
2020-09-14 14:47:49 +02:00
James E. Blair b4b5b9fd58 Revert PF4 build page
This reverts commits:

 04fa7c4989
 35572d2057
 7d78448ec5

Long log lines cause the tabs to be wider than the browser window
which make them virtually inacessible.  Revert this change until
we work out how to handle that.

Change-Id: I22fd8ef859b7ef3af4fadc95074fbceb30fae9a2
Story: 2008096
2020-08-31 11:45:25 -07:00
Felix Edel 35572d2057
UI: Show Ref on build(set) result page if no branch is set
When a build was triggered by a tag (e.g. release pipeline) the branch
field is not set. To avoid showing an empty branch value, we could fall
back to the ref value instead.

Change-Id: Ic73f942ef34cf5b3d66e90197b53a9d42698de50
2020-08-21 10:55:05 +02:00
Felix Edel 7d78448ec5
PF4: Update build result page layout
Following up on the patterns used for the buildset result page this now
updates the layout of the build result page in the same manner.

The "Summary" part is now always shown above the tabs (Logs, Console,
...) and the first tab is split into two (Results and Artifacts).

The contents of the Logs and Console tabs are unchanged.

Change-Id: If04b65596f189c343cda05a4a8fb3e1b740a0be2
2020-07-16 08:43:14 +02:00
Felix Edel 8fec6cc703
Consolidate summary, logs and console on a single build page
So far, these three tabs were split up in three different Pages to allow
each page being reachable via a different URL (rather than a #<tab>
anchor which is usually used for tabs). This makes changing the builds
page much more difficult as we have keep all three files in sync.

React-router allows a Route to pass custom props to the component that
is rendered when the Route matches a certain URL. We can use this
functionality to provide the active tab via a property for each route
using to the BuildPage component.

This change keeps the way the tabs are working, but maps all three URLs
to a single component with different props to show the activate tab.

Change-Id: Icb5729d759bafdfc396ea3642c8c6c71b3461d00
2020-07-15 09:06:04 +02:00
Sorin Sbarnea 986a32e449 Reduce table nesting on build pages
Replace top level panel with a simple div in order to avoid an entire
extra box nesting level, one that does not add any visual help.

Nesting is useful when you display more than one element, but in our
case we never display more than one build result.

This change alone saves some precious horizontal space, so embedded
text is less likely required to wrap.

Change-Id: I76e7e7adfd27bd2eadbfe187f40b35d728ff0145
2020-07-07 08:49:54 +01:00
James E. Blair 53df072eb0 Refactor build page tabs
Instead of having a single page with tabs selected by the URL
hash (eg "uuid#console"), make each "tab" its own page routed with
the URL path (eg "uuid/console").  The "tabs" look and behave the
same, but the change in URL format will allow us to later use
the hash for items on the pages themselves.  For example, we
may be able to deep-link to a task in the console log using the
hash.

This refactoring should also make it easier for us to rearrange
these components in the future.

Change-Id: Ib8174d9b39be3c63ef63cbcbf8682c195ac80c91
2019-08-07 18:37:12 -07:00
James E. Blair c035bc69ba Render console in js
This uses ListView to render the build console log in an
interactive manner.

Change-Id: Ib81a23cd60b515b1448f48c6c359d8f828fa4ec7
2019-08-07 08:50:36 -07:00
James E. Blair 5fa7a624e3 Remember tab location on build page
Use the location hash so that users can deep-link to a tab as well.

Change-Id: If09b264dd47a35bccdaaa7809546f95bef56eced
2019-07-25 15:28:46 -07:00
James E. Blair a550c92d5a Move artifacts to their own section
This makes them a little easier to pick out (which will be important
when we start using them to highlight preview builds, etc.).

Also, use a TreeView so that the metadata are hidden by default.

Change-Id: I64187af98b4c2cb3624cb20f9b622780e16b963c
2019-07-24 09:25:26 -07:00
James E. Blair 8fdc387c83 Add log browsing to build page
This looks for a zuul_manifest artifact, and if it is present,
it fetches it and shows a tree view of logs.  Text logs are
displayed in-app with some basic line anchoring.

Part of the implementation of
https://zuul-ci.org/docs/zuul/developer/specs/logs.html

es6 added to .eslint to allow use of Promise.

Change-Id: Ib04d013b4118005ba66a91d2bec0b0c429d12863
2019-07-24 09:25:13 -07:00
James E. Blair d48c2b82fc Display artifacts in build page
Test URLs:

http://zuul.opendev.org/t/zuul/build/61d5e9672c794317900634bdcf33abbf
http://zuul.opendev.org/t/zuul/build/259ebb4b80cb445bb1af71af19d35f7f

Change-Id: I58162bb250c836a3e8cbaaf75fe99350f53ef934
2019-07-19 16:00:34 -07:00
Tristan Cacqueray 2f8a1be7c9 web: add errors from the job-output to the build page
This change updates the build page to fetch the job-output.json file
and display the failed tasks. Logserver needs to enables CORS
header for the zuul-web service.

Change-Id: Ied9d1bb6489f608bc5402a98c8ae3a24b37b91e2
2018-12-14 08:33:48 +00:00
Tristan Cacqueray ed1d588785 web: refactor build page using a container
This change updates the build page component to use a container
for build information rendering. This enable decoupling the network
logic from the actual rendering.

Change-Id: I8c7c03b5efa80ea884249ffdee31c7819a336bfc
2018-12-14 08:33:48 +00:00