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

misc: move all importable code to internal/ #6552

Merged
merged 31 commits into from
Feb 29, 2024

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Feb 28, 2024

Our backwards compatibility guarantees cover importable Go code. This applies once we cut the 1.0 release, which we are rapidly approaching.

The Grafana Agent maintainers have agreed that it is more important for 1.0 to focus on stability of the configuration file and usage of the Grafana Agent binaries rather than on the stability of importable code.

This PR moves all importable Go code to internal/ so that it is no longer externally importable. This gives us time to finalize Go APIs without blocking the 1.0 release or removing our commitment to having Go APIs follow semantic versioning. Some time after the 1.0 release, we will have public Go APIs available for consumption.

There are some slightly odd artifacts in this PR for the purposes of making sure we have no public Go API surface:

  • Non-binary tools have been moved to internal/tools:
    • Code for generating documentation has been moved to internal/tools/docs_generator.
    • Code for integration testing system packages has been moved to internal/tools/packaging_test.
  • Binaries (i.e., package main) not a part of our release assets have similarly moved to internal/cmd:
    • Code for integration testing Flow components has been moved to internal/cmd/integration-tests
    • Code for linting the codebase has been moved to internal/cmd/agentlint
    • Code for evaluating River files has been moved to internal/cmd/rivereval
  • All flow mode UI code has been moved from web to internal/web.

I don't know if all of these changes are necessary, or if they have been moved to a sensible location. However, for the scope of this PR, I would like to keep the folders in their new location, and follow-up PRs and discussions can be used to reorganize internal/ as needed.

Copy link
Member

@tpaschalis tpaschalis left a comment

Choose a reason for hiding this comment

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

📪 ▶️

@rfratto rfratto merged commit 0e36aa2 into grafana:main Feb 29, 2024
10 checks passed
@rfratto rfratto deleted the move-code-to-internal branch February 29, 2024 16:56
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Mar 31, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants