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

Emitting version metrics also adding a githook that runs a script the automatically updates the version unless the user manually skips #4994

Merged
merged 37 commits into from
Nov 2, 2022

Conversation

allenchen2244
Copy link
Contributor

@allenchen2244 allenchen2244 commented Sep 8, 2022

Adding version into the build_info metric gauge.

Played around with metrics on grafana should be able to add a graph in pretty easily once this is done.

Also added a script that updates a version number with a timestamp if there's no manual update the major or patch version.

Added a githook that ensures the user is aware that they're updating the version or skipping it entirely if it's something really small

@@ -52,6 +52,8 @@ var (

// goVersion is the current runtime version.
goVersion = runtime.Version()
// cadenceVersion is the current version of cadence
cadenceVersion = "0.25.x"
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a makefile step or some other test step to ensure this doesn't get out of sync with the tagged release? @Groxx does this seem insane?

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 think Stephen/Ender was saying that the tag version being the last and all the way to do it is to make sure we update the release steps to update this version with every branch since the version itself isn't accessible.

Copy link
Member

Choose a reason for hiding this comment

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

I mean something like make test also doing a grep for this value and ensuring it's not out of sync with the tag

Copy link
Member

Choose a reason for hiding this comment

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

late to the game, but:
unfortunately I don't think there's a way to automate this, short of automating releases entirely... which brings other major complications too. though we might do that eventually.

for environments that use go modules (i.e. not our internal monorepo, at least currently), we could pull this information from the module's build-time metadata, which is probably the best option. that's always up to date.

for non-module environments... dunno.

@coveralls
Copy link

coveralls commented Sep 28, 2022

Pull Request Test Coverage Report for Build 01843a8e-0849-4c88-849e-1f372e273338

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 128 unchanged lines in 18 files lost coverage.
  • Overall coverage decreased (-0.07%) to 57.28%

Files with Coverage Reduction New Missed Lines %
client/history/client.go 2 38.1%
client/history/metricClient.go 2 45.3%
common/membership/hashring.go 2 83.54%
common/persistence/executionManager.go 2 78.83%
common/task/fifoTaskScheduler.go 2 84.54%
service/history/handler.go 2 47.17%
common/persistence/serialization/parser.go 4 65.41%
common/persistence/serialization/thrift_decoder.go 4 61.22%
service/frontend/workflowHandler.go 4 59.98%
common/persistence/statsComputer.go 5 94.64%
Totals Coverage Status
Change from base Build 018439f9-7d82-4142-b1f9-aa629405d4a7: -0.07%
Covered Lines: 85177
Relevant Lines: 148702

💛 - Coveralls

@davidporter-id-au
Copy link
Member

davidporter-id-au commented Nov 2, 2022

Please update the commit summary to include:

The problem:

That figuring out what the open-source version is doing for emitted metrics is hard, and this is a change to expose the open-source version as a snapshot to logs, metrics etc. It'll help operationally to understand what's running where.

The solution

  1. The proposal you're putting here - tl;dr that we're adding a timestamp-based patch-version which is exposed at runtime which is hooked in to commits and bumped automatically (perhaps surprising)
  2. A callout that this requires git config core.hooksPath .githooks to manually be run

Potentially this will be annoying / not work for some build or pipeline or other edge-case that

@allenchen2244 allenchen2244 changed the title add version metric to buildinfo Emitting version metrics also adding a githook that runs a script the automatically updates the version unless the user manually skips Nov 2, 2022
@allenchen2244 allenchen2244 merged commit d6c48e9 into master Nov 2, 2022
@allenchen2244 allenchen2244 deleted the CDNC-2846 branch November 2, 2022 23:48
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.

4 participants