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

Investigate replacement for GetCallerProject #220

Open
masnax opened this issue Aug 2, 2024 · 0 comments
Open

Investigate replacement for GetCallerProject #220

masnax opened this issue Aug 2, 2024 · 0 comments
Labels
improvement Improve to current situation Jira Triggers the synchronization of a GitHub issue in Jira

Comments

@masnax
Copy link
Contributor

masnax commented Aug 2, 2024

microcluster expects some prepared statements to be defined and run on initial start with
RegisterStmt. Projects that import microcluster are also expected to have these calls.

In order to determine which statement fits with which project, we attempt to determine the caller package of RegisterStmt. It is usually one of:

  • /root/parts/{project}/build when built with snapcraft
  • $GOPATH/src/github.com/{account}/{project} for a local build
  • $GOPATH/pkg/mod/github.com/{account}/{project}/{version} when called from an imported package.

We want to register all statements from the current project and microcluster, but ignore all other imported projects as we won't have their schema.

Currently, we do this by parsing the project name out of the above paths, and only using microcluster and the current project. But there may be a cleaner way to handle this.

@roosterfish roosterfish added Jira Triggers the synchronization of a GitHub issue in Jira improvement Improve to current situation labels Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improve to current situation Jira Triggers the synchronization of a GitHub issue in Jira
Projects
None yet
Development

No branches or pull requests

2 participants