You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SDK] Migrate PA/CA example plugins to plugin contract + publish docs #746
Migrate the PA and CA example opportunity transformers to use the new Plugin contract, and publish a getting-started guide for plugin authors on the CommonGrants website. This validates the contract end-to-end with real-world data shapes and gives adopters a reference implementation.
Acceptance criteria
examples/pa-opportunity-example/src/common_grants/utils/opp_transform.py refactored to construct a Plugin via define_plugin(schemas={'Opportunity': ObjectSchemasInput(...)}, extensions=PluginExtensions(...))
A getting-started guide added under website/src/content/docs/ covering: constructing DefinePluginOptions, using definePlugin() / define_plugin(), the three transform construction paths (hand-written, buildTransforms() output, mapping auto-generation via extensions)
Both example plugins pass their existing test suites after migration
changed the title [-][SDK] Migrate PA/CA example adapters to adapter contract + publish docs[/-][+][SDK] Migrate PA/CA example plugins to plugin contract + publish docs[/+]on Apr 22, 2026
You may want to double check this task as I don't think those PA and CA examples are returning real data so I don't think this would validate the contract end to end with real world data.
If you wanted to do something like that you could potentially have something that calls one of the simpler-grants-gov (non common grants) api endpoints and then does a transform of that data to the common grants format and back.
Thanks for flagging this, good catch. Poked at the examples to double-check before moving forward.
The PA and CA data is actually a real snapshot from live state grant APIs (PA from egrants-apibeta.azurewebsites.net, noted in source.txt; CA from data.ca.gov, snapshotted 2025-06-16 per its README). But you're pointing at a real gap regardless: the snapshots are stale, the example tests use made-up fixtures rather than the snapshot content, and nothing exercises the bidirectional to_common / from_common round-trip that the new Plugin contract unlocks.
I'm leaning toward splitting this into two issues instead of rolling everything into #746:
File a sibling issue for a reference plugin that calls a live simpler-grants-gov endpoint (POST /v1/opportunities/search), runs from_common(to_common(x)) on the response, and diffs. Live data plus round-trip, which is the stronger validation you're suggesting. Likely folds into [SDK] Reference plugins #561.
Does that split land well, or would you rather I roll the round-trip work into #746 directly?
I think that split makes sense, I would say for point 2 maybe we could just expand our existing plugins so we don't have the overhead of having to standup a new repo or trying to shove it into the current mono-repo
Makes sense, went with that. Filed #768 to track the from_common + round-trip work on the existing PA/CA examples, with a live-fetch refresh flagged as optional stretch so it doesn't chain to CI flakiness.
Revisiting this as part of trying to build out some of our epics and I think we should maybe put this item in a "would be nice" bucket. I think the other Acceptance criteria will be met by expanding our 2 existing plugins in the common-grants repository.
Closing as not planned during the #1102 triage. Three of the four acceptance criteria target examples/pa-opportunity-example and examples/ca-opportunity-example, which ADR 0029 deletes from the monorepo in #1180. The plugin contract has since been validated by the published plugins in the common-grants org (ts-cg-grants-gov, py-cg-grants-gov, cg-omb) and #561 closed as complete, which matches @jcrichlake's read that the remaining value is covered by the existing plugins.
One piece does not have a home: a plugin-author getting-started guide on the website. Today only ADR 0022 and the SDK extension READMEs cover definePlugin / define_plugin. If we want that guide, it should be filed as a [Website] ticket that does not depend on the legacy examples.
Activity
docs(adr): #657 complete adapter contract sections in ADR 0022
[-][SDK] Migrate PA/CA example adapters to adapter contract + publish docs[/-][+][SDK] Migrate PA/CA example plugins to plugin contract + publish docs[/+]jcrichlake commentedon Apr 23, 2026
You may want to double check this task as I don't think those PA and CA examples are returning real data so I don't think this would validate the contract end to end with real world data.
If you wanted to do something like that you could potentially have something that calls one of the simpler-grants-gov (non common grants) api endpoints and then does a transform of that data to the common grants format and back.
SnowboardTechie commentedon Apr 23, 2026
Thanks for flagging this, good catch. Poked at the examples to double-check before moving forward.
The PA and CA data is actually a real snapshot from live state grant APIs (PA from
egrants-apibeta.azurewebsites.net, noted insource.txt; CA fromdata.ca.gov, snapshotted 2025-06-16 per its README). But you're pointing at a real gap regardless: the snapshots are stale, the example tests use made-up fixtures rather than the snapshot content, and nothing exercises the bidirectionalto_common/from_commonround-trip that the new Plugin contract unlocks.I'm leaning toward splitting this into two issues instead of rolling everything into #746:
POST /v1/opportunities/search), runsfrom_common(to_common(x))on the response, and diffs. Live data plus round-trip, which is the stronger validation you're suggesting. Likely folds into [SDK] Reference plugins #561.Does that split land well, or would you rather I roll the round-trip work into #746 directly?
jcrichlake commentedon Apr 23, 2026
I think that split makes sense, I would say for point 2 maybe we could just expand our existing plugins so we don't have the overhead of having to standup a new repo or trying to shove it into the current mono-repo
SnowboardTechie commentedon Apr 23, 2026
Makes sense, went with that. Filed #768 to track the
from_common+ round-trip work on the existing PA/CA examples, with a live-fetch refresh flagged as optional stretch so it doesn't chain to CI flakiness.jcrichlake commentedon May 8, 2026
Revisiting this as part of trying to build out some of our epics and I think we should maybe put this item in a "would be nice" bucket. I think the other Acceptance criteria will be met by expanding our 2 existing plugins in the common-grants repository.
karinamzalez commentedon Sep 22, 2026
Closing as not planned during the #1102 triage. Three of the four acceptance criteria target
examples/pa-opportunity-exampleandexamples/ca-opportunity-example, which ADR 0029 deletes from the monorepo in #1180. The plugin contract has since been validated by the published plugins in the common-grants org (ts-cg-grants-gov,py-cg-grants-gov,cg-omb) and #561 closed as complete, which matches @jcrichlake's read that the remaining value is covered by the existing plugins.One piece does not have a home: a plugin-author getting-started guide on the website. Today only ADR 0022 and the SDK extension READMEs cover
definePlugin/define_plugin. If we want that guide, it should be filed as a[Website]ticket that does not depend on the legacy examples.