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

merge altsrc with main package #1058

Closed
wants to merge 16 commits into from
Closed

merge altsrc with main package #1058

wants to merge 16 commits into from

Conversation

asahasrabuddhe
Copy link
Member

@asahasrabuddhe asahasrabuddhe commented Jan 30, 2020

What type of PR is this?

  • cleanup

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 asahasrabuddhe requested a review from a team as a code owner January 30, 2020 10:45
@asahasrabuddhe asahasrabuddhe requested review from saschagrunert and rliebz and removed request for a team January 30, 2020 10:45
@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.

@coilysiren coilysiren self-requested a review January 31, 2020 04:02
@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

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

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.

@coilysiren
Copy link
Member

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

@coilysiren
Copy link
Member

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

@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 stale due to the age of it's last update 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
@asahasrabuddhe asahasrabuddhe reopened this Nov 1, 2020
@stale
Copy link

stale bot commented Nov 1, 2020

This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.

@stale stale bot removed the status/stale stale due to the age of it's last update label Nov 1, 2020
@asahasrabuddhe
Copy link
Member Author

I'd like us all to re consider this PR and we can then probably consider moving forward in the direction of a modular v3

@asahasrabuddhe
Copy link
Member Author

@urfave/cli

@rliebz
Copy link
Member

rliebz commented Nov 8, 2020

There have been a number of changes to the master branch since this was last worked on, and in particular, a number of fixes applied to the altsrc package. I think we're not seeing any conflicts now because v3-development-master has lagged behind, but I want to make sure that we aren't losing out on changes, especially in a ~3000 line diff.

Not sure what the best way to proceed is here—potentially start by getting v3-development-master up to date with master?

@stale
Copy link

stale bot commented Feb 7, 2021

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 stale due to the age of it's last update label Feb 7, 2021
@coilysiren
Copy link
Member

👀

@stale
Copy link

stale bot commented Feb 10, 2021

This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.

@stale stale bot removed the status/stale stale due to the age of it's last update label Feb 10, 2021
@stale
Copy link

stale bot commented Aug 28, 2021

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 stale due to the age of it's last update label Aug 28, 2021
@meatballhat
Copy link
Member

👀

@meatballhat meatballhat removed the status/stale stale due to the age of it's last update label Apr 21, 2022
@meatballhat meatballhat added this to the Release 3.x milestone Apr 21, 2022
@meatballhat meatballhat changed the title [v3] merge altsrc with main package merge altsrc with main package Apr 21, 2022
@meatballhat meatballhat changed the base branch from v3-development-master to v3-dev-main April 21, 2022 22:25
@meatballhat meatballhat mentioned this pull request Jul 16, 2022
21 tasks
@dearchap
Copy link
Contributor

dearchap commented Sep 4, 2022

@asahasrabuddhe Can you fix the merge conflicts ?

@coilysiren
Copy link
Member

OMG ITS HAPPENING!?!?!

@dearchap dearchap added status/waiting-for-response Waiting for response from original requester area/v3 relates to / is being considered for v3 labels Sep 26, 2022
@dearchap
Copy link
Contributor

dearchap commented Nov 9, 2022

I'm going to close this issue since we are moving altsrc to a separate repo

@dearchap dearchap closed this Nov 9, 2022
@dearchap dearchap deleted the v3-alt-src branch December 10, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v3 relates to / is being considered for v3 status/waiting-for-response Waiting for response from original requester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants