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

Port to clio #53

Merged
merged 18 commits into from
Jun 30, 2023
Merged

Port to clio #53

merged 18 commits into from
Jun 30, 2023

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented May 18, 2023

This PR replaces what common patterns have already been established and hoisted into clio and bubbly. See DEVELOPING.md additions made in this PR for more details on the package layout.

At a high-level, here are the changes:

  • Removes the application object, eventloop, logger UI, config loading, version command, flag binding with viper, and profiling concerns (replaced by clio)
  • Removes bubbletea components (replaced by bubbly)

High level focuses of this PR:

  • lean into stronger separation of concerns and make it more difficult to accidentally misuse elements in the wrong package (e.g. by pushing internal packages lower in the API when possible)
  • focus on CLI-lib and core-lib divisions and usage
  • foster re-use of common patterns across applications when warranted

Detailed changes:

  • removed CLI interaction from the core lib (load.P12 -> loadP12Interactively) as this is a CLI concern.
  • splits the UI (an internal concern) and the handling of UI events into bubbletea models (a CLI lib concern). This allows for shared UI interactions for lib users of quill in the same way that grype uses syft UI elements in the grype UI. (see cmd/quill/cli/ui/handler.go and cmd/quill/internal/ui/ui.go)
  • version extracted from the build derived from ldflags is a main package-only concern, thus, this information is injected downstream from main instead of pulling from a package in static-fashion (see cmd/quill/main.go). Why? because this can only be valid when the build is controlled since specific ldflags are required.
  • replaced the log redactor with the common go-logger log redactor
  • the event child packages have been combined into the event package. Why? This separation seemed weak, where the original reason was to separate the definitions of events from the capabilities, however, this does not apply to these monitor/parser objects.

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
kzantow and others added 8 commits May 25, 2023 15:08
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman wagoodman requested a review from a team May 31, 2023 20:49
@wagoodman wagoodman marked this pull request as ready for review May 31, 2023 20:49
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit f41308e into main Jun 30, 2023
6 checks passed
@wagoodman wagoodman deleted the port-to-clio branch June 30, 2023 20:09
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.

3 participants