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

contrib: added codemeta custom fields. #1187

Merged

Conversation

alejandromumo
Copy link
Member

@alejandromumo alejandromumo commented Feb 14, 2023

closes #1186

@alejandromumo alejandromumo force-pushed the add_code_meta_custom_fields branch from 41c3fd2 to 354d092 Compare February 15, 2023 12:50
@alejandromumo alejandromumo force-pushed the add_code_meta_custom_fields branch 2 times, most recently from 70a95be to 09cd610 Compare February 15, 2023 14:42
Copy link
Member

@ppanero ppanero left a comment

Choose a reason for hiding this comment

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

Content LGTM! nice job! Questions are more on code placement and responsabilities.

):
"""Initializes codemeta custom fields."""
# Add code meta custom fields
running_app.app.config["RDM_CUSTOM_FIELDS"] = CODE_CUSTOM_FIELDS
Copy link
Member

Choose a reason for hiding this comment

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

Can we overwrite config using the app_config fixture?

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean using the fixture app_config or moving these config's loading to the fixture itself? If the latter, I'd prefer to load them on demand since that's how the end user will load these custom fields. They must be explicitely loaded when they are to be used.

Copy link
Member

Choose a reason for hiding this comment

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

I meant, on demand. You can overwrite the app_config and then all gets injected automatically, you can also control the scope, etc. e.g.

def app_config(app_config):

Copy link
Member Author

Choose a reason for hiding this comment

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

I ended up doing something different, sorry. I was having quite some trouble to make it work with app_config, as it gets picked up by base_app when the app is initialised.
What I am doing now is simply injecting the configs in the app, initialising the codemeta custom fields and rolling the config back afterwards.

I like your idea better, however I ran into multiple issues (some not even related) and this is how I made it work.

@alejandromumo alejandromumo force-pushed the add_code_meta_custom_fields branch from 09cd610 to 579313e Compare February 20, 2023 10:14
@alejandromumo
Copy link
Member Author

Tests are failing but feel free to discuss, namely this comment

Copy link
Member

@slint slint left a comment

Choose a reason for hiding this comment

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

LGTM! Some naming nits, and a possible fixture removal 🙌

Copy link
Contributor

@kpsherva kpsherva left a comment

Choose a reason for hiding this comment

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

LGTM! but as I am not expert on custom fields maybe someone else should take a look

Copy link
Member

@slint slint left a comment

Choose a reason for hiding this comment

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

Some minor comments on mappings/types, and naming nits (I should start paying more attention in the first reviews 😏 )

Copy link
Member

@zzacharo zzacharo left a comment

Choose a reason for hiding this comment

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

Needs rebasing and addressing some minor comments :)

@alejandromumo alejandromumo force-pushed the add_code_meta_custom_fields branch 2 times, most recently from bd1e09d to 3ded3f8 Compare February 24, 2023 15:02
@alejandromumo alejandromumo force-pushed the add_code_meta_custom_fields branch from 3ded3f8 to 8e2382b Compare February 27, 2023 10:02
@kpsherva kpsherva merged commit 88dff7c into inveniosoftware:master Feb 27, 2023
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.

Implement Software Heritage (Code Meta) fields as custom fields
5 participants