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

Add type to represent a loaded configuration file #349

Merged
merged 2 commits into from
Mar 31, 2023
Merged

Conversation

pietern
Copy link
Contributor

@pietern pietern commented Mar 29, 2023

Changes

Export type for a loaded configuration file such that downstream applications can read its contents in the same way the SDK does. Rename the loader instance to ConfigFile to make it symmetric with ConfigAttributes.

Tests

This doesn't change functionality.

  • make test passing
  • make fmt applied
  • relevant integration tests applied

@pietern pietern requested a review from nfx March 29, 2023 11:09
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 90.00% and project coverage change: -0.01 ⚠️

Comparison is base (2f3f83a) 41.30% compared to head (f96e893) 41.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
- Coverage   41.30%   41.30%   -0.01%     
==========================================
  Files          49       49              
  Lines        2709     2736      +27     
==========================================
+ Hits         1119     1130      +11     
- Misses       1499     1515      +16     
  Partials       91       91              
Impacted Files Coverage Δ
config/config_file.go 80.48% <89.47%> (+4.17%) ⬆️
config/config.go 82.35% <100.00%> (ø)

... and 3 files with indirect coverage changes

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

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

// The function expands ~ to the user's home directory.
func LoadFile(path string) (*File, error) {
if path == "" {
path = "~/.databrickscfg"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment from @shreyas-goenka on another thread:

This not work for windows, can be added as a followup though

The permutation test shows that it does work, but I agree it looks weird.

Follow up: use filepath.Join here and check for prefix with os.PathSeparator.

Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

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

lgtm, as long as integration tests are passing

@pietern
Copy link
Contributor Author

pietern commented Mar 31, 2023

Integration tests all pass.

@pietern pietern merged commit 54d4222 into main Mar 31, 2023
@pietern pietern deleted the reusable-config-file branch March 31, 2023 12:14
@nfx nfx mentioned this pull request Apr 3, 2023
nfx added a commit that referenced this pull request Apr 3, 2023
# Version changelog

## 0.6.0

* Added type to represent a loaded configuration file
([#349](#349)).
* Added named `Wait` the level of services
([#348](#348)).
* Pass `azure_client_id` to Azure MSI if specified
([#354](#354)).

Dependency updates:
 
* Bump google.golang.org/api from 0.112.0 to 0.114.0
([#344](#344)).
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