Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services: make commands aware of rdm version #310

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

ppanero
Copy link
Member

@ppanero ppanero commented Sep 29, 2022

I do not like this way because it requires installing invenio-app-rdm which technically cli should not be aware of (i.e. in containerized version).

Shall we parse the Pipfile?

),
]

if rdm_version[0] < 10:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if rdm_version[0] < 10:
if rdm_version[0] >= 10:

?

What if we do something more structured, e.g. create a enum/map of features with version, for example (allow me pseudo-code):

versions = { 
  10: [custom-fields, administration],
   ...
}

then an helper:

get_enabled_features():
  return versions[current-app-rdm version]

and then in the code we get that map and use it?

if custom-fields-in-version:
  run init command

@ppanero ppanero changed the title [DO NOT MERGE] services: make commands aware of rdm version services: make commands aware of rdm version Sep 30, 2022
@ppanero ppanero marked this pull request as ready for review September 30, 2022 09:24
@ppanero ppanero requested a review from ntarocco September 30, 2022 09:24
@ppanero
Copy link
Member Author

ppanero commented Sep 30, 2022

@ntarocco I've for now just parsed the app-rdm version from the pipfile (I tried with the existing configparser but it doesnt work, my guess is the double [[ ]] at the beginning)

Regarding the more complex logic of commands/features per version I do agree but I think we can leave it for a different/PR issue and tackle it along with the distinction of RDM/ILS of the cli? so we unblock this on the release. I can start working on that, but I think is better on a separate PR since it will be a big change.

invenio_cli/helpers/rdm.py Show resolved Hide resolved
@ppanero
Copy link
Member Author

ppanero commented Sep 30, 2022

Opened relevant issues:

@ppanero ppanero merged commit 4590a62 into inveniosoftware:master Sep 30, 2022
@ppanero ppanero deleted the rdm_version branch September 30, 2022 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants