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

pass commit sha of the last update #258

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

passichenko
Copy link
Contributor

@passichenko passichenko commented Oct 3, 2023

Context

For observability purposes we need to have a way to reference a specific version of the config. For example for tracking rollouts or to see what value was used during debugging.
We already have sha field which is git-style sha of the content, but it's hard to lookup the config content using it (unless we build some additional tooling).
We also report commit_sha in many places, but it's global for the repo, so it will change if there are new commits even if those commits didn't modify the specific config that we are looking at.

Change

I propose to use sha of the last commit that modified the config as it's version. We already know it on rollout, we just need to store it and pass it around. The only issue is with local git mode as we'd need to use git log to get sha of the last update for every config. I think it should be fine, but worst case we can just not report it with local git setup.

@@ -77,6 +77,8 @@ message Feature {
// The sha of the protobuf binary according to git.
string sha = 2;
lekko.feature.v1beta1.Feature feature = 3;
// SHA of the last commit that modified the config
string last_update_commit_sha = 4;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm torn between naming it explicitly like that and naming it more generic like version so it's easier to change format later.

Copy link
Member

Choose a reason for hiding this comment

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

I think keeping the explicit name is better personally - for forward compatibility, we can follow protobuf best practices for marking deprecated, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants