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

Optserv 582 implement fsoc support for events recommendations #176

Conversation

linkous8
Copy link
Contributor

@linkous8 linkous8 commented Aug 1, 2023

Description

Implementation for new commands fsoc optimize events and fsoc optimize recommendations.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

* example text added
* Fix LIMIT->LIMITS uql syntax
* Handle count larger than uql max page size
* Skip pagination when count specified
* Fix infinite loop due to redeclaring variable inside while loop
- added nil pointer check in extractEventsData to prevent panics
Limits string
}

var eventsTemplate = template.Must(template.New("").Parse(`
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK results are not guaranteed to be ordered, you can add this to force an order (important when you also have a limit):

ORDER
   events.desc() 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ended up having to use events.asc() for the ordering so that the latest events would show up at the bottom of the list which I find to be more readable and also important for the --follow implementation.

However this creates a complication with the --count parameter in that it no longer gets the latest n events. Instead it gets the first n events to occur after the SINCE boundary. Ultimately I think I will need to propose an update to output.go to allow reversing the order of the table being printed but want to get events merged in as is for now.

@codecov-commenter
Copy link

Codecov Report

Merging #176 (e4b863d) into main (2adf4de) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main     #176   +/-   ##
=======================================
  Coverage   31.66%   31.66%           
=======================================
  Files          28       28           
  Lines        3644     3644           
=======================================
  Hits         1154     1154           
  Misses       2399     2399           
  Partials       91       91           

@pnickolov pnickolov merged commit 36d95cf into cisco-open:main Aug 7, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants