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

Added step to question about formula found #478

Conversation

brunats
Copy link
Contributor

@brunats brunats commented Aug 27, 2020

- What I did
Added a new step in choosing the formula for the build.

When rit finds a directory with a formula, it looks for other formulas in the tree (within the same directory).
If he finds it, he asks the user if he wants to select this formula found or continue searching for another one.

Other formulas found and the first selected:
rit-build-formula-1

Found other formulas and selected to continue searching:
rit-build-formula-2

- How to verify it

Clone this pr with the command and build Ritchie

git fetch upstream pull/478/head:fix/order-of-choice-of-formula-for-the-build
git checkout fix/order-of-choice-of-formula-for-the-build
make build && sudo cp dist/linux/rit /usr/local/bin/

And run rit add repo

rit create formula # using 'rit group verb'
rit create formula # using 'rit group verb formula'
rit build formula # select rit group verb formula
rit build formula # select rit group verb

- Description for the changelog

Added step to question about formula founded.

Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
@brunats brunats force-pushed the fix/order-of-choice-of-formula-for-the-build branch from 01b7b8a to 84da419 Compare August 27, 2020 14:38
@codecov-commenter
Copy link

codecov-commenter commented Aug 27, 2020

Codecov Report

Merging #478 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #478   +/-   ##
=======================================
  Coverage   69.03%   69.03%           
=======================================
  Files          88       88           
  Lines        2955     2955           
=======================================
  Hits         2040     2040           
  Misses        717      717           
  Partials      198      198           

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 03d9e0b...36e4d88. Read the comment docs.

@brunasilvazup brunasilvazup added the 🚧 WIP Work in Progress label Aug 27, 2020
@brunasilvazup brunasilvazup added the 🪲 bug Report a bug encountered while operating Ritchie label Aug 27, 2020
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
…r-of-choice-of-formula-for-the-build

Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
…r-of-choice-of-formula-for-the-build

Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Comment on lines +197 to +214
func getFields(fieldsDefault fieldsTestBuildFormulaCmd, fieldsTest fieldsTestBuildFormulaCmd) fieldsTestBuildFormulaCmd {
var fields fieldsTestBuildFormulaCmd = fieldsDefault

if fieldsTest.directory != nil {
fields.directory = fieldsTest.directory
}
if fieldsTest.inList != nil {
fields.inList = fieldsTest.inList
}
if fieldsTest.localBuilder != nil {
fields.localBuilder = fieldsTest.localBuilder
}
if fieldsTest.workspaceManager != nil {
fields.workspaceManager = fieldsTest.workspaceManager
}

return fields
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is used to always choose the default fields and if the test defines any field, use the test field.

The d5b81bc commit is the one with just that change.

@brunasilvazup brunasilvazup requested review from lucasdittrichzup and removed request for lucasdittrichzup August 28, 2020 20:00
Copy link
Contributor

@victor-schumacher victor-schumacher left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/cmd/mocks_test.go Show resolved Hide resolved
@brunasilvazup brunasilvazup added this to the 2.0.5 milestone Aug 31, 2020
pkg/cmd/build_formula.go Show resolved Hide resolved
@brunasilvazup
Copy link
Contributor

/merge qa

@ritchie-bot
Copy link
Contributor

ritchie-bot bot commented Aug 31, 2020

👌 Merged branch fix/order-of-choice-of-formula-for-the-build into qa

@brunasilvazup
Copy link
Contributor

Qa tests:

  • two formulas with the same starting structure;
  • build tests of both;
  • created normal formula and tested the build with the creation.

@brunasilvazup brunasilvazup merged commit 66e88dc into ZupIT:master Aug 31, 2020
@kaduartur kaduartur removed this from the 2.0.5 milestone Sep 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🪲 bug Report a bug encountered while operating Ritchie ✔️ ready-for-review ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Formulas with the same directory structure are causing an error in the build and execution
6 participants