Skip to content

Display information based off the previous run#626

Merged
timja merged 38 commits intojenkinsci:mainfrom
lewisbirks:complete-percentage
Apr 18, 2025
Merged

Display information based off the previous run#626
timja merged 38 commits intojenkinsci:mainfrom
lewisbirks:complete-percentage

Conversation

@lewisbirks
Copy link
Contributor

@lewisbirks lewisbirks commented Apr 15, 2025

image

This PR revamps the graph view to:

  • Show a skeleton of the last run, inspired by Stage View, this reduces how jarring the graph moving on node addition can be, and also improves predicability of whats coming next
  • Display an estimation of how long left is on the run
  • Adds playful animations between states

We'd like to extend this to the console view eventually - but that'll require more work in an already big PR

Testing done

  • Skeleton appears when a run has a prior run
  • Doesn't when it doesn't
  • Estimations appear as expected
  • Icons animate nicely between states

Fixes #619

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@janfaracik
Copy link
Member

Added a very rough progress ring icon - will refine later.

image

janfaracik and others added 26 commits April 15, 2025 20:42
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
@lewisbirks lewisbirks changed the title Calculate the percentage complete based off the previous run Display information based off the previous run Apr 17, 2025
@janfaracik janfaracik added the enhancement New feature or request label Apr 17, 2025
@janfaracik janfaracik marked this pull request as ready for review April 17, 2025 13:38
@janfaracik janfaracik requested a review from a team as a code owner April 17, 2025 13:38
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

Some minor feedback, looks great though

);
};

const onPipelineComplete = () => undefined;
Copy link
Member

Choose a reason for hiding this comment

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

this could be defined before the if statement so you don't repeat it on L#57

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense for now as they are the same, eventually they might differ, but we can deal with that then

const ONE_MONTH_MS: number = 30 * ONE_DAY_MS;
const ONE_YEAR_MS: number = 365 * ONE_DAY_MS;

// TODO: 16/04/2025 How to support i18n like the methods this was copied from
Copy link
Member

Choose a reason for hiding this comment

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

does this need resolving (or a follow up)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still thinking how to do this, potentially a follow up unless you have any ideas. though this PR is getting rather large

Copy link
Member

Choose a reason for hiding this comment

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

There's this function: https://github.com/jenkinsci/jenkins/blob/4d2698f254b039bedd7b8f5af89e0c25b3b88b1e/src/main/js/util/i18n.js#L1

I've never used it but I think it was introduced for the setup wizard.

The normal pattern that a bunch of places use is to copy the messages from java / jelly using data- attributes on an element and then JavaScript just reading the data attributes.

Copy link
Member

Choose a reason for hiding this comment

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

Follow up would be fine if we create an issue

lewisbirks and others added 5 commits April 17, 2025 16:18
Define complete action once
Use braces on throws

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
@timja
Copy link
Member

timja commented Apr 18, 2025

good to go @janfaracik?

@janfaracik
Copy link
Member

Just fixing a small animation issue, will be good once thats fixed

@janfaracik
Copy link
Member

Good to go 🚀

@timja timja merged commit 5dcb592 into jenkinsci:main Apr 18, 2025
17 checks passed
@janfaracik janfaracik mentioned this pull request Apr 19, 2025
6 tasks
lewisbirks added a commit to lewisbirks/pipeline-graph-view-plugin that referenced this pull request Apr 19, 2025
* Calculate the percentage complete based off the previous run

* Add very rough progress ring icon

* Add animations for icons

* Init

* Move the timing string generation to the frontend

* Rough skeletons

* Spooky scary skeletons

* Align makeTimeSpanString with what is in core

* Mostly remove completePercent from the API (defaults to 0)

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Tidy

* Update status-icon.tsx

* Cleanup

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Restore match

* Estimate stage completion percentage

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Linting

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Pull out API polling

* Tidy up

* Update merger.spec.ts

* Timings -> timings + tsx -> ts

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Tidy up

* Undo unneeded java changes

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Pull URL from element

* More reversions

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Update nodes.tsx

* Rename stuff

* Move files

* Add test for run-estimator

* Trigger Build

* Rename complete

* Update ConsoleLogCard.spec.tsx

* Populate map at initialisation
Define complete action once
Use braces on throws

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Add click state to status symbols

* Add guard for previous build url

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>

* Drop skeletons if stages differ, simplify

* Fix animation when switching between clickable and not clickable

---------

Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Co-authored-by: Jan Faracik <43062514+janfaracik@users.noreply.github.com>
@timja timja linked an issue Apr 22, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement 'completePercent' Full graph is not rendered when first stage is running

3 participants