Skip to content

Conversation

@mrnugget
Copy link
Contributor

@mrnugget mrnugget commented Apr 14, 2021

This is the first step towards cleaning up this code base a bit.

It extracts code into smaller sub-packages:

  • executor
  • mock
  • git
  • log
  • service
  • workspace

And it renames some of the types so they make more sense in this new structure: batches.ExecutorOpts to executor.Opts for example.

This doesn't magically fix problems, but it makes it easier to see where dependencies and strong coupling exists.

And it's only the first step: there's still a few TODOs that I added. Next I want to clear up the interplay between service and executor and the main package.

I opened this PR to make reviewing easier: it doesn't change behaviour but only renames and moves things

@mrnugget mrnugget requested a review from a team April 14, 2021 14:25
@mrnugget
Copy link
Contributor Author

Pushed another commit that creates the workspace package, which I think fits into the rest of these changes.

Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

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

Nice, thanks for doing this! Can't wait to see what this develops into.. 😬

@@ -0,0 +1 @@
package batches
Copy link
Member

Choose a reason for hiding this comment

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

is this file required for anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uhhh, no. Thanks!

Copy link
Contributor

@LawnGnome LawnGnome left a comment

Choose a reason for hiding this comment

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

This feels sensible to me. Let's get it in and see how it feels as we use it!

@mrnugget mrnugget merged commit b2105c9 into main Apr 15, 2021
@mrnugget mrnugget deleted the mrn/batches-package-structure branch April 15, 2021 12:02
mrnugget added a commit that referenced this pull request Apr 22, 2021
This is a follow-up to #511 and #512.

It cleans up the code that's shared between `batch apply` and `previe`
by trying to make the boundaries between the "TUI +
execution"-glue-code, the `service` pkg, the `executor` pkg and the
helpers clearer.

A lot of this is subjective, of course (what does "clearer" even mean,
man), but I think less duplication is Good and less cross-talk between a
trio of components too.
mrnugget added a commit that referenced this pull request Apr 22, 2021
This is a follow-up to #511 and #512.

It cleans up the code that's shared between `batch apply` and `previe`
by trying to make the boundaries between the "TUI +
execution"-glue-code, the `service` pkg, the `executor` pkg and the
helpers clearer.

A lot of this is subjective, of course (what does "clearer" even mean,
man), but I think less duplication is Good and less cross-talk between a
trio of components too.
mrnugget added a commit that referenced this pull request Apr 23, 2021
* Clean up shared code between `batch apply` and `preview`

This is a follow-up to #511 and #512.

It cleans up the code that's shared between `batch apply` and `previe`
by trying to make the boundaries between the "TUI +
execution"-glue-code, the `service` pkg, the `executor` pkg and the
helpers clearer.

A lot of this is subjective, of course (what does "clearer" even mean,
man), but I think less duplication is Good and less cross-talk between a
trio of components too.

* Remove commented out code

* Fix comment
scjohns pushed a commit that referenced this pull request Apr 24, 2023
* Create executor, git, service packages

* Rename Opts in executor

* Rename ServiceOpts

* Move LogManager to log package

* workspace pkg, unexport types and rename WorkspaceCreator to Creator

* Remove unused file
scjohns pushed a commit that referenced this pull request Apr 24, 2023
* Clean up shared code between `batch apply` and `preview`

This is a follow-up to #511 and #512.

It cleans up the code that's shared between `batch apply` and `previe`
by trying to make the boundaries between the "TUI +
execution"-glue-code, the `service` pkg, the `executor` pkg and the
helpers clearer.

A lot of this is subjective, of course (what does "clearer" even mean,
man), but I think less duplication is Good and less cross-talk between a
trio of components too.

* Remove commented out code

* Fix comment
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