The Wayback Machine - https://web.archive.org/web/20200920213105/https://github.com/urfave/cli/pull/1058
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

[v3] merge altsrc with main package #1058

Closed
wants to merge 16 commits into from
Closed

Conversation

@asahasrabuddhe
Copy link
Member

asahasrabuddhe commented Jan 30, 2020

What type of PR is this?

(REQUIRED)

  • bug
  • cleanup
  • documentation
  • feature

What this PR does / why we need it:

This is one of the first goals for the v3 release (via #833 (comment)). This helps condense the public API by reducing two exposed packages from before into a single package.

Release Notes

- Remove `altsrc` package
- Add `FlagInputSourceExtension` interface to allow a value to be set on existing parsed flags through alternate sources like `JSON` or `TOML` etc.
asahasrabuddhe and others added 14 commits Oct 9, 2019
@asahasrabuddhe asahasrabuddhe requested a review from urfave/cli as a code owner Jan 30, 2020
@asahasrabuddhe asahasrabuddhe requested review from saschagrunert and rliebz and removed request for urfave/cli Jan 30, 2020
@codecov
Copy link

codecov bot commented Jan 30, 2020

Codecov Report

No coverage uploaded for pull request base (v3-development-master@c5f50db). Click here to learn what that means.
The diff coverage is 64.18%.

Impacted file tree graph

@@                   Coverage Diff                    @@
##             v3-development-master    #1058   +/-   ##
========================================================
  Coverage                         ?   67.77%           
========================================================
  Files                            ?       31           
  Lines                            ?     2647           
  Branches                         ?        0           
========================================================
  Hits                             ?     1794           
  Misses                           ?      741           
  Partials                         ?      112
Impacted Files Coverage Δ
errors.go 87.5% <ø> (ø)
category.go 87.5% <ø> (ø)
json_source_context.go 12.37% <0%> (ø)
app.go 78.71% <100%> (ø)
yaml_file_loader.go 42.85% <100%> (ø)
flag.go 85.57% <100%> (ø)
flag_string.go 87.5% <100%> (ø)
flag_duration.go 73.07% <100%> (ø)
flag_int_slice.go 76.82% <100%> (ø)
flag_string_slice.go 81.08% <100%> (ø)
... and 16 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 c5f50db...120695c. Read the comment docs.

@lynncyrin lynncyrin self-requested a review Jan 31, 2020
@rliebz
Copy link
Member

rliebz commented Jan 31, 2020

Motivation, for context: #907 (comment)

@rliebz
Copy link
Member

rliebz commented Jan 31, 2020

This might be something to balance against the goal of making the project more modular, re: #1055. Two of our three dependencies, github.com/BurntSushi/toml and gopkg.in/yaml.v2, come from the altsrc package.

@asahasrabuddhe
Copy link
Member Author

asahasrabuddhe commented Jan 31, 2020

This PR doesn't intend to make the project modular. It simply exists to integrate the altsrc into the main package. To make the library modular is the last thing in my plan when I am sure that the core features intended for v3 are already in the development branch.

Once done, I can think of functionality that can be offloaded into a separate module and downloaded on demand by a user who wants it.

@rliebz
Copy link
Member

rliebz commented Jan 31, 2020

Sorry, I may have phrased that poorly.

This change seems to move in the opposite direction of modularity. We're taking functionality that comes with dependencies such as yaml and toml-parsing and moving that from a separate package into the cli package. Not that there isn't reason to do this—modularity obviously isn't our only goal. If modularity is one of our goals, though, I wanted to flag that we're bringing more dependencies into our core package by making this change, which might make it harder to stay modular in the future, unless we have a specific path forward on that front.

@asahasrabuddhe
Copy link
Member Author

asahasrabuddhe commented Jan 31, 2020

I agree with you @rliebz. Apologies if I came too strongly there. What I wanted to say is I just wanted all the proposed changes together in the development branch to see how they work out together. Once the features are frozen, I would proceed with a cleanup and extract such optional components into separate modules which can then be imported by users when they want to use them.

@lynncyrin
Copy link
Member

lynncyrin commented Jan 31, 2020

I @asahasrabuddhe @rliebz I think you both just made a very strong argument for us including a "module system" in the v3 release!

@lynncyrin
Copy link
Member

lynncyrin commented Jan 31, 2020

I agree with @asahasrabuddhe's proposal of merging altsrc into cli, and then moving it out again later - after the module system is in.

Copy link
Member

lynncyrin left a comment

altsrc is a mess in its current state, so I think this is a good case for us to merge and iterate ^^ we can compare v3 with v1's altsrc later, IMO.

- v3-development-master
pull_request:
branches:
- master
- v1
- v3-development-master
Comment on lines +8 to +13

This comment has been minimized.

@lynncyrin

lynncyrin Feb 26, 2020 Member

(nice to have) can we name this just v3? For the sake of consistency 🙏

This comment has been minimized.

@rliebz

rliebz Feb 26, 2020 Member

Not a huge deal either way, but I actually like having a name like v3-development-master that indicates a lack of stability compared to v3.

This comment has been minimized.

@asahasrabuddhe

asahasrabuddhe Feb 26, 2020 Author Member

I agree with @rliebz it's just temporary. I will rename it once it's stable :)

@stale
Copy link

stale bot commented May 26, 2020

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

@stale stale bot added the status/stale label May 26, 2020
@stale
Copy link

stale bot commented Jun 25, 2020

Closing this as it has become stale.

@stale stale bot closed this Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.