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

Move sync behaviour from common to own package #294

Merged
merged 1 commit into from Jun 4, 2021

Conversation

Integralist
Copy link
Collaborator

Problem: I'm increasingly stumbling into issues with the common package being too broad/generic. This materialises as an "import cycle error". It is also considered bad practice to have folders named common or utils etc.
Solution: Move these behaviours into their own packages.
Example: I would like to add a remediation error type to some code in our config package. This isn't possible because importing the errors package will import text which will import common and the common package has already been imported earlier in the import cycle:

package github.com/fastly/cli/cmd/fastly
        imports github.com/fastly/cli/pkg/app
        imports github.com/fastly/cli/pkg/backend
        imports github.com/fastly/cli/pkg/common << command stuff like: Base/Register/StreamingExec + lots more other misc stuff.
        imports github.com/fastly/cli/pkg/config
        imports github.com/fastly/cli/pkg/errors
        imports github.com/fastly/cli/pkg/text
        imports github.com/fastly/cli/pkg/common: import cycle not allowed

@Integralist Integralist added the enhancement New feature or request label Jun 3, 2021
@Integralist Integralist force-pushed the integralist/move-sync-from-common branch from 9666b74 to a552089 Compare June 3, 2021 16:58
Copy link
Member

@fgsch fgsch left a comment

Choose a reason for hiding this comment

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

👍

@Integralist Integralist force-pushed the integralist/move-sync-from-common branch from a552089 to 117cf22 Compare June 4, 2021 09:34
@Integralist Integralist merged commit 27f6028 into main Jun 4, 2021
@Integralist Integralist deleted the integralist/move-sync-from-common branch June 4, 2021 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants