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

Make /commands testable #4598

Closed
bep opened this Issue Apr 9, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@bep
Member

bep commented Apr 9, 2018

The commands package is the number one source of regressions after releases. The rest of the code base is very stable in this department, but when de work we do intersects with the commands package we get into a wildland of globals and high coupling, making changes hard an risky.

Fixing that is boring work, but so is patch releases.

And never has Benjamin Franklin been more right:

“Don't put off until tomorrow what you can do today.”

@bep bep added the Enhancement label Apr 9, 2018

@bep bep added this to the v0.39 milestone Apr 9, 2018

@bep bep self-assigned this Apr 9, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

commands: Remove the Hugo global
There are still some cleaning to do, but that felt good.

See gohugoio#4598

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit that referenced this issue Apr 11, 2018

commands: Use short date format in CLI docs
To make it possible to compare the output.

See #4598

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

commands: Remove the Hugo global
There are still some cleaning to do, but that felt good.

See gohugoio#4598

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

commands: Fix some flag diff
The CLI docs output is now identical with the master version.

See gohugoio#4598

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

commands: Fix the config command
It now also accepts the `-s` (source) flag.

See gohugoio#4598

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

commands: Make commands.Execute return a Response object
We have no global `Hugo` object no more (yay!), and there are some external tools that depends on that value.

These tools need to use get that value from `Response.Result`.

Note that `commands.Execute` now also takes the arguments as a string slice. This should also make it easier to use, not having to modify `os.Args`.

See gohugoio#4598

bep added a commit to bep/hugo that referenced this issue Apr 11, 2018

commands: Make commands.Execute return a Response object
We have no global `Hugo` object no more (yay!), and there are some external tools that depends on that value.

These tools need to use get that value from `Response.Result`.

Note that `commands.Execute` now also takes the arguments as a string slice. This should also make it easier to use, not having to modify `os.Args`.

This commit also wraps up this particular issue. Phew!

Closes gohugoio#4598

@bep bep closed this in 96689a5 Apr 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment