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

dm/config-refactor #185

Merged
merged 15 commits into from
Dec 6, 2019
Merged

dm/config-refactor #185

merged 15 commits into from
Dec 6, 2019

Conversation

dmerejkowsky
Copy link
Collaborator

@dmerejkowsky dmerejkowsky commented Dec 3, 2019

Fix #178
Fix #179
Fix #180
Fix #181

@codecov-io
Copy link

codecov-io commented Dec 3, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@5e2ad51). Click here to learn what that means.
The diff coverage is 89.31%.

@@            Coverage Diff            @@
##             master     #185   +/-   ##
=========================================
  Coverage          ?   83.51%           
=========================================
  Files             ?       30           
  Lines             ?     1650           
  Branches          ?      199           
=========================================
  Hits              ?     1378           
  Misses            ?      223           
  Partials          ?       49

@dmerejkowsky dmerejkowsky force-pushed the dm/config-refactor branch 3 times, most recently from 33795d0 to 4a15ce9 Compare December 3, 2019 14:26
Turns out we don't really need it - the logic to use
all elements from the group list belongs to higher-level
code like the `sync` or `foreach` implementation
Do not use `gitlab` and `github_enterprise` nested classes, just use
`gitlab_url` and `github_enterprise_url` attributes.

Also, get rid of the named types in tsrc/manifest.py - one of them
(ManifestConfig) had the same name as an other class! If anything, we
should use TypedDict instead

Finally, rename vague `.load()` method into `apply_config()`
LocalManifest class:
* no longer hold any configuration, and only knows how to
update the manifest clone in <workspace>/.tsrc/manifest. All configuration
attributes are now managed by the WorkspaceConfig class
* rename confusing `manifest` property into a `get_manifest()` method

Workspace class:
* contains a LocalManifest and a WorkspaceConfig instance.
* instead of having to call `load_manifest`, the config file in
`<workspace>/.tsrc/config.yml` is parsed in Workspace ctor
* remove some delegation methods that were reading config from
  self.local_manifest and either use
    - self.config or
    - self.local_manifest.get_manifest()

Also, no longer handle local manifest commit from a *path* and not an url, and
get rid of the concept of a manifest *tag* altogether.

Finally, get rid of the confusing "active_groups" naming. It's now in WorkspaceConfig.repo_groups
which is hopefully a better location and nome.
* `tsrc init` can now only be called once, and always with an URL
* Get rid of the `--file` option
Instead of running `init` twice, we need too
check what happens when we change the manifest
branch in the workspace config.
Before:
  tsrc init --group foo --group bar

After:
   tsrc init --groups foo bar
This adds links from the doc to the GitHub repo, and also an "Edit this page
on GitHub" link, which is nice :)
@dmerejkowsky dmerejkowsky merged commit f6ee476 into master Dec 6, 2019
@dmerejkowsky dmerejkowsky deleted the dm/config-refactor branch January 21, 2020 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants