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

feat: use new version pkg #196

Merged
merged 6 commits into from
Oct 19, 2020
Merged

feat: use new version pkg #196

merged 6 commits into from
Oct 19, 2020

Conversation

jbrockopp
Copy link
Contributor

@jbrockopp jbrockopp commented Oct 16, 2020

Dependent on go-vela/types#112

Updating to the new go-vela/types/version package to improve the information provided surrounding the application.

If I compile the binary specifically for the OS on my workstation, I'm met with this from the --version flag:

$ release/vela-server --version
vela-server version v0.6.1

When I run make up locally, here is the output from http://localhost:8080/version:

{
  "canonical": "v0.6.1",
  "major": 0,
  "minor": 6,
  "patch": 1,
  "metadata": {
    "architecture": "amd64",
    "build_date": "2020-10-16T09:15:43Z",
    "compiler": "gc",
    "git_commit": "44c10cfa6b25f02721609cccd2fbcedea0109f7b",
    "go_version": "go1.15.2",
    "operating_system": "linux"
  }
}

NOTE: This also updates the GitHub Actions pipelines to use our make commands for building the binary.

@jbrockopp jbrockopp added enhancement Indicates an improvement to a feature feature Indicates a new feature labels Oct 16, 2020
@jbrockopp jbrockopp self-assigned this Oct 16, 2020
@codecov
Copy link

codecov bot commented Oct 16, 2020

Codecov Report

Merging #196 into master will decrease coverage by 0.37%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #196      +/-   ##
==========================================
- Coverage   89.33%   88.95%   -0.38%     
==========================================
  Files         108      108              
  Lines        2710     2708       -2     
==========================================
- Hits         2421     2409      -12     
- Misses        240      250      +10     
  Partials       49       49              
Impacted Files Coverage Δ
router/middleware/header.go 67.74% <0.00%> (-32.26%) ⬇️

@jbrockopp jbrockopp marked this pull request as ready for review October 19, 2020 12:37
@jbrockopp jbrockopp requested a review from a team as a code owner October 19, 2020 12:37
Comment on lines 70 to 74
if gin.Mode() == "debug" {
c.Request.Header.Set("X-Vela-Version", apiVersion.String())
c.Request.Header.Set("X-Vela-Version", v.Semantic())
} else { // in prod we don't want the build number metadata
apiVersion.Metadata = ""
c.Request.Header.Set("X-Vela-Version", apiVersion.String())
c.Request.Header.Set("X-Vela-Version", v.Semantic())
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need this if statement if we're returning the same thing?

Copy link
Contributor Author

@jbrockopp jbrockopp Oct 19, 2020

Choose a reason for hiding this comment

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

No, we don't need the if statement 👍

If you'd like I can comment out the if but I left it in favor of being explicit on how we could customize it in the future.

In short, my thought process was by leaving it there, if (or when) we want to look at customizing how that header is populated from the API when running in debug mode then the shell of the code is there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

k, not a big deal to leave it in 👍

Copy link
Contributor

@kneal kneal left a comment

Choose a reason for hiding this comment

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

LGTM 🐬

@kneal kneal merged commit 0192506 into master Oct 19, 2020
@kneal kneal deleted the feat/version branch October 19, 2020 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates an improvement to a feature feature Indicates a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants