Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Improve rit init command #828

Merged
merged 10 commits into from
Jan 20, 2021
Merged

Improve rit init command #828

merged 10 commits into from
Jan 20, 2021

Conversation

kaduartur
Copy link
Contributor

Description

Improve rit initcommand and add the default language to English.

How to verify it

It's a small part of the #775 issue, a separate pull request was created to facilitate code review

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
@codecov-io
Copy link

codecov-io commented Jan 13, 2021

Codecov Report

Merging #828 (50abb72) into feature/i18n (7b55c06) will decrease coverage by 0.11%.
The diff coverage is 96.92%.

Impacted file tree graph

@@               Coverage Diff                @@
##           feature/i18n     #828      +/-   ##
================================================
- Coverage         84.34%   84.22%   -0.12%     
================================================
  Files               111      111              
  Lines              3857     3880      +23     
================================================
+ Hits               3253     3268      +15     
- Misses              432      436       +4     
- Partials            172      176       +4     
Impacted Files Coverage Δ
pkg/cmd/init.go 95.55% <96.49%> (-4.45%) ⬇️
pkg/cmd/upgrade.go 100.00% <100.00%> (ø)
pkg/commands/builder.go 90.35% <100.00%> (+0.04%) ⬆️

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 7b55c06...50abb72. Read the comment docs.

pkg/cmd/init.go Outdated Show resolved Hide resolved
Copy link
Contributor

@henriquemoraeszup henriquemoraeszup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of questions:

  • I remember emojis were not working on windows, is this case fine?
  • More important than registering the default English, is the current version statically using the English language. We are not selecting the language based on the config yet right?

pkg/cmd/upgrade_test.go Show resolved Hide resolved
Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
pkg/cmd/init.go Outdated Show resolved Hide resolved
Copy link
Contributor

@brunasilvazup brunasilvazup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far, it's a good refactoring and improvement in init, I will wait for the changes in the tests to finalize the review.

  • Could you put a gif about the init process in the description, please?

@henriquemoraeszup
Copy link
Contributor

A couple of questions:

...

  • More important than registering the default English, is the current version statically using the English language. We are not selecting the language based on the config yet right?

@kaduartur
Copy link
Contributor Author

A couple of questions:

  • I remember emojis were not working on windows, is this case fine?
  • More important than registering the default English is the current version statically using the English language. We are not selecting the language based on the config yet, right?

We are not selecting the language based on the config, we will do that in the next PR!

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
@henriquemoraeszup
Copy link
Contributor

I am still missing the test comment reply

@kaduartur
Copy link
Contributor Author

/merge qa

@ritchie-bot
Copy link
Contributor

ritchie-bot bot commented Jan 18, 2021

👌 Merged branch feature/select_lang into qa

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
metricSender,
ritConfigMock,
)

initPrompt.PersistentFlags().Bool("stdin", false, "input by stdin")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should support flags for the init command

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good, but in order not to escape further from the context of this PR I prefer to do it in a separate task

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
@kaduartur kaduartur merged commit bd83406 into ZupIT:feature/i18n Jan 20, 2021
@kaduartur kaduartur deleted the feature/select_lang branch January 20, 2021 13:47
Copy link
Contributor

@henriquemoraeszup henriquemoraeszup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niiice, just a comment

"github.com/ZupIT/ritchie-cli/pkg/rtutorial"
"github.com/ZupIT/ritchie-cli/pkg/stream"
sMocks "github.com/ZupIT/ritchie-cli/pkg/stream/mocks"
)

func Test_initCmd_runAnyEntry(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename to CameCase?

kaduartur added a commit that referenced this pull request Apr 29, 2021
* Create config file to ritchie (#825)

* Create translation

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create config file

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Remove unused dependency

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve rit init command (#828)

* Improve rit init command

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix functional tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve rit init tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix init for Windows

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Remove comment

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix init message

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create translation for init command (#834)

* Add translation for init cmd

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix makefile

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix vendor

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix read config

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create translation guide

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Update DEVELOPER_GUIDE.md

* Fix config_test.go

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
maurineimirandazup pushed a commit to maurineimirandazup/ritchie-cli that referenced this pull request May 4, 2021
* Create config file to ritchie (ZupIT#825)

* Create translation

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create config file

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Remove unused dependency

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve rit init command (ZupIT#828)

* Improve rit init command

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix functional tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve rit init tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix init for Windows

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Remove comment

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix init message

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create translation for init command (ZupIT#834)

* Add translation for init cmd

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix makefile

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix vendor

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix read config

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create translation guide

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Update DEVELOPER_GUIDE.md

* Fix config_test.go

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
GuillaumeFalourd pushed a commit that referenced this pull request May 24, 2021
* Support flags for the git update repo command.

* Support flags for the rit update repo command.

* Internationalization Ritchie-cli (#847)

* Create config file to ritchie (#825)

* Create translation

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create config file

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Remove unused dependency

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve rit init command (#828)

* Improve rit init command

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix functional tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Improve rit init tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix init for Windows

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Remove comment

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix init message

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix tests

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create translation for init command (#834)

* Add translation for init cmd

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix makefile

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix vendor

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix lint

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Fix read config

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Create translation guide

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Update DEVELOPER_GUIDE.md

* Fix config_test.go

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>

* Adding flags, delete confirmation and new tests to delete repo (#908)

* added support flags, added delete confirmation and changed tests for rit delete repo

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* fix lint

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* removed "Delete repo STDIN" from stdin_integration_test

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* reverting stdin removal, added local name for flag

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* fixing unit tests

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added nameFlag to error message

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added flag to check if repo must be deleted

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* using missingFlagText method

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* removed existingRepoIsDeleted when value is false from tests struct

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* reverting stdin removed tests

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* reverting stdin scenarios

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* changed sdtin_feature.json repo url, previous url stopped working

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* chaging test repo tag

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* method renamed runFormula -> runCmd

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* Feature/add formula rit list formulas (#913)

* added list formulas command, changes to tree and builder

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added input flags support

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* creating test file

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added test cases

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* changed check if repo exists logic to avoid for loop

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* tree checker_test fix

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* additional lint fixes (misspelling + preallocation)

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* misspelling fix

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* lint prealloc fix

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* minor suggestion fixes

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added check for empty tree and case tests, changed logic for repo not found

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* reverting error logic on default tree, errors now in list_formula.go

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* lint: misspelling

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added list formula to api.commands

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* simplified a var declaration

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added missingFlagText, changes to constructor and flag description

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added asserts for printed output

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* ignoring print errors on ALL flag, added warning

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* added test case to check warning

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* changed method name, list repos logic, replacer logic, empty repo warning and tests

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* simplified printformulas to return warnings, changed tests

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* lint fix -> no error returning from printFormulas, just warnings

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* fixing merge buid conflict

Signed-off-by: fernandobelettizup <fernando.beletti@zup.com.br>

* Removal of the Run FuncEF method that I had created. Standardize methods according to other commands.

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Remove comment

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Adjust in return to perform only an update repo on runCmd.

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Variable renamed with a more complete name.

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Linter Fix, gofmt.

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Fix version update prompt, fix array lenght in update flags

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Change error msg

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Change return 'err' to nil

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* add 'externalRepos', with only remote repositorys

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* change err to nil

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* change err to nil

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* First tests

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* gofmt file

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* small changes and working tests

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* All Tests Working, Need Refactor

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Working Tests with assert

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Last test, invalid repo

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* Change output error to fmt.Errorf

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* remove variable flagAll

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* declaration of success message in just one place

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>

* addition of the help message

addition of the help message

Co-authored-by: Kadu Artur Prussek <kadu.artur@gmail.com>
Co-authored-by: fernandobelettizup <60020008+fernandobelettizup@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 improvement Improvement in features ✔️ ready-for-review ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants