-
Notifications
You must be signed in to change notification settings - Fork 552
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
feat: new ignite doctor command #3381
Conversation
Fix #3291 - add ignite doctor command (hidden for the moment) - migrate config.yml if needed - create tools/tools.go if not present, then install dependency tools. The `tools/tools.go` scaffold is handled by the same generator as `scaffold chain`, with an update allowing it to filter the fileset. `xgenny.NewEmbedWalker`, which was used to remove the `files/` prefix, is replaced by `fs.Sub` from the standard library. - update `cosmosgen.InstallDepTools()` - remove retro compatibilty with chain that doesn't have `tools/tools.go`, in other words, remove the call to `go get` - run `go mod tidy` to update `go.sum` - suggest to run ignite doctor when dependency tools install fails - move `GOSUMDB=off` inside `gocmd.ModTidy` instead of setting it prior to the call. This ensures it's always set. Because the command uses intensively the filesystem, I chose to test it with integration tests only. The integration test introduces a new library called `testscript` [0], which is very convenient for this kind of tests. `testscript` is based txt files, where each file is a test case that contains some instructions. The txt file for `ignite doctor` runs `ignite doctor` and then asserts what has changed in the filesystem, according to some commands like `cmp`. The initial state before the command is run is also specified in the txt file, with a list of files designated by `-- filename --` followed by the file content. [0] https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript
b377200
to
b417d3c
Compare
There's an issue with the network integration: the test runs I see 2 solutions:
Any other solution ? |
Let's discuss in the community call? |
Hey guys, this PR should be merged: I got the confirmation it fixes an annoying downgrade issue. The PR is stuck because of a problem with spn, but I noticed that the removal of the network command is on the roadmap. So let's also remove/comment the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@jeronimoalbi can you please review / merge? Thanks.
LGTM 👍 Once the issue with the tests and the conversations are resolved we can merge. |
Co-authored-by: Jerónimo Albi <[email protected]>
* feat: new ignite doctor command Fix ignite#3291 - add ignite doctor command (hidden for the moment) - migrate config.yml if needed - create tools/tools.go if not present, then install dependency tools. The `tools/tools.go` scaffold is handled by the same generator as `scaffold chain`, with an update allowing it to filter the fileset. `xgenny.NewEmbedWalker`, which was used to remove the `files/` prefix, is replaced by `fs.Sub` from the standard library. - update `cosmosgen.InstallDepTools()` - remove retro compatibilty with chain that doesn't have `tools/tools.go`, in other words, remove the call to `go get` - run `go mod tidy` to update `go.sum` - suggest to run ignite doctor when dependency tools install fails - move `GOSUMDB=off` inside `gocmd.ModTidy` instead of setting it prior to the call. This ensures it's always set. Because the command uses intensively the filesystem, I chose to test it with integration tests only. The integration test introduces a new library called `testscript` [0], which is very convenient for this kind of tests. `testscript` is based txt files, where each file is a test case that contains some instructions. The txt file for `ignite doctor` runs `ignite doctor` and then asserts what has changed in the filesystem, according to some commands like `cmp`. The initial state before the command is run is also specified in the txt file, with a list of files designated by `-- filename --` followed by the file content. [0] https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript * fix lint * chore: rename xfilepath.Must * Update ignite/pkg/gocmd/gocmd.go Co-authored-by: Jerónimo Albi <[email protected]> * Update ignite/services/doctor/doctor.go Co-authored-by: İlker G. Öztürk <[email protected]> * fix lint --------- Co-authored-by: Alex Johnson <[email protected]> Co-authored-by: Jerónimo Albi <[email protected]> Co-authored-by: İlker G. Öztürk <[email protected]>
Fix #3291 #3268
config.yml
if neededtools/tools.go
if not present, then install dependency tools.The
tools/tools.go
scaffold is handled by the same generator asscaffold chain
, with an update allowing it to filter the fileset.xgenny.NewEmbedWalker
, which was used to remove thefiles/
prefix, is replaced byfs.Sub
from the standard library.cosmosgen.InstallDepTools()
tools/tools.go
, in other words, remove the call togo get
go mod tidy
to updatego.sum
GOSUMDB=off
insidegocmd.ModTidy
instead of setting it prior to the call. This ensures it's always set.Because the command uses intensively the filesystem, I chose to test it with integration tests only. The integration test introduces a new library called
testscript
[0], which is very convenient for this kind of tests.testscript
is based on txt files, where each file is a test case that contains some instructions. The txt file forignite doctor
runsignite doctor
and then asserts what has changed in the filesystem, according to some commands likecmp
. The initial filesystem state before the command is run is also specified in the txt file, with a list of files designated by-- filename --
followed by the file content.[0] https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript