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

Refactors config files #720

Merged
merged 17 commits into from Apr 25, 2022
Merged

Refactors config files #720

merged 17 commits into from Apr 25, 2022

Conversation

edublancas
Copy link
Contributor

I refactored the logic to store and retrieve the data from the config files. This is a pre-requisite to start working on the improved onboarding workflow where we have a "tutorial" to point to the user what do to next since we need to add a few extra flags to the config files to track the state.

The tests remain unchanged (I only modified a few and deleted some that are outdated)

@edublancas edublancas requested a review from idomic April 18, 2022 21:04
@edublancas
Copy link
Contributor Author

can you review this @idomic ?



class Config(abc.ABC):
"""And abstract class to create configuration files (stored as YAML)
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

return Path(check_dir_exist(CONF_DIR), DEFAULT_USER_CONF)


class Internal(Config):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe call it ploomber settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to be more explicit that these are for internal use and others are for users.

Copy link
Contributor

@idomic idomic left a comment

Choose a reason for hiding this comment

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

Looks good besides comments

assert telemetry.check_first_time_usage()
assert not telemetry.check_first_time_usage()

Copy link
Contributor

Choose a reason for hiding this comment

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

How does this pass, now that we don't set the conf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a one-off flag to the config to replicate this functionality

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool just make sure it works via the dashboard

Copy link
Contributor

@idomic idomic left a comment

Choose a reason for hiding this comment

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

Just make sure to test/squash commits.
Besides, lgtm

@edublancas edublancas merged commit 5a300ab into master Apr 25, 2022
@edublancas edublancas deleted the onboarding branch April 25, 2022 23:32
neelasha23 pushed a commit to neelasha23/ploomber that referenced this pull request May 22, 2022
* deletes empty function

* reorders imports

* functions to return paths to config files

* simplifying config file read

* adding Internal and Storage classes

* simplifying writes

* renaming

* adds Config

* improvements to Config

* refactors telemetry and cloud to use new Config

* documents config

* improves warning messages

* flake8

* validating config types

* fixes typo

* flake8
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.

None yet

2 participants