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(helm): Use commandArgs for all command arguments and add dlv debug helm test #484

Merged
merged 4 commits into from
May 4, 2022

Conversation

mikesmithgh
Copy link
Collaborator

@mikesmithgh mikesmithgh commented Mar 25, 2022

Merge after PR: #483 is merged to master

@codecov
Copy link

codecov bot commented Mar 25, 2022

Codecov Report

Merging #484 (9be8f2b) into master (3658206) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #484   +/-   ##
=======================================
  Coverage   49.33%   49.33%           
=======================================
  Files          57       57           
  Lines        5021     5021           
=======================================
  Hits         2477     2477           
  Misses       2290     2290           
  Partials      254      254           
Flag Coverage Δ
integration 43.33% <ø> (+0.10%) ⬆️
unit 28.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3658206...9be8f2b. Read the comment docs.

@mikesmithgh mikesmithgh force-pushed the helm-values-command branch 3 times, most recently from 15e5176 to 97a459d Compare March 25, 2022 17:32
{{- if .Values.cacheFlushInterval -}}
- --cache-flush-interval={{.Values.cacheFlushInterval}}
{{ end -}}
# TODO: discuss, these args will always be passed causing dlv to fail.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: discuss, these args will always be passed causing dlv to fail.
I believe we should simpy use commandArgs and remove all these flags but this is a breaking change (leaning toward this option to simplify) or update the values such that they are optionally applied

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated this PR to consolidate all metacontroller cli args as commandArgs. This is a breaking change.

Dockerfile.debug Outdated
@@ -9,6 +9,7 @@ WORKDIR /go/src/metacontroller/
ENV ADDITIONAL_BUILD_ARGUMENTS='-gcflags="all=-N -l"'
RUN make install
RUN go get github.com/go-delve/delve/cmd/dlv
RUN go install github.com/go-delve/delve/cmd/dlv
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm I think line above is doing the same...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@grzesuav It looks like the functionality changed in go 1.18: https://tip.golang.org/doc/go1.18#modules

go get
go get no longer builds or installs packages in module-aware mode. go get is now dedicated to adjusting dependencies in go.mod. Effectively, the -d flag is always enabled. To install the latest version of an executable outside the context of the current module, use go install example.com/cmd@latest. Any version query may be used instead of latest. This form of go install was added in Go 1.16, so projects supporting older versions may need to provide install instructions for both go install and go get. go get now reports an error when used outside a module, since there is no go.mod file to update. In GOPATH mode (with GO111MODULE=off), go get still builds and installs packages, as before.

I was confused by this as well 😂 . I updated it just use the install command now.

@@ -127,15 +127,23 @@ jobs:
echo "::set-output name=changed::true"
fi

- name: Setup kind
- name: Build local debug image
Copy link
Contributor

Choose a reason for hiding this comment

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

why you would like to use debug image in testing ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For this test I want to cover two things.

  1. The helm chart can accept values to allow deploying the debug version of metacontroller
  2. Any helm chart or Dockerfile changes do not break the debug version of metacontroller

Basically, this is more a dev facing use case than user facing. Please let me know if this makes sense.

@mikesmithgh mikesmithgh force-pushed the helm-values-command branch from 97a459d to 65c0aa0 Compare April 10, 2022 00:18
@mikesmithgh mikesmithgh force-pushed the helm-values-command branch 4 times, most recently from 6040156 to 8f29fac Compare April 11, 2022 13:21
@mikesmithgh
Copy link
Collaborator Author

Note to self:

Use https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts to share docker image across jobs in workflow

Upload as tar
Download tar and docker load
Then kind load

Set small retention policy

@mikesmithgh mikesmithgh force-pushed the helm-values-command branch 4 times, most recently from 7e172c3 to 340b290 Compare April 12, 2022 12:35
@@ -2,6 +2,28 @@
name: Test / Release
on: [push, pull_request]
jobs:
dockerbuild:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This lets us build the docker image once and reference it in each kind version rather than rebuilding the docker image for every kind version.

@@ -4,7 +4,7 @@ rbac:
image:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed pdb-value.yaml as the test coverage for pdb is included in leader-election-values.yaml as well. (I'm not sure why github thinks this was a rename)

@mikesmithgh mikesmithgh marked this pull request as ready for review April 12, 2022 12:43
@mikesmithgh mikesmithgh force-pushed the helm-values-command branch from 340b290 to d34ce3c Compare April 12, 2022 12:45
@mikesmithgh mikesmithgh changed the title fix: Add dlv to debug dockerfile and expose command in helm chart BREAKING CHANGE: Use commandArgs and add dlv debug helm chart values.yaml Apr 12, 2022
@mikesmithgh mikesmithgh changed the title BREAKING CHANGE: Use commandArgs and add dlv debug helm chart values.yaml feat(helm): Use commandArgs for all command arguments and add dlv debug helm test Apr 12, 2022
@mikesmithgh
Copy link
Collaborator Author

Hi @grzesuav , this PR is ready for review. Please let me know your feedback. Also, this has a breaking change. I included the BREAKING CHANGE footer in the commit message so hopefully it versions properly (first time committing a breaking change with semantic release for me).

@mikesmithgh
Copy link
Collaborator Author

@grzesuav Also, I created #509 for flakiness in the decorator controller integration test.

Signed-off-by: Mike Smith <10135646+mjsmith1028@users.noreply.github.com>
Signed-off-by: Mike Smith <10135646+mjsmith1028@users.noreply.github.com>
Signed-off-by: Mike Smith <10135646+mjsmith1028@users.noreply.github.com>
BREAKING CHANGE: The following helm values are removed.
The equivalent command arguments can now be passed directly to the
`commandArgs` value.

- discoveryInterval
- cacheFlushInterval
- zap.logLevel
- zap.devel
- zap.encoder
- zap.stacktraceLevel

Signed-off-by: Mike Smith <10135646+mjsmith1028@users.noreply.github.com>
@mikesmithgh mikesmithgh force-pushed the helm-values-command branch from d34ce3c to 9be8f2b Compare May 3, 2022 13:27
@grzesuav grzesuav merged commit b78476e into metacontroller:master May 4, 2022
@grzesuav
Copy link
Contributor

grzesuav commented May 4, 2022

🎉 This PR is included in version 4.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants