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

Support flags for the rit update repo command. #916

Merged
merged 29 commits into from
May 24, 2021

Conversation

maurineimirandazup
Copy link
Contributor

Description

Allows the use of flags in the rit update repo command

How to verify it

Update a remote repository using the command rit update repo --name="repository_name" --version="1.2"

Changelog

A new method for executing commands from the Cobra library has been introduced. Which allows the user to add the 3 different methods. (ie: run with stdin, flags or prompt)

@maurineimirandazup maurineimirandazup linked an issue May 3, 2021 that may be closed by this pull request
@maurineimirandazup maurineimirandazup added 🚧 WIP Work in Progress good first issue Good for newcomers 🔨 improvement Improvement in features and removed good first issue Good for newcomers labels May 3, 2021
@maurineimirandazup maurineimirandazup changed the title Support flags for the git update repo command. Support flags for the rit update repo command. May 3, 2021
pkg/cmd/cmd.go Outdated Show resolved Hide resolved
pkg/cmd/update_repo.go Outdated Show resolved Hide resolved
pkg/cmd/update_repo.go Outdated Show resolved Hide resolved
pkg/cmd/cmd.go Outdated Show resolved Hide resolved
kaduartur and others added 8 commits May 4, 2021 17:48
* 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>
…#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>
* 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>
…ods according to other commands.

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2021

Codecov Report

Merging #916 (3eea57a) into master (57d8fdb) will decrease coverage by 0.08%.
The diff coverage is 89.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #916      +/-   ##
==========================================
- Coverage   85.55%   85.46%   -0.09%     
==========================================
  Files         118      118              
  Lines        4305     4355      +50     
==========================================
+ Hits         3683     3722      +39     
- Misses        417      423       +6     
- Partials      205      210       +5     
Impacted Files Coverage Δ
pkg/cmd/update_repo.go 90.35% <89.24%> (-9.65%) ⬇️

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 dfe8d5a...3eea57a. Read the comment docs.

pkg/cmd/update_repo.go Show resolved Hide resolved
pkg/cmd/update_repo.go Outdated Show resolved Hide resolved
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
@fernandobelettizup fernandobelettizup dismissed their stale review May 12, 2021 20:01

changes made, waiting for tests to make another review

Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
@maurineimirandazup maurineimirandazup added ✔️ ready-for-review ready for review and removed waiting reply Waiting for an answer to a comment labels May 19, 2021
pkg/cmd/update_repo.go Outdated Show resolved Hide resolved
pkg/cmd/update_repo.go Outdated Show resolved Hide resolved
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
Signed-off-by: maurineimirandazup <maurinei.miranda@zup.com.br>
@lucasdittrichzup
Copy link
Contributor

LGTM 🚀

addition of the help message
Copy link
Contributor

@GuillaumeFalourd GuillaumeFalourd left a comment

Choose a reason for hiding this comment

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

Good job 👍🏼

@GuillaumeFalourd GuillaumeFalourd merged commit 6033181 into ZupIT:master May 24, 2021
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.

Support flags for rit update repo
8 participants