-
Notifications
You must be signed in to change notification settings - Fork 150
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
Define boundaries between Python modules #521
Labels
Comments
agateau-gg
added
status:confirmed
This issue has been reviewed and confirmed
type:techdebt
Fix non-optimal code
labels
May 5, 2023
This was referenced Aug 21, 2023
fbochu
added a commit
that referenced
this issue
Aug 22, 2023
This will allow to easily distinct between real commands and utils. And eventually to enforce more easily the independence of commands' code. refs: #521
fbochu
added a commit
that referenced
this issue
Aug 22, 2023
To enforce module boundaries, we need to move some config related function in the `core.config` module. refs #521
fbochu
added a commit
that referenced
this issue
Aug 22, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
Merged
fbochu
added a commit
that referenced
this issue
Aug 23, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
fbochu
added a commit
that referenced
this issue
Aug 23, 2023
This will allow to easily distinct between real commands and utils. And eventually to enforce more easily the independence of commands' code. refs: #521
fbochu
added a commit
that referenced
this issue
Aug 23, 2023
To enforce module boundaries, we need to move some config related function in the `core.config` module. refs #521
fbochu
added a commit
that referenced
this issue
Aug 23, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
fbochu
added a commit
that referenced
this issue
Aug 23, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
fbochu
added a commit
that referenced
this issue
Aug 23, 2023
This will allow to easily distinct between real commands and utils. And eventually to enforce more easily the independence of commands' code. refs: #521
fbochu
added a commit
that referenced
this issue
Aug 23, 2023
To enforce module boundaries, we need to move some config related function in the `core.config` module. refs #521
fbochu
added a commit
that referenced
this issue
Aug 23, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
This will allow to easily distinct between real commands and utils. And eventually to enforce more easily the independence of commands' code. refs: #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
This will allow to easily distinct between real commands and utils. And eventually to enforce more easily the independence of commands' code. refs: #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
To enforce module boundaries, we need to move some config related function in the `core.config` module. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
This will simplify our import linter rules and allow to debug ggshield more easily using a debugger. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
The list of extensions that are considered as binary files is not specific to ggshield and should be in the `utils` packages according to the new architecture. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
This function is a file related util. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
Ideally, click should only be used in the `cmd` layers and in `utils.click`. But for now, this would required too much work to do so. So we will just add it to the bottom layer to avoid that `utils` use it. refs #521
fbochu
added a commit
that referenced
this issue
Aug 24, 2023
Ideally, click should only be used in the `cmd` layers and in `utils.click`. But for now, this would required too much work to do so. So we will just add it to the bottom layer to avoid that `utils` use it. refs #521
Merged
amascia-gg
pushed a commit
that referenced
this issue
Sep 4, 2023
This will allow to easily distinct between real commands and utils. And eventually to enforce more easily the independence of commands' code. refs: #521
amascia-gg
pushed a commit
that referenced
this issue
Sep 4, 2023
To enforce module boundaries, we need to move some config related function in the `core.config` module. refs #521
amascia-gg
pushed a commit
that referenced
this issue
Sep 4, 2023
Import linter will allow us to maintain boundaries between our modules. This is the first version of the configuration that only configure boundaries between `cmd` and `verticals` modules and `core`, `utils` and `pygitguardian`. The `core` module configuration will be set afterward. refs #521
amascia-gg
pushed a commit
that referenced
this issue
Sep 4, 2023
This will simplify our import linter rules and allow to debug ggshield more easily using a debugger. refs #521
amascia-gg
pushed a commit
that referenced
this issue
Sep 4, 2023
The list of extensions that are considered as binary files is not specific to ggshield and should be in the `utils` packages according to the new architecture. refs #521
amascia-gg
pushed a commit
that referenced
this issue
Sep 4, 2023
This function is a file related util. refs #521
amascia-gg
pushed a commit
that referenced
this issue
Sep 4, 2023
Ideally, click should only be used in the `cmd` layers and in `utils.click`. But for now, this would required too much work to do so. So we will just add it to the bottom layer to avoid that `utils` use it. refs #521
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Goal
To help keeping the code-base manageable, we need clearer boundaries between the various Python modules inside GGShield.
The proposed architecture is the following:
A module from the command layer can only import code from its matching vertical layer (
cmd.iac
can import fromiac
but not fromsecret
orauth
). Modules from the command and vertical layers can import from any support layer modules.Current problems and steps to fix them
core.config.user_config
importsiac
to verify IaC policy syntaxcore.config.user_config
core.oauth
importsconfig
core.oauth
toauth
(new module)core.check_updates
importsconfig.utils
core.config.utils.*_yaml_dict()
functions fromcore.config.utils
to a newcore.yaml_utils
modulecore.client
importsconfig
core.client
tocore.config
Next steps
core.config
toconfig
The text was updated successfully, but these errors were encountered: