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

Add Pydantic Data Model to Document Node Attributes Data Structure #2239

Merged
merged 29 commits into from
Apr 5, 2024

Conversation

ytausch
Copy link
Contributor

@ytausch ytausch commented Mar 6, 2024

Currently, there is no documentation about the data model of the cf-graph that this bot implicitly uses.

This is the first step of improving this:

  • add a Pydantic model for the node attributes
  • add a CI check that validates the model against the current cf-graph state
  • the above step lead to the discovery of invalid feedstocks and node attributes files, which are listed in test_validate.py.
  • README updates
  • add PR template encouraging contributors to update the Pydantic model

Documenting the data model also included discovering some undocumented features of the meta.yaml file. I submitted corresponding upstream docs updates (conda/conda-build#5214, conda/conda-build#5215, conda/conda-build#5217, conda/conda-build#5218)

@ytausch ytausch marked this pull request as draft March 6, 2024 19:59
@beckermr
Copy link
Contributor

beckermr commented Mar 6, 2024

This PR is great. I do want to point out that I likely won't have the time or expertise in the short-term to maintain this enhancement by myself.

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.44%. Comparing base (1db2f38) to head (d77d479).

❗ Current head d77d479 differs from pull request most recent head ddcdc37. Consider uploading reports for the commit ddcdc37 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2239   +/-   ##
=======================================
  Coverage   71.44%   71.44%           
=======================================
  Files          99       99           
  Lines        9839     9839           
=======================================
  Hits         7029     7029           
  Misses       2810     2810           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@beckermr
Copy link
Contributor

beckermr commented Mar 7, 2024

@jaimergp has a PR on smithy to add a pydantic model for the conda_forge.yml. This PR should probably pull that model directly from smithy instead of having its own.

@ytausch
Copy link
Contributor Author

ytausch commented Mar 7, 2024

@jaimergp has a PR on smithy to add a pydantic model for the conda_forge.yml. This PR should probably pull that model directly from smithy instead of having its own.

I have noted this here (at the same time as your comment):

TODO Note: There is currently an open PR that aims to add a Pydantic model for the `conda-forge.yml` file to
conda-smithy. This PR is not yet merged, so the important parts of the model are defined here.
In the future, cf-scripts should depend on conda-smithy to obtain the `conda-forge.yml` model from there.
"""

@beckermr
Copy link
Contributor

beckermr commented Mar 7, 2024

The smithy PR will be merged by the end of the week. We should move to using the stuff from smithy now.

@ytausch
Copy link
Contributor Author

ytausch commented Mar 7, 2024

The smithy PR will be merged by the end of the week. We should move to using the stuff from smithy now.

I will not extend the current conda-forge.yml model definition from now since more fields are not used by the bot. We can either wait for the smithy PR to be merged and then change this here or migrate to using smithy as a dependency in a separate PR. I was thinking about the latter option.

In the meantime, I contributed my knowledge to the smithy PR (as comments).

@ytausch ytausch marked this pull request as ready for review March 7, 2024 17:55
@ytausch ytausch requested a review from 0xbe7a March 7, 2024 17:55
@beckermr
Copy link
Contributor

beckermr commented Mar 8, 2024

OK sounds good. I'll leave this PR open then and maybe @jaimergp can help me put in the changes needed to use the new smithy items. Thanks a bunch!

@ytausch
Copy link
Contributor Author

ytausch commented Mar 8, 2024

Confirmation: mypy did not discover any new type issues with the changes of this PR.

@jaimergp
Copy link
Contributor

Thanks! This is on my list for the week. I'll get back to you.

@jaimergp
Copy link
Contributor

The schema is now in conda-smithy@main if you want to update the PR!

@ytausch
Copy link
Contributor Author

ytausch commented Mar 13, 2024

The schema is now in conda-smithy@main if you want to update the PR!

Yes, I will look into it now :)

@ytausch ytausch force-pushed the pydantic branch 2 times, most recently from 8f85468 to 93d282d Compare March 13, 2024 09:26
@ytausch
Copy link
Contributor Author

ytausch commented Mar 14, 2024

The schema is now in conda-smithy@main if you want to update the PR!

blocked by conda-forge/conda-smithy#1858

@beckermr
Copy link
Contributor

The latest smithy is now released. You need v3.32.0

@ytausch
Copy link
Contributor Author

ytausch commented Mar 18, 2024

I want to clarify this PR's status. The following tasks are open, waiting to be resolved:

Those all deal with special cases of the conda-forge.yml validation and only affect the "known bad" feedstock list in the test. Besides that, I consider this PR complete and I will not add any changes related to the issues above.

/Cc @0xbe7a

@beckermr beckermr enabled auto-merge April 5, 2024 20:48
@beckermr beckermr merged commit ef80005 into regro:master Apr 5, 2024
2 checks passed
@ytausch ytausch deleted the pydantic branch April 5, 2024 21:49
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.

4 participants