Commit Graph

8 Commits

Author SHA1 Message Date
Parthvi Vala
80d7cfde30 Create cleanup (#5589)
* Cleanup create code

* Add missing integration tests from odo create to odo init

* Add CreateLocalEnv to create .odo/env/env.yaml file for commands that require it but cannot create it

* Remove 'odo create'  usages from integration tests

* Remove create reference from the Makefile

* REmove create doc from v3

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Remove test files

* Fix CI failure

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2022-03-25 13:37:52 +01:00
Armel Soro
7a145e77c1 Interactive mode — Ask all questions first (#5553)
* Make PersonalizeName init backend methods optionally write to disk

* Make `odo init` defer the starter download action to the end

* Let callers of the business layer decide what to do with the Devfile after name personalization

The CLI layer should then be responsible for serializing the returned Devfile object to disk.

* Let callers of the business layer decide what to do with the Devfile after config personalization

The CLI layer should then be responsible for serializing the returned Devfile object to disk.

* Rename 'dFile' with 'zeroDevfile', as suggested in review

This makes the intent of the variable clearer:
it is the zero value we want to pass when an error occurs

* Make PersonalizeName return the configured name only, as suggested in review

* Adapt code after rebase

* Add test case for name personalization via `odo init`, as suggested in review

* Make the intent of the second callback in InitDevfile clearer
2022-03-24 15:05:45 +01:00
Philippe Martin
24fd02673d Remove github.com/pkg/errors dependency (#5557)
* Change errors.Wrapf

* Replace errors.Wrap

* Dont use pkg/errors (except error.Cause)

* Fix errors on Windows (do not test system underlying message)

* Replace errors.Cause

* Review
2022-03-21 11:32:42 +01:00
Parthvi Vala
070b8776c1 condition odo deploy information in odo init output (#5542)
* condition odo deploy information in odo init output

* Add integration tests

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Fix lint failure
2022-03-14 12:30:34 -04:00
Philippe Martin
ca1a55d304 Test and fix using namespace from env file (#5545)
* Test and fix using namespace from env file

* Review

* Delete other NS at the end of test
2022-03-14 08:50:16 -04:00
Parthvi Vala
715bb21b5c Fix panic with odo init when non-existent devfile path is provided (#5541)
* Fix panic with odo init when wrong devfile path is provided

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add a test case for --devfile-path

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add integration tests for URL type value
2022-03-11 11:19:33 -05:00
Philippe Martin
ff03b8e49a Select and pull a devfile using Alizer (#5464)
* Add alizer library and test functionality

<!--
Thank you for opening a PR! Here are some things you need to know before submitting:

1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Developer-Guidelines
2. Label this PR accordingly with the '/kind' line
3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Writing-and-running-tests
4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/PR-Review

Documentation:

If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Contributing-to-Docs
-->

**What type of PR is this:**

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind tests
/kind documentation

Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well.
-->

/kind feature

**What does this PR do / why we need it:**

Adds the alizer library from
https://github.com/redhat-developer/alizer/tree/main/go as part of our
implementaion of `odo dev` and `odo init`.

This builds upon @feloy 's PR located here: https://github.com/redhat-developer/odo/pull/5434

**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->

Fixes #

**PR acceptance criteria:**

- [X] Unit test

- [X] Integration test

- [X] Documentation

**How to test changes / Special notes to the reviewer:**

N/A. Only function implementation

* New alizer version

* Use alizer for odo init

* Add integration tests

* Add Alizer to odo deploy

* review

* Ask component name for odo deploy

* Fix unit test

Co-authored-by: Charlie Drage <charlie@charliedrage.com>
2022-02-23 01:52:51 -05:00
Philippe Martin
b75fa552ce Init command (#5348)
* Init command

* More tests + check empty dir

* Move function from catalog to service package

* Interactive asks lang + type

* Interactive

* Refactor catalog package with interface

* Add mocks for catalog and init/asker

* Add tests

* Create sub-packages for init + starter project

* Rename files in pkg/catalog

* More validations

* fix

* Logs

* Rollback

* Go back and No starter

* Review

* Use filesystem.Filesystem in pkg/catalog

* Change pull from registry strategy

* More unit tests

* More tests

* Integration tests

* Review

* Use full path to fix problem with Unzip

* Add integration test for devfile with parent URI

* Add prefClient dependence to catalog package

* Move function to pkg/init package

* Review

* Fix rebase

* Review
2022-02-01 04:48:54 -05:00