Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show installation progress #3338

Merged
merged 12 commits into from
Sep 8, 2023
Merged

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Aug 30, 2023

What does this PR do?

This PR enhances elastic-agent install to show users the progress of the installation.

Before this PR

before.mov

After this PR

after.mov

Why is it important?

So users know installation is proceeding and not stalled.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

@ycombinator ycombinator added enhancement New feature or request Team:Elastic-Agent Label for the Agent team backport-skip labels Aug 30, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 30, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-09-07T21:38:00.579+0000

  • Duration: 29 min 49 sec

Test stats 🧪

Test Results
Failed 0
Passed 6277
Skipped 55
Total 6332

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 30, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.78% (81/82) 👍 0.015
Files 66.212% (194/293) 👎 -1.508
Classes 65.562% (356/543) 👎 -0.73
Methods 52.612% (1118/2125) 👎 -0.425
Lines 38.159% (12719/33332) 👎 -0.485
Conditionals 100.0% (0/0) 💚

@ycombinator ycombinator marked this pull request as ready for review August 30, 2023 21:37
@ycombinator ycombinator requested a review from a team as a code owner August 30, 2023 21:37
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@pierrehilbert
Copy link
Contributor

We discussed this on Monday, thanks I'm sure it will help users to see that something is happening there!

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Looks good. Simple design and easy to follow.

// Randomize interval between 65% and 250% of configured interval
// to make it look like the progress is non-linear. :)
floor := int64(math.Floor(float64(pt.tickInterval.Milliseconds()) * 0.65))
ceiling := int64(math.Floor(float64(pt.tickInterval.Milliseconds()) * 2.5))
Copy link
Contributor

Choose a reason for hiding this comment

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

Haha, I don't know if this is really needed but okay! Why not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This whole deal is just to show some random progress to make things appear more realistic ;)

@ycombinator
Copy link
Contributor Author

buildkite test this

Copy link
Member

@AndersonQ AndersonQ left a comment

Choose a reason for hiding this comment

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

A wee blocker, isn't the 1st test susceptible to flakiness?
Another thing, it won't work well with nested steps, right?


pt.Stop()

require.Equal(t, "step 1 starting... FAILED\n", string(w.buf))
Copy link
Member

Choose a reason for hiding this comment

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

[Blocker]
Isn't there a chance there will be more than 3 dots(...) when the assertion happens?
You didn't disable the randomised ticker intervals.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We shouldn't see more than three dots because the step starts (line 36) and immediately fails (line 37). Unlike some of the other tests in this PR, there is no delay (sleep) in between those two lines, so more dots will not be shown.

Copy link
Member

@AndersonQ AndersonQ left a comment

Choose a reason for hiding this comment

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

Please check my previous comment

@ycombinator
Copy link
Contributor Author

Another thing, it won't work well with nested steps, right?

Correct, if/when we have such steps or want to represent such steps in the progress, we'll need to enhance the ProgressTracker with a stack or something.

@ycombinator
Copy link
Contributor Author

/test

@elastic-sonarqube
Copy link

@pierrehilbert
Copy link
Contributor

Unrelated failures, I'm merging

@pierrehilbert pierrehilbert merged commit 68e5a19 into elastic:main Sep 8, 2023
20 of 24 checks passed
@ycombinator ycombinator deleted the install-progress branch September 11, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip enhancement New feature or request Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants