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

Adding version command support to DCE-CLI #68

Merged
merged 3 commits into from
Feb 6, 2020

Conversation

drmmarsunited
Copy link

Proposed changes

As described in issue #40, the current CLI does not support a command for observing version. In this change, code is introduced to allow for a version command to be run, that is based off of the current git tag.

Documentation for the new command was generated by Cobra as well. Happy to discuss a testing strategy for this command, if necessary, but I have not yet introduced one.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (changes to code, which do not change application behavior)

Checklist

  • I have filled out this PR template
  • I have read the CONTRIBUTING doc
  • I have added automated tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (README.md, inline comments, etc.)
  • I have updated the CHANGELOG.md under a ## next release, with a short summary of my changes

Modified the root command preRun and onInit files to skip credentials check and config file check, respectively, if the command name issued was `version`
Modified `Makefile` to support a `VERSION` variable that is evaluated from a shell command that retrieves the current tag being worked on, and stripping the leading `v` character
Modified Azure Pipelines config to support a `VERSION` variable that is evaluated from a shell command that retrieves the current tag being worked on, and stripping the leading `v` character.  The variable is then accessible in all downstream steps

Signed-off-by: Mitch Robins <mtchelr@amazon.com>
Updated CHANGELOG with minor rev
Resynchronized dependencies

Signed-off-by: Mitch Robins <mtchelr@amazon.com>
@joshmarsh
Copy link
Contributor

Thanks @drmmarsunited , this is great! I'm going through your PR now.

@@ -431,6 +431,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nicksnyder/go-i18n v2.0.3+incompatible h1:XCCaWsCoy4KlWkhOr+63dkv6oJmitJ573uJqDBAiFiQ=
Copy link
Contributor

Choose a reason for hiding this comment

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

@drmmarsunited do you know where this sum came from. We are trying to track it down and can't figure it out. The go.mod just has package removals and comment changes to the /indirect which doesn't seem like it should add something.

Copy link
Author

Choose a reason for hiding this comment

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

No, I saw that as well. I didn't do anything special to pull in the code, just ran a go get. I can try to refork and do it from scratch and see if it comes up again?

Copy link
Contributor

Choose a reason for hiding this comment

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

we are trying a few things here too but haven't been able to track it down.

Copy link
Author

Choose a reason for hiding this comment

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

Let me try cloning to a whole new directory and populating the modules. I'll let you know if I see the sum change or not.

Copy link
Author

Choose a reason for hiding this comment

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

@kddejong So if I clone the master branch of my fork (which is unchanged from upstream), and I run go get in the newly cloned folder, the sum changes with this same line.

Adding `-ldflags` to Go build commands (because I'm an idiot)

Signed-off-by: Mitch Robins <mtchelr@amazon.com>
@kddejong kddejong merged commit 03410a9 into Optum:master Feb 6, 2020
@drmmarsunited drmmarsunited deleted the feature/add_version_command branch February 6, 2020 16:43
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.

3 participants