Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Add min max cli args #234

Closed

Conversation

thepetk
Copy link
Collaborator

@thepetk thepetk commented Jun 4, 2023

What does this PR do?

As part of #159 we are introducing the two first cli args in order to support specific versions of devfiles. Those two are min-version and max-version.

If this argument is passed in the cli we are updating the URL for the download of the devfiles from the registry (following this link). This way we are filtering the list of devfiles we are getting from the registry.

Some edge cases:

  • If min-version is higher than max-version an error is raised.
  • If min-version and/or max-version is lower than 2.0.0 (the lowest accepted version from the registry API) then an error is raised.

A slight addition is also made to the model.DevfileType in order to include information for versions. For backwards compatibility reasons we are no longer using SelectDevFilesFromRegistry but MatchDevfiles.

A new model.DevfileFilter is created in order to include all future filters inside the devfile API and ensure scalability.

Updates are made inside the documentation of the project to include all changes introduced and test cases regarding the URL update are added.

Which issue(s) does this PR fix

fixes #226

PR acceptance criteria

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.

  • Unit/Functional tests

  • Documentation

How to test changes / Special notes to the reviewer

thepetk added 6 commits June 29, 2023 10:31
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
@thepetk thepetk force-pushed the feature/add_min_max_cli_args branch from 8e8fd0f to ad67ce8 Compare June 29, 2023 09:36
thepetk added 5 commits June 29, 2023 14:36
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
@thepetk thepetk changed the title WIP: Add min max cli args Add min max cli args Jun 29, 2023
Signed-off-by: thepetk <thepetk@gmail.com>
return nil, err
}
// This value is set by the user in order to configure the registry
resp, err := http.Get(url) //nolint

Check failure

Code scanning / gosec

Potential HTTP request made with variable url

Potential HTTP request made with variable url
@thepetk
Copy link
Collaborator Author

thepetk commented Jun 30, 2023

closing in favor of devfile/alizer#5

@thepetk thepetk closed this Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add min-version and max-version CLI arguments
1 participant