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

feat: toggle hardcoded schema versions #5

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

jamdelion
Copy link
Contributor

@jamdelion jamdelion commented Nov 27, 2024

Linked with issue: Support dynamic querying...

⚠️ This currently just uses a hardcoded list of versions in the dropdown.

Next steps

Next steps are to grab these programatically to populate the dropdown!

I think we should be able to do this with the GH api: GET list releases. It returns an array of items, where one of the item's keys is tag_name, containing the version strings we are currently using in the dropdown.

Screenshots

Screenshot 2024-11-27 at 18 34 41

@jamdelion jamdelion requested a review from a team November 27, 2024 18:51
@jamdelion
Copy link
Contributor Author

Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

Thanks for picking this one up !! 💖

One early comment which might help narrow scope of what we actually want to select/visualise - happy to find time to keep chatting through this one, realise there's a few related outstanding issues around it too that we should coordinate on 🙂

queryKey: ["schemas", version],
queryFn: () =>
fetchFn(
`${DIGITAL_PLANNING_DATA_SCHEMAS_JSON_URL}/${version}/schema.json`
Copy link
Member

Choose a reason for hiding this comment

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

So something tricky to highlight here - since the latest release (v0.7.1), this URL now accounts for a /schemas subdirectory and each released version may have multiple schemas published within in (eg application.json, prototypeApplication.json, preApplication.json, decision.json and so on).

In my mind, the meaningful things to toggle here are:

  • Which schema: Application, PreApplication, PrototypeApplication, so on
  • Which version: "latest" or "next" only?
    • eg this would have tech benefit of letting us deal with same base URL then and just sort of ignore very early versions, which probably aren't as important to visually document? Main purpose of this viewer in my mind is to share with consumers to help explain what they can recieve now and what changes are queued up! Older version in /dist are nice audit history but no longer in active use for any integrations!
    • I know we need to smooth out latest & @next dist folders though! See Smooth out CI build process for @next & latest /dist branch folders digital-planning-data-schemas#242)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok cool! There's some groundwork here which will apply to future work but sounds like next steps are:

  • add another toggle for schema type
  • fix the smooth out CI build issue
  • Change the current version toggle to just include next and latest branches

Let me know if there is anything that should be changed implementation wise for this current PR, otherwise I feel like it could be merged as an incremental step towards the above goals 🥅

Copy link

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

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

Let me know if there is anything that should be changed implementation wise for this current PR, otherwise I feel like it could be merged as an incremental step towards the above goals 🥅

A bit late to the fair here! Very much agree with the above - the next steps here make sense to pick up once we've had a pass through the schema repo and resolved the publishing issues there 👍

}}
value={formik.values.version}
>
// TODO: add query to populate with a list of possible versions

Choose a reason for hiding this comment

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

👍

@jamdelion jamdelion merged commit 992c867 into main Dec 10, 2024
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.

3 participants