Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

repo reorganisation #1510

Closed
Dieterbe opened this issue Oct 27, 2019 · 1 comment
Closed

repo reorganisation #1510

Dieterbe opened this issue Oct 27, 2019 · 1 comment
Labels

Comments

@Dieterbe
Copy link
Contributor

Dieterbe commented Oct 27, 2019

our repo layout is a bit of a mess. my main issues:

  1. hard to differentiate go packages from other dirs. e.g. conf is a go package whereas scripts/config is where config files live. it's confusing because almost all directories are go packages, but not all (e.g. docker, docs, devdocs, dashboards, etc)
  2. in the go community, any exported code is assumed to be reusable by anyone, anywhere. we don't have any stability guarantees at the exported golang api level. We have been exporting any code as soon as we need to access it from any other package (internal in the metrictank repo, or any of our other projects, e.g. github.com/raintank/tsdb-gw or github.com/graphite-ng/carbon-relay-ng), we probably even have exported code that doesn't need to be exported at all.
  3. in particular, we don't follow some common best practices:
  • we don't have an internal directory, which enables us to forbid any non-MT importing any of our code if it lives under this directory, even if it's exported. (personally i find it a bit too agressive, i rather just document we don't provide guarantees at the api level. also, implementing this, would probably cause breakage. e.g. in carbon-relay-ng or tsdbgw)
  • we don't have a pkg directory. this one seems a bit contentious:

I note that grafana/grafana, cortextproject/cortex and prometheus/prometheus have "pkg" dirs
prometheus has both a pkg directory but also a bunch of packages in the root directory (includirg exported stuff like in rules/alerting.go). not sure why.

My suggestion is:

  • we adopt "pkg" for all of our non-main packages (internal or otherwise). some people consider it deprecated but i think it would clarify our repo layout quite a bit.
  • we don't implement "internal" to keep our life simple
  • any further reorganization can be done in addition on a case by case basis, or as an additional step later, once we get this change through.

thoughts?

@stale
Copy link

stale bot commented Apr 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 4, 2020
@stale stale bot closed this as completed Apr 11, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant