Project

General

Profile

Actions

Bug #30210

closed

Task progress decimal precision discrepancy between UI, CLI, and API

Added by Ian Ballou almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1849680

Description of problem:
CLI displays whole number percentages when viewing the progress of a repository sync, while the API returns a 17 digit decimal. Both should match the format of the UI which is two decimals.

Version-Release number of selected component (if applicable):
3.16

How reproducible:
Always

Steps to Reproduce in CLI:
1) Sync a larger repository (so that the sync doesn't complete quickly)
2) SSH into the Katello server
3) Run: hammer task list
4) Copy ID of your repo syncing task
5) Run: hammer task progress --id=”paste ID of task”

Actual results:
Percentage displays as a whole number.

Expected results:
Percentage should display two decimals, like it does in the UI, in the format xx.xx%

Steps to Reproduce in API:
1) Sync a larger repository (so that the sync doesn't complete quickly)
2) In Postman:
a) GET https://foreman-hostname/foreman_tasks/api/tasks
b) Copy the id of the syncing repo task
c) GET https://foreman-hostname/foreman_tasks/api/tasks/pasted-id

Actual results:
Progress displays as a 17 digit decimal

Expected results:
Percentage should display two decimals, like it does in the UI, in the format xx.xx


Related issues 1 (0 open1 closed)

Has duplicate foreman-tasks - Bug #30221: Task progress API value only needs two decimal points.DuplicateActions
Actions #1

Updated by James Jeffers almost 4 years ago

  • Subject changed from Repository sync showing different percentages in CLI and API to Repository sync showing different percentages in CLI and API
  • Target version set to Katello 3.16.1
  • Triaged changed from No to Yes
Actions #2

Updated by James Jeffers almost 4 years ago

  • Target version changed from Katello 3.16.1 to Katello 3.16.0
Actions #3

Updated by Ian Ballou almost 4 years ago

Since getting floats into Hammer's PowerBar requires monkey-patching, we'll likely go the route of removing the decimal places from the UI. This could potentially be done by first changing the ForemanTasks API to return an integer out of 100 and then simply importing that value directly into the UI.

Actions #4

Updated by Ian Ballou almost 4 years ago

I've created a related bug for foreman-tasks. https://projects.theforeman.org/issues/30221. Instead of what I mentioned above, I think the API progress value should still be a value out of 1 to not break other projects that expect a fractional value.

Actions #5

Updated by Ian Ballou almost 4 years ago

  • Project changed from Katello to foreman-tasks
  • Category deleted (Repositories)
  • Target version deleted (Katello 3.16.0)
Actions #6

Updated by Ian Ballou almost 4 years ago

  • Subject changed from Repository sync showing different percentages in CLI and API to Task progress decimal precision discrepancy between UI, CLI, and API
Actions #7

Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ian Ballou
  • Pull request https://github.com/theforeman/foreman-tasks/pull/566 added
Actions #8

Updated by The Foreman Bot almost 4 years ago

  • Fixed in Releases foreman-tasks-2.0.2 added
Actions #9

Updated by Anonymous almost 4 years ago

  • Status changed from Ready For Testing to Closed
Actions #10

Updated by Adam Ruzicka about 3 years ago

  • Has duplicate Bug #30221: Task progress API value only needs two decimal points. added
Actions

Also available in: Atom PDF