PhilanthropyDataCommons / service

A project for collecting and serving public information associated with grant applications
GNU Affero General Public License v3.0
8 stars 2 forks source link

Add provenance #1116

Open slifty opened 1 month ago

slifty commented 1 month ago

This PR adds the concept of "provenance" to the PDC. Specifically it makes it possible to associate a "source" to a given proposal version. That source can refer to a funder, an organization, or a "data provider".

This implementation allows any registered user to create new sources or use any existing source. We may eventually add more complex authorization logic to source creation.

Resolves #1094

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 79.23977% with 71 lines in your changes missing coverage. Please review.

Project coverage is 86.82%. Comparing base (0d4fb85) to head (803d1de). Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
src/handlers/dataProvidersHandlers.ts 62.06% 22 Missing :warning:
src/handlers/fundersHandlers.ts 62.06% 22 Missing :warning:
src/handlers/sourcesHandlers.ts 68.00% 16 Missing :warning:
...database/operations/load/loadDataProviderBundle.ts 81.81% 2 Missing :warning:
src/database/operations/load/loadFunderBundle.ts 81.81% 2 Missing :warning:
src/database/operations/load/loadSourceBundle.ts 81.81% 2 Missing :warning:
src/database/operations/create/createSource.ts 92.85% 1 Missing :warning:
...tions/createOrUpdate/createOrUpdateDataProvider.ts 90.00% 1 Missing :warning:
.../operations/createOrUpdate/createOrUpdateFunder.ts 90.00% 1 Missing :warning:
...database/operations/load/loadSystemDataProvider.ts 88.88% 1 Missing :warning:
... and 1 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1116 +/- ## ========================================== - Coverage 88.24% 86.82% -1.43% ========================================== Files 135 156 +21 Lines 1829 2170 +341 Branches 237 286 +49 ========================================== + Hits 1614 1884 +270 - Misses 198 286 +88 + Partials 17 0 -17 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

slifty commented 1 month ago

I went through the missing coverage lines and they all seem to be for lines that we generally are not writing tests for as part of our pattern.

slifty commented 2 weeks ago

Moving this back to draft as I do the refactors based on feedback; I'll ping when this is ready for another review.

slifty commented 1 week ago

@jasonaowen ready for another review.

The major changes are:

  1. No more concept of source_type
  2. funders and data providers have shortCodes instead of ids