Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

consolidate kibana api to internal project structure#992

Closed
adam-stokes wants to merge 1 commit intomasterfrom
feat-kibana-api
Closed

consolidate kibana api to internal project structure#992
adam-stokes wants to merge 1 commit intomasterfrom
feat-kibana-api

Conversation

@adam-stokes
Copy link
Copy Markdown
Contributor

@adam-stokes adam-stokes commented Apr 6, 2021

Add all relevant kibana api calls into the golang project standard of
internal/kibana.

Signed-off-by: Adam Stokes 51892+adam-stokes@users.noreply.github.com

What does this PR do?

This PR is the start of some refactoring to get the project in a more standardized layout. It adds all the related kibana api calls into internal/kibana and also has additional api calls added to abstract out more of the work that is being handled in the testsuites. Currently, this is only an additive PR to get the bits in place for a further refactor of the testsuites and cli.

Why is it important?

It is nice to have all the relevant api calls under a single location that is easily identifiable

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 run the Unit tests for the CLI, and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
    - [ ] I have noticed new Go dependencies (run make notice in the proper directory)

How to test this PR locally

Nothing to test at this moment as there are several subsequent PR's that will utilize this new api in the scenario testsuites

Related issues

Follow-ups

Once this PR is approved and merge I have several additional changes that make use of this code in the testsuites.

This is part of a larger refactor https://github.com/elastic/e2e-testing/compare/feat-kibana-refactor that gives a better idea of where these new additions will be utilized and which of the original code is moved/removed. Most of the code related to this PR lives in cli/services/kibana.go and additional code lives in e2e/_suites/fleet/fleet.go e2e/_suites/fleet/integrations.go. In the referenced feat-kibana-refactor branch you can get a better idea of how that looks and get a feel for the direction I am taking.

Move all relevant kibana api calls into the golang project standard of
`internal/kibana`.

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
@adam-stokes adam-stokes added the enhancement New feature or request label Apr 6, 2021
@adam-stokes adam-stokes requested a review from a team April 6, 2021 01:41
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 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

Expand to view the summary

Build stats

  • Build Cause: Pull request #992 opened

  • Start Time: 2021-04-06T01:42:07.910+0000

  • Duration: 5 min 22 sec

  • Commit: faf15d4

Test stats 🧪

Test Results
Failed 0
Passed 86
Skipped 0
Total 86

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 86
Skipped 0
Total 86

@cachedout
Copy link
Copy Markdown
Contributor

I'm a bit confused by the word "moving" in the description of this PR. I see files being added but nothing being moved or otherwise deleted. Is this PR purely additive or is it a refactor? Perhaps a description of where this code or logic is being moved from would make things more clear. Thanks!

@adam-stokes
Copy link
Copy Markdown
Contributor Author

I'm a bit confused by the word "moving" in the description of this PR. I see files being added but nothing being moved or otherwise deleted. Is this PR purely additive or is it a refactor? Perhaps a description of where this code or logic is being moved from would make things more clear. Thanks!

@cachedout Thanks! I updated the PR with some additional context, let me know if you have any questions

@mdelapenya
Copy link
Copy Markdown
Contributor

IIRC there are unit tests for the client. If possible please keep them (with updates) during the refactor

)

// UnEnrollAgent unenrolls agent from fleet
func (c *Client) UnEnrollAgent(hostname string, force bool) error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NIT: could you reorder the methods alphabetically when possible? That would help when searching through the file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that once this is done, we can merge this PR 😉

@adam-stokes
Copy link
Copy Markdown
Contributor Author

Will close this in favor of #1008

@adam-stokes adam-stokes mentioned this pull request Apr 19, 2021
10 tasks
@mdelapenya
Copy link
Copy Markdown
Contributor

Closing as per #992 (comment)

@mdelapenya mdelapenya closed this Apr 21, 2021
@adam-stokes adam-stokes deleted the feat-kibana-api branch September 22, 2021 19:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants