Skip to content

refactor(snap): environment variable usage and const definitions#4207

Merged
farshidtz merged 3 commits intoedgexfoundry:mainfrom
farshidtz:snap-refactor-consts
Oct 25, 2022
Merged

refactor(snap): environment variable usage and const definitions#4207
farshidtz merged 3 commits intoedgexfoundry:mainfrom
farshidtz:snap-refactor-consts

Conversation

@farshidtz
Copy link
Copy Markdown
Member

@farshidtz farshidtz commented Oct 21, 2022

  • Switch to use the hooks/env package for snap envs
  • Move constants and lists specific to this snap from hooks library to this package
  • Refactor service lists to have consistent style

Signed-off-by: Farshid Tavakolizadeh farshid.tavakolizadeh@canonical.com

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

Mostly refactoring. The review could do a side-by-side diff comparison. The snap tests in this PR has good coverage for the affected code. To run the snap test on a pre-built snap locally, run the following from the top level directory of edgex-snap-testing repo:

$ SERVICE_CHANNEL=edge/pr-4207 FULL_CONFIG_TEST=true go test -p 1 --count=1 ./test/suites/edgexfoundry
ok      edgex-snap-testing/test/suites/edgexfoundry     438.634s

New Dependency Instructions (If applicable)

…itions

- Switch to use the hooks/env package for snap envs
- Move constants and lists specific to this snap from hooks library to this package
- Refactor service lists to have consistent style

Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
…d constants, fix list

Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
@farshidtz farshidtz marked this pull request as ready for review October 21, 2022 19:14
@farshidtz farshidtz requested a review from MonicaisHer October 21, 2022 19:14
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #4207 (055ab11) into main (5b680ce) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #4207   +/-   ##
=======================================
  Coverage   43.25%   43.25%           
=======================================
  Files         125      125           
  Lines       11098    11098           
=======================================
  Hits         4800     4800           
  Misses       5886     5886           
  Partials      412      412           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment thread snap/local/helper-go/const.go Outdated
Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
4.1% 4.1% Duplication

Copy link
Copy Markdown
Contributor

@MonicaisHer MonicaisHer left a comment

Choose a reason for hiding this comment

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

@farshidtz Thank you, looks good! I ran the edgexfoundry test with local build snap:

$ LOCAL_SNAP=edgexfoundry_2.3.0-dev.99_amd64.snap FULL_CONFIG_TEST=true go test -p 1 --count=1 ./test/suites/edgexfoundry
ok      edgex-snap-testing/test/suites/edgexfoundry     135.528s

@farshidtz farshidtz merged commit 87ac77f into edgexfoundry:main Oct 25, 2022
@farshidtz farshidtz deleted the snap-refactor-consts branch October 25, 2022 11:41
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